From 808852cdd973b0be2652141a7017663f663224c5 Mon Sep 17 00:00:00 2001 From: Ashley Date: Thu, 13 Oct 2022 17:49:10 +0200 Subject: [PATCH] fix a issue --- src/pt-api.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/pt-api.js b/src/pt-api.js index 21818146..1d06190b 100644 --- a/src/pt-api.js +++ b/src/pt-api.js @@ -93,7 +93,17 @@ async function video(v) { var vid = await JSON.parse(video_new_info); - const c = await channel(video.Video.Channel.id); + const c = await fetch( + `${config.tubeApi}channel?id=${video.Video.Channel.id}&tab=videos` + ) + .then((res) => res.text()) + .then((xml) => JSON.parse(toJson(xml))); + + const a = await fetch( + `${config.tubeApi}channel?id=${video.Video.Channel.id}&tab=about` + ) + .then((res) => res.text()) + .then((xml) => JSON.parse(toJson(xml))); const summary = await wiki .summary(video.Video.Channel.Name) @@ -107,10 +117,11 @@ async function video(v) { json: data.video.Player, video, vid, + channel: c, comments, engagement: data.engagement, wiki: summary, - desc: c.about.Channel.Contents.ItemSection.About.Description, + desc: a.Channel.Contents.ItemSection.About.Description, color: await getColors( `https://i.ytimg.com/vi/${v}/maxresdefault.jpg` ).then((colors) => colors[0].hex()),