mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 05:57:48 +01:00
lyricsss
This commit is contained in:
parent
ece427223f
commit
75f0c6cedf
1 changed files with 42 additions and 14 deletions
44
server.js
44
server.js
|
@ -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,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue