mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-24 18:38:40 +01:00
Update 'src/pt-api.js'
This commit is contained in:
parent
331c87d1b7
commit
bdd1ee952b
1 changed files with 12 additions and 1 deletions
|
@ -7,6 +7,9 @@
|
|||
This file is Licensed under LGPL-3.0-or-later. Poketube itself is GPL, Only this file is LGPL.
|
||||
|
||||
see a copy here:https://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
|
||||
please dont remove this comment while sharing this code
|
||||
|
||||
*/
|
||||
|
||||
const fetch = require("node-fetch");
|
||||
|
@ -19,6 +22,7 @@ const wiki = require("wikipedia");
|
|||
|
||||
const config = {
|
||||
tubeApi: "https://tube.kuylar.dev/api/",
|
||||
invapi: "https://inv.vern.cc/api/v1",
|
||||
dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=",
|
||||
t_url: "https://t.poketube.fun/", // def matomo url
|
||||
};
|
||||
|
@ -77,6 +81,12 @@ async function video(v) {
|
|||
.then((res) => res.text())
|
||||
.then((xml) => JSON.parse(toJson(xml)));
|
||||
|
||||
var i = await fetch(`${config.invapi}/comments/${v}`).then((res) =>
|
||||
res.text()
|
||||
);
|
||||
|
||||
var inv = await JSON.parse(i);
|
||||
|
||||
const c = await channel(video.Video.Channel.id);
|
||||
|
||||
const summary = await wiki
|
||||
|
@ -90,6 +100,7 @@ async function video(v) {
|
|||
return {
|
||||
json: data.video.Player,
|
||||
video,
|
||||
inv,
|
||||
engagement: data.engagement,
|
||||
wiki: summary,
|
||||
desc: c.about.Channel.Contents.ItemSection.About.Description,
|
||||
|
@ -123,4 +134,4 @@ module.exports = {
|
|||
search,
|
||||
video,
|
||||
channel,
|
||||
};
|
||||
};
|
Loading…
Reference in a new issue