max 150... no way i am archiving 4000 videos

This commit is contained in:
unknown 2023-03-24 19:21:15 +01:00
parent 4824f787d5
commit 2506e20125
1 changed files with 2 additions and 0 deletions

View File

@ -58,6 +58,8 @@ async function getChannelVideos(id) {
async function getNextPage(payload) { async function getNextPage(payload) {
const page = await (await fetch(`${instance}/nextpage/channel/${id}?nextpage=${encodeURIComponent(payload)}`)).json() const page = await (await fetch(`${instance}/nextpage/channel/${id}?nextpage=${encodeURIComponent(payload)}`)).json()
videos.push(...page.relatedStreams) videos.push(...page.relatedStreams)
if (videos.length >= 150) resolve(videos)
if (page.nextpage) await getNextPage(page.nextpage) if (page.nextpage) await getNextPage(page.nextpage)
else resolve(videos) else resolve(videos)
} }