mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-29 23:28:42 +01:00
switch to undici :3
This commit is contained in:
parent
5554cb543e
commit
e888271e4a
1 changed files with 4 additions and 2 deletions
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
const { curly } = require("node-libcurl");
|
const { curly } = require("node-libcurl");
|
||||||
const { toJson } = require("xml2json");
|
const { toJson } = require("xml2json");
|
||||||
const fetch = require("node-fetch");
|
|
||||||
|
|
||||||
const YOUTUBE_URL = "https://www.youtube.com/watch?v=";
|
const YOUTUBE_URL = "https://www.youtube.com/watch?v=";
|
||||||
const DISLIKE_API = "https://p.poketube.fun/api?v=";
|
const DISLIKE_API = "https://p.poketube.fun/api?v=";
|
||||||
|
@ -58,6 +57,9 @@ class PokeTubeAPI {
|
||||||
const apiUrl = `${DISLIKE_API}${this.videoId}`;
|
const apiUrl = `${DISLIKE_API}${this.videoId}`;
|
||||||
const fallbackUrl = `https://returnyoutubedislikeapi.com/votes?videoId=${this.videoId}`;
|
const fallbackUrl = `https://returnyoutubedislikeapi.com/votes?videoId=${this.videoId}`;
|
||||||
|
|
||||||
|
const { fetch } = await import("undici");
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const engagement = await fetch(apiUrl).then((res) => res.json());
|
const engagement = await fetch(apiUrl).then((res) => res.json());
|
||||||
return engagement.data;
|
return engagement.data;
|
||||||
|
|
Loading…
Reference in a new issue