mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-17 10:34:38 -05:00
change api owo
This commit is contained in:
parent
dce03da3d4
commit
d2c1092eae
1 changed files with 9 additions and 7 deletions
|
@ -23,7 +23,7 @@ const sqp =
|
||||||
"-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw";
|
"-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw";
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
tubeApi: "https://tube-srv.ashley143.gay/api/",
|
tubeApi: "https://api.poketube.fun/api/",
|
||||||
invapi: "https://yt.oelrichsgarcia.de/api/v1",
|
invapi: "https://yt.oelrichsgarcia.de/api/v1",
|
||||||
dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=",
|
dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=",
|
||||||
t_url: "https://t.poketube.fun/", // def matomo url
|
t_url: "https://t.poketube.fun/", // def matomo url
|
||||||
|
@ -93,7 +93,7 @@ async function video(v) {
|
||||||
let vid;
|
let vid;
|
||||||
|
|
||||||
try {
|
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);
|
vid = await getJson(videoInfo);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
||||||
|
@ -128,15 +128,17 @@ async function video(v) {
|
||||||
const data = await fetcher(v);
|
const data = await fetcher(v);
|
||||||
|
|
||||||
const nightlyJsonData = getJson(nightlyRes);
|
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
|
// Store result in cache
|
||||||
cache[v] = {
|
cache[v] = {
|
||||||
result: {
|
result: {
|
||||||
json: data?.video?.Player,
|
json: data?.video?.Player,
|
||||||
video: await fetch(`${config.tubeApi}video?v=${v}`)
|
video,
|
||||||
.then((res) => res.text())
|
|
||||||
.then((xml) => getJson(toJson(xml)))
|
|
||||||
.catch(" "),
|
|
||||||
vid,
|
vid,
|
||||||
comments,
|
comments,
|
||||||
engagement: data.engagement,
|
engagement: data.engagement,
|
||||||
|
|
Loading…
Reference in a new issue