mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-26 16:18:44 +01:00
faster fetching :3
This commit is contained in:
parent
7202f1f79f
commit
8e1d3c1ba3
1 changed files with 2 additions and 12 deletions
|
@ -81,8 +81,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
const isvld = await core.isvalidvideo(v);
|
const isvld = await core.isvalidvideo(v);
|
||||||
|
|
||||||
if (isvld) {
|
if (isvld) {
|
||||||
for (let i = 0; i < 3; i++) {
|
|
||||||
try {
|
|
||||||
core.video(v).then((data) => {
|
core.video(v).then((data) => {
|
||||||
const k = data.video;
|
const k = data.video;
|
||||||
const json = data.json;
|
const json = data.json;
|
||||||
|
@ -141,16 +140,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
lyrics: "",
|
lyrics: "",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
break;
|
|
||||||
} catch (err) {
|
|
||||||
if (err.status === 503) {
|
|
||||||
// retry after a bit
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
res.redirect("/");
|
res.redirect("/");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue