From 416c08a58d09fa225f557672efe51d32fa0e4065 Mon Sep 17 00:00:00 2001 From: Ashley Date: Mon, 26 Sep 2022 17:09:50 +0200 Subject: [PATCH] fix a issue --- server.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server.js b/server.js index 6e37654d..960a8d6c 100644 --- a/server.js +++ b/server.js @@ -341,10 +341,13 @@ app.get("/music", async function (req, res) { var fetching = await fetcher(v); const json = fetching.video.Player; + const h = await video.text(); const k = JSON.parse(toJson(h)); - - if (!k.Video.Channel.Name.endsWith(" - Topic")) { + + + + if (!json.Channel.Name.endsWith(" - Topic")) { res.redirect(`/watch?v=${v}`); } @@ -372,7 +375,7 @@ app.get("/music", async function (req, res) { // info const song = await musicInfo.searchSong( - { title: k.Video.Title, artist: k.Video.Channel.Name.replace("- Topic", "") }, + { title: k.Video.Title, artist: json.Channel.Name.replace("- Topic", "") }, 1000 );