mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 19:38:15 +01:00
faster fetching :3
This commit is contained in:
parent
13dd86cc1d
commit
331c87d1b7
1 changed files with 3 additions and 0 deletions
|
@ -27,6 +27,8 @@ module.exports = async function (video_id) {
|
||||||
const dislike = await fetch(`${dislike_api}${video_id}`).then((res) =>
|
const dislike = await fetch(`${dislike_api}${video_id}`).then((res) =>
|
||||||
res.json()
|
res.json()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const dislikes = dislike.dislikes || "none";
|
const dislikes = dislike.dislikes || "none";
|
||||||
|
|
||||||
const headers = {};
|
const headers = {};
|
||||||
|
@ -41,6 +43,7 @@ module.exports = async function (video_id) {
|
||||||
var h = await player.text();
|
var h = await player.text();
|
||||||
var j = toJson(h);
|
var j = toJson(h);
|
||||||
return JSON.parse(j);
|
return JSON.parse(j);
|
||||||
|
break;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.status === 503) {
|
if (err.status === 503) {
|
||||||
// retry after a bit
|
// retry after a bit
|
||||||
|
|
Loading…
Reference in a new issue