diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index a2b18e8b..f3e0f85f 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -110,7 +110,7 @@ async getYouTubeApiVideo(f, v, contentlang, contentregion) { // Retry fetching videoInfo if vid is null, limited to 3 retries let retryCount = 0; - while (!vid && retryCount < 3) { + while (vid.error && retryCount < 3) { console.log(`Retrying fetching videoInfo... Retry ${retryCount + 1}`); const retryVideoInfo = await fetch(`${this.config.invapi}/videos/${v}?hl=${contentlang}®ion=${contentregion}&h=${btoa(Date.now())}`).then((res) => res.text()); vid = await this.getJson(retryVideoInfo);