diff --git a/utils/auto.js b/utils/auto.js index c8d9d84..a40b94b 100644 --- a/utils/auto.js +++ b/utils/auto.js @@ -34,6 +34,12 @@ async function handleDownload(channelId) { }) 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}` }) const download = await ytdlp.downloadVideo('https://www.youtube.com' + video.url)