mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 04:38:56 +01:00
server info :3
This commit is contained in:
parent
02360a2763
commit
6753d829f0
1 changed files with 10 additions and 3 deletions
13
server.js
13
server.js
|
@ -66,6 +66,7 @@ const random_words = [
|
||||||
"how to become a god?",
|
"how to become a god?",
|
||||||
"is a panda a panda if pandas???",
|
"is a panda a panda if pandas???",
|
||||||
"Minecraft movie trailer",
|
"Minecraft movie trailer",
|
||||||
|
"monke"
|
||||||
];
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -215,6 +216,10 @@ app.get("/music", async function (req, res) {
|
||||||
var f = req.query.f;
|
var f = req.query.f;
|
||||||
var t = req.query.t;
|
var t = req.query.t;
|
||||||
|
|
||||||
|
const info = await fetch("http://ip-api.com/json/");
|
||||||
|
const n = await info.text();
|
||||||
|
const ip = JSON.parse(n);
|
||||||
|
|
||||||
if (!v) res.redirect("/");
|
if (!v) res.redirect("/");
|
||||||
|
|
||||||
const video = await fetch(config.tubeApi + `video?v=${v}`);
|
const video = await fetch(config.tubeApi + `video?v=${v}`);
|
||||||
|
@ -251,13 +256,13 @@ app.get("/music", async function (req, res) {
|
||||||
const tj = JSON.parse(toJson(c));
|
const tj = JSON.parse(toJson(c));
|
||||||
|
|
||||||
// info
|
// info
|
||||||
const info = await musicInfo.searchSong(
|
const song = await musicInfo.searchSong(
|
||||||
{ title: json.Title, artist: json.Channel.Name.replace("- Topic", "") },
|
{ title: json.Title, artist: json.Channel.Name.replace("- Topic", "") },
|
||||||
1000
|
1000
|
||||||
);
|
);
|
||||||
|
|
||||||
var lyrics = await musicInfo
|
var lyrics = await musicInfo
|
||||||
.searchLyrics({ title: info.title, artist: info.artist })
|
.searchLyrics({ title: song.title, artist: song.artist })
|
||||||
.catch(() => null);
|
.catch(() => null);
|
||||||
|
|
||||||
var ly = "";
|
var ly = "";
|
||||||
|
@ -272,11 +277,13 @@ app.get("/music", async function (req, res) {
|
||||||
|
|
||||||
renderTemplate(res, req, "poketube-music.ejs", {
|
renderTemplate(res, req, "poketube-music.ejs", {
|
||||||
url: url_e,
|
url: url_e,
|
||||||
info: info,
|
info: song,
|
||||||
color: await getColors(
|
color: await getColors(
|
||||||
`https://i.ytimg.com/vi/${v}/maxresdefault.jpg`
|
`https://i.ytimg.com/vi/${v}/maxresdefault.jpg`
|
||||||
).then((colors) => colors[0].hex()),
|
).then((colors) => colors[0].hex()),
|
||||||
engagement: engagement,
|
engagement: engagement,
|
||||||
|
process:process,
|
||||||
|
ip:ip,
|
||||||
video: json,
|
video: json,
|
||||||
date: moment(k.Video.uploadDate).format("LL"),
|
date: moment(k.Video.uploadDate).format("LL"),
|
||||||
e: e,
|
e: e,
|
||||||
|
|
Loading…
Reference in a new issue