This commit is contained in:
unknown 2023-03-24 15:23:10 +01:00
parent 16e87dd51f
commit 66f249b2f3
1 changed files with 2 additions and 1 deletions

View File

@ -39,7 +39,7 @@ async function getChannel(id) {
} }
} }
async function getChannelVideos(instance, id) { async function getChannelVideos(id) {
for (let i = 0; i < 5; i++) { for (let i = 0; i < 5; i++) {
const videos = await actualRequest() const videos = await actualRequest()
if (videos) return videos if (videos) return videos
@ -49,6 +49,7 @@ async function getChannelVideos(instance, id) {
try { try {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const videos = [] const videos = []
const instance = await getInstance()
const json = await (await fetch(`${instance}/channel/${id}`)).json() const json = await (await fetch(`${instance}/channel/${id}`)).json()
videos.push(...json.relatedStreams) videos.push(...json.relatedStreams)
if (json.nextpage) await getNextPage(json.nextpage) if (json.nextpage) await getNextPage(json.nextpage)