Skip to content

Commit

Permalink
devfix: TikTok Downloader
Browse files Browse the repository at this point in the history
Adding sleep to set distance between conversion and download
  • Loading branch information
gensart-ai committed Mar 24, 2024
1 parent d968d93 commit 5ac137a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/services/external/tiktok-downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Executor } from '@/command-hive';
import * as wweb from '@utils/wweb';
import * as logger from '@utils/logger';
import config from '@/env';
import { setTimeout as sleep } from 'timers/promises';
import { MessageMedia } from 'whatsapp-web.js';

const CONVERTER_URL: string = 'https://c.ceeo.cc/api/v1/init?23=1llum1n471&_=41211514';
Expand Down Expand Up @@ -58,6 +59,7 @@ const downloadTikTokVideo = async (tiktokUrl: string) => {
const finalEndpoint = convertUrl + '&' + tiktokUrlMetadata;
const downloadUrl = await retrieveDownloadUrl(finalEndpoint);

sleep(3000);
return downloadMedia(downloadUrl);
}

Expand Down

0 comments on commit 5ac137a

Please sign in to comment.