mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 14:48:33 +01:00
fix dislikes
This commit is contained in:
parent
684a144ec9
commit
120f2d52c9
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