mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 03:17:47 +01:00
fix a issue
This commit is contained in:
parent
e7b83a87ea
commit
e5d3ba4c49
1 changed files with 8 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
PokeTube is an Free/Libre youtube front-end !
|
PokeTube is a Free/Libre youtube front-end !
|
||||||
|
|
||||||
Copyright (C) 2021-2022 POKETUBE
|
Copyright (C) 2021-2022 POKETUBE
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
see a copy here:https://www.gnu.org/licenses/lgpl-3.0.txt
|
see a copy here:https://www.gnu.org/licenses/lgpl-3.0.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fetch = require("node-fetch");
|
const fetch = require("node-fetch");
|
||||||
const { toJson } = require("xml2json");
|
const { toJson } = require("xml2json");
|
||||||
|
|
||||||
|
@ -19,7 +20,7 @@ const wiki = require("wikipedia");
|
||||||
const config = {
|
const config = {
|
||||||
tubeApi: "https://tube.kuylar.dev/api/",
|
tubeApi: "https://tube.kuylar.dev/api/",
|
||||||
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
|
||||||
};
|
};
|
||||||
|
|
||||||
// Util functions
|
// Util functions
|
||||||
|
@ -84,7 +85,7 @@ async function video(v) {
|
||||||
|
|
||||||
const data = await fetcher(v);
|
const data = await fetcher(v);
|
||||||
|
|
||||||
const nightlyJsonData = nightlyRes !== "" && getJson(nightlyRes);
|
const nightlyJsonData = getJson(nightlyRes);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
json: data.video.Player,
|
json: data.video.Player,
|
||||||
|
@ -100,9 +101,9 @@ async function video(v) {
|
||||||
? {
|
? {
|
||||||
beta: nightlyJsonData,
|
beta: nightlyJsonData,
|
||||||
badges: nightlyJsonData.channel.badges[0],
|
badges: nightlyJsonData.channel.badges[0],
|
||||||
comments: nightlyJsonData.commentCount
|
comments: nightlyJsonData.commentCount,
|
||||||
}
|
}
|
||||||
: {})
|
: {}),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,5 +122,5 @@ async function search(query, cnt) {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
search,
|
search,
|
||||||
video,
|
video,
|
||||||
channel
|
channel,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue