mirror of https://github.com/preservetube/auto.git
even lower...
This commit is contained in:
parent
f07c4becf2
commit
2d739119e7
11
index.js
11
index.js
|
@ -42,12 +42,7 @@ async function check() {
|
||||||
const channels = await prisma.autodownload.findMany()
|
const channels = await prisma.autodownload.findMany()
|
||||||
|
|
||||||
channels.forEach(async (c) => {
|
channels.forEach(async (c) => {
|
||||||
if (await redis.get(c.channel)) {
|
channelQueue.createJob(c).save()
|
||||||
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video.duration > 7200) {
|
if (video.duration > 1800) {
|
||||||
logger.info({ message: `${video.title} is longer than 2h, ${id}` })
|
logger.info({ message: `${video.title} is longer than 30m, ${id}` })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ async function getChannelVideos(id) {
|
||||||
})).json()
|
})).json()
|
||||||
videos.push(...page.relatedStreams)
|
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)
|
if (page.nextpage) await getNextPage(page.nextpage)
|
||||||
else return resolve(videos)
|
else return resolve(videos)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue