From bdd1ee952b64518d14cec2e3a3079114e5b706b3 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 12 Oct 2022 16:40:31 +0200 Subject: [PATCH] Update 'src/pt-api.js' --- src/pt-api.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/pt-api.js b/src/pt-api.js index afea2e59..c731c57a 100644 --- a/src/pt-api.js +++ b/src/pt-api.js @@ -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, -}; +}; \ No newline at end of file