mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 05:57:48 +01:00
fix dislikes
This commit is contained in:
parent
ea288f2de9
commit
35fc9f9b7f
1 changed files with 11 additions and 4 deletions
|
@ -24,11 +24,18 @@ var dislike_api = `https://returnyoutubedislikeapi.com/votes?videoId=`;
|
||||||
var new_api_url = `https://tube.kuylar.dev/api/player`;
|
var new_api_url = `https://tube.kuylar.dev/api/player`;
|
||||||
|
|
||||||
module.exports = async function (video_id) {
|
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 = {};
|
const headers = {};
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue