mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 23:57:50 +01:00
does this work idk qwq
This commit is contained in:
parent
cefc461e24
commit
0ade5a6253
1 changed files with 13 additions and 12 deletions
|
@ -41,16 +41,17 @@ class PokeTubeDislikesAPIManager {
|
|||
* @private
|
||||
*/
|
||||
async _getEngagementData() {
|
||||
const apiUrl = `https://returnyoutubedislikesapi.com/votes?v=${this.videoId}&hash=d0550b6e28c8f93533a569c314d5b4e2`;
|
||||
var url = [`https://p.poketube.fun/api?v=${this.videoId}&hash=d0550b6e28c8f93533a569c314d5b4e2`, `https://returnyoutubedislikeapi.com/votes?videoId=${this.videoId}`]
|
||||
const dislikes =
|
||||
url[Math.floor(Math.random() * url.length)];
|
||||
|
||||
|
||||
const { fetch } = await import("undici");
|
||||
var engagementp = await fetch(apiUrl)
|
||||
|
||||
var engagement = await engagementp.json();
|
||||
const engagement = await fetch(dislikes).then((res) => res.json());
|
||||
return engagement;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves data about the YouTube video and its engagement.
|
||||
* @returns {Promise<object>} A Promise that resolves with an object containing video and engagement data.
|
||||
|
@ -74,7 +75,7 @@ var engagement = await engagementp.json();
|
|||
}
|
||||
|
||||
/*
|
||||
Returns basic data about a given YouTube video using PokeTubeDislikesAPIManager.
|
||||
Returns basic data about a given YouTube video using PokeTubeAPI.
|
||||
@async
|
||||
@function
|
||||
@param {string} videoId - The YouTube video ID to get data for.
|
||||
|
@ -84,7 +85,7 @@ Returns basic data about a given YouTube video using PokeTubeDislikesAPIManager.
|
|||
|
||||
const getDislikesData = async (videoId) => {
|
||||
const pokeTubeAPI = new PokeTubeDislikesAPIManager(videoId);
|
||||
return await PokeTubeDislikesAPIManager.getData();
|
||||
return await pokeTubeAPI.getData();
|
||||
};
|
||||
|
||||
module.exports = getDislikesData;
|
||||
|
|
Loading…
Reference in a new issue