From 2d739119e7d3a0a5c10413ac24b4f35e83a556ff Mon Sep 17 00:00:00 2001 From: localhost Date: Tue, 12 Mar 2024 19:59:31 +0100 Subject: [PATCH] even lower... --- index.js | 11 +++-------- utils/metadata.js | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index c645dd2..338552f 100644 --- a/index.js +++ b/index.js @@ -42,12 +42,7 @@ async function check() { const channels = await prisma.autodownload.findMany() channels.forEach(async (c) => { - if (await redis.get(c.channel)) { - logger.info({ message: `${c.channel} is already being downloaded` }) - } else { - await redis.set(c.channel, 'downloading') - channelQueue.createJob(c).save() - } + channelQueue.createJob(c).save() }) } @@ -77,8 +72,8 @@ async function checkChannel(channelId) { return } - if (video.duration > 7200) { - logger.info({ message: `${video.title} is longer than 2h, ${id}` }) + if (video.duration > 1800) { + logger.info({ message: `${video.title} is longer than 30m, ${id}` }) return } diff --git a/utils/metadata.js b/utils/metadata.js index 1836c4d..eb75b2c 100644 --- a/utils/metadata.js +++ b/utils/metadata.js @@ -90,7 +90,7 @@ async function getChannelVideos(id) { })).json() videos.push(...page.relatedStreams) - if (videos.length >= 30) return resolve(videos.slice(0,5)) + if (videos.length >= 30) return resolve(videos.slice(0,1)) if (page.nextpage) await getNextPage(page.nextpage) else return resolve(videos) }