mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 21:17:58 +01:00
fix dislikes
This commit is contained in:
parent
ea288f2de9
commit
35fc9f9b7f
1 changed files with 11 additions and 4 deletions
|
@ -24,13 +24,20 @@ var dislike_api = `https://returnyoutubedislikeapi.com/votes?videoId=`;
|
|||
var new_api_url = `https://tube.kuylar.dev/api/player`;
|
||||
|
||||
module.exports = async function (video_id) {
|
||||
|
||||
function getJson(str) {
|
||||
try {
|
||||
return JSON.parse(str);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const dislike = await fetch(`${dislike_api}${video_id}`).then((res) =>
|
||||
res.json()
|
||||
getJson(res)
|
||||
);
|
||||
|
||||
const dislikes = dislike.dislikes || "none";
|
||||
|
||||
const headers = {};
|
||||
const headers = {};
|
||||
/*
|
||||
* Parses and fetches an xml
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue