diff --git a/src/libpoketube/libpoketube-fetcher.js b/src/libpoketube/libpoketube-fetcher.js index 2438207b..7bda8c13 100644 --- a/src/libpoketube/libpoketube-fetcher.js +++ b/src/libpoketube/libpoketube-fetcher.js @@ -27,7 +27,7 @@ module.exports = async function (video_id) { const dislike = await fetch(`${dislike_api}${video_id}`).then((res) => res.json() ); - + const dislikes = dislike.dislikes || "none"; const headers = {}; @@ -36,22 +36,10 @@ module.exports = async function (video_id) { */ async function parsexml(id) { - for (let i = 0; i < 2; i++) { - try { - const player = await fetch(`${new_api_url}?v=${id}`, headers); - var h = await player.text(); - var j = toJson(h); - return JSON.parse(j); - break; - } catch (err) { - if (err.status === 503) { - // retry after a bit - await new Promise((resolve) => setTimeout(resolve, 1000)); - } else { - return ""; - } - } - } + const player = await fetch(`${new_api_url}?v=${id}`, headers); + var h = await player.text(); + var j = toJson(h); + return JSON.parse(j); } /*