From d2c1092eaee100a063071260959fa5742d705f24 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 5 Mar 2023 12:19:14 +0000 Subject: [PATCH] change api owo --- src/libpoketube/libpoketube-core.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index 6deea38b..1cc24660 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -23,7 +23,7 @@ const sqp = "-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw"; const config = { - tubeApi: "https://tube-srv.ashley143.gay/api/", + tubeApi: "https://api.poketube.fun/api/", invapi: "https://yt.oelrichsgarcia.de/api/v1", dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=", t_url: "https://t.poketube.fun/", // def matomo url @@ -93,7 +93,7 @@ async function video(v) { let vid; try { - const videoInfo = await fetch(`https://yt.oelrichsgarcia.de/api/v1/videos/${v}?region=US`).then(res => res.text()); + const videoInfo = await fetch(`https://inv.vern.cc/api/v1/videos/${v}?region=US`).then(res => res.text()); vid = await getJson(videoInfo); } catch (error) { @@ -128,15 +128,17 @@ async function video(v) { const data = await fetcher(v); const nightlyJsonData = getJson(nightlyRes); - + const video = await fetch(`${config.tubeApi}video?v=${v}`) + .then((res) => res.text()) + .then((xml) => getJson(toJson(xml))) + .catch(" ") + + // Store result in cache cache[v] = { result: { json: data?.video?.Player, - video: await fetch(`${config.tubeApi}video?v=${v}`) - .then((res) => res.text()) - .then((xml) => getJson(toJson(xml))) - .catch(" "), + video, vid, comments, engagement: data.engagement,