From e7b83a87ea0630d161e664e8f633f5ad9200b994 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 9 Oct 2022 14:38:40 +0200 Subject: [PATCH] fixed the ReferenceError: Cannot access 'channel' before initialization error --- src/pt-api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pt-api.js b/src/pt-api.js index 55b665a8..142ffa77 100644 --- a/src/pt-api.js +++ b/src/pt-api.js @@ -76,7 +76,7 @@ async function video(v) { .then((res) => res.text()) .then((xml) => JSON.parse(toJson(xml))); - const channel = await channel(video.Video.Channel.id); + const c = await channel(video.Video.Channel.id); const summary = await wiki .summary(video.Video.Channel.Name) @@ -91,7 +91,7 @@ async function video(v) { video, engagement: data.engagement, wiki: summary, - desc: channel.about.Channel.Contents.ItemSection.About.Description, + desc: c.about.Channel.Contents.ItemSection.About.Description, color: await getColors( `https://i.ytimg.com/vi/${v}/maxresdefault.jpg` ).then((colors) => colors[0].hex()),