mirror of https://github.com/preservetube/auto.git
even lower...
This commit is contained in:
parent
f07c4becf2
commit
2d739119e7
9
index.js
9
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()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue