From 1504e70737c2159a8f6a455b84803d34ad347050 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 12 Oct 2022 17:03:43 +0200 Subject: [PATCH] comments :3 --- src/pt-api.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/pt-api.js b/src/pt-api.js index c731c57..2181814 100644 --- a/src/pt-api.js +++ b/src/pt-api.js @@ -81,11 +81,17 @@ async function video(v) { .then((res) => res.text()) .then((xml) => JSON.parse(toJson(xml))); - var i = await fetch(`${config.invapi}/comments/${v}`).then((res) => + var inv_comments = await fetch(`${config.invapi}/comments/${v}`).then((res) => res.text() ); - var inv = await JSON.parse(i); + var comments = await JSON.parse(inv_comments); + + var video_new_info = await fetch(`${config.invapi}/videos/${v}`).then((res) => + res.text() + ); + + var vid = await JSON.parse(video_new_info); const c = await channel(video.Video.Channel.id); @@ -100,7 +106,8 @@ async function video(v) { return { json: data.video.Player, video, - inv, + vid, + comments, engagement: data.engagement, wiki: summary, desc: c.about.Channel.Contents.ItemSection.About.Description, @@ -134,4 +141,4 @@ module.exports = { search, video, channel, -}; \ No newline at end of file +};