fix dislikes

This commit is contained in:
Ashley 2022-12-09 19:03:28 +00:00
parent ea288f2de9
commit 35fc9f9b7f

View file

@ -24,11 +24,18 @@ var dislike_api = `https://returnyoutubedislikeapi.com/votes?videoId=`;
var new_api_url = `https://tube.kuylar.dev/api/player`;
module.exports = async function (video_id) {
const dislike = await fetch(`${dislike_api}${video_id}`).then((res) =>
res.json()
);
const dislikes = dislike.dislikes || "none";
function getJson(str) {
try {
return JSON.parse(str);
} catch {
return null;
}
}
const dislike = await fetch(`${dislike_api}${video_id}`).then((res) =>
getJson(res)
);
const headers = {};
/*