adding auto downloading checking

This commit is contained in:
unknown 2023-03-10 20:29:19 +01:00
parent 8aebe67620
commit 295e743024
1 changed files with 6 additions and 0 deletions

View File

@ -34,6 +34,12 @@ async function handleDownload(channelId) {
}) })
if (already) continue if (already) continue
if (await redis.get(id)) {
logger.info({ message: `Someone is already downloading ${video.title}, ${id}` })
continue
}
await redis.set(id, 'downloading')
logger.info({ message: `Starting to download ${video.title}, ${id}` }) logger.info({ message: `Starting to download ${video.title}, ${id}` })
const download = await ytdlp.downloadVideo('https://www.youtube.com' + video.url) const download = await ytdlp.downloadVideo('https://www.youtube.com' + video.url)