mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 08:58:13 +01:00
do 2
This commit is contained in:
parent
3270d2b5a0
commit
fe86bf06ca
1 changed files with 2 additions and 3 deletions
|
@ -108,9 +108,8 @@ async getYouTubeApiVideo(f, v, contentlang, contentregion) {
|
||||||
var p = this.getJson(await channel_uploads.text());
|
var p = this.getJson(await channel_uploads.text());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retry fetching videoInfo if vid is null, limited to 3 retries
|
let retryCount = 0;
|
||||||
let retryCount = 0;
|
while (vid.error && retryCount < 2) {
|
||||||
while (vid.error && retryCount < 1) {
|
|
||||||
console.log(`Retrying fetching videoInfo... Retry ${retryCount + 1}`);
|
console.log(`Retrying fetching videoInfo... Retry ${retryCount + 1}`);
|
||||||
const retryVideoInfo = await fetch(`https://iv.ggtyler.dev/api/v1/videos/${v}?hl=${contentlang}®ion=${contentregion}&h=${btoa(Date.now())}`).then((res) => res.text());
|
const retryVideoInfo = await fetch(`https://iv.ggtyler.dev/api/v1/videos/${v}?hl=${contentlang}®ion=${contentregion}&h=${btoa(Date.now())}`).then((res) => res.text());
|
||||||
vid = await this.getJson(retryVideoInfo);
|
vid = await this.getJson(retryVideoInfo);
|
||||||
|
|
Loading…
Reference in a new issue