This commit is contained in:
Ashley 2022-08-19 23:32:38 +02:00
parent 9802cad2b0
commit 0dbc93ac0f

View file

@ -149,7 +149,14 @@ app.get("/watch", async function (req, res) {
} }
// encryption // encryption
const url_e = url + "?e=" + sha384(json.id) + sha384(json.Title) + sha384(json.Channel.id) + sha384(json.Channel.id) + "Piwik" + sha384(config.t_url); const url_e =
url +
"?e=" +
sha384(json.Title) +
sha384(json.Channel.id) +
sha384(json.Channel.id) +
"Piwik" +
sha384(config.t_url);
// channel info // channel info
const engagement = fetching.engagement; const engagement = fetching.engagement;
@ -180,7 +187,7 @@ app.get("/watch", async function (req, res) {
f: f, f: f,
t: config.t_url, t: config.t_url,
optout: t, optout: t,
lyrics: "" lyrics: "",
}); });
}); });
@ -217,7 +224,15 @@ app.get("/music", async function (req, res) {
var url = `https://tube.kuylar.dev/proxy/media/${v}/18`; var url = `https://tube.kuylar.dev/proxy/media/${v}/18`;
// encryption // encryption
const url_e = url + "?e=" + sha384(json.id) + sha384(json.Title) + sha384(json.Channel.id) + sha384(json.Channel.id) + "Piwik" + sha384(config.t_url); const url_e =
url +
"?e=" +
sha384(json.id) +
sha384(json.Title) +
sha384(json.Channel.id) +
sha384(json.Channel.id) +
"Piwik" +
sha384(config.t_url);
// channel info // channel info
const engagement = fetching.engagement; const engagement = fetching.engagement;
@ -227,12 +242,25 @@ app.get("/music", async function (req, res) {
const c = await channel.text(); const c = await channel.text();
const tj = JSON.parse(toJson(c)); const tj = JSON.parse(toJson(c));
// lyrics
const lyrics = await lyricsFinder(json.Title);
// info // info
const info = await musicInfo.searchSong({ title: json.Title, artist:json.Channel.Name.replace("- Topic", "")}, 1000) const info = await musicInfo.searchSong(
{ title: json.Title, artist: json.Channel.Name.replace("- Topic", "") },
1000
);
var lyrics = await musicInfo
.searchLyrics({ title: info.title, artist: info.artist })
.catch(() => null);
var ly = "";
if (lyrics === null) {
ly = "This Is Where I'd Put The songs lyrics. IF IT HAD ONE ";
}
if (lyrics) {
ly = lyrics.lyrics.replace(/\n/g, " <br> ");
}
renderTemplate(res, req, "poketube-music.ejs", { renderTemplate(res, req, "poketube-music.ejs", {
url: url_e, url: url_e,
@ -252,7 +280,7 @@ app.get("/music", async function (req, res) {
f: f, f: f,
t: config.t_url, t: config.t_url,
optout: t, optout: t,
lyrics: "" lyrics: ly,
}); });
}); });