mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 14:38:17 +01:00
smart desc :3
This commit is contained in:
parent
f49016d103
commit
0508efe76e
1 changed files with 15 additions and 3 deletions
12
server.js
12
server.js
|
@ -38,6 +38,8 @@ var useragent = require("express-useragent");
|
||||||
const sha384 = require("js-sha512").sha384;
|
const sha384 = require("js-sha512").sha384;
|
||||||
|
|
||||||
const musicInfo = require("music-info");
|
const musicInfo = require("music-info");
|
||||||
|
const wiki = require('wikipedia');
|
||||||
|
|
||||||
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
var https = require('https');
|
var https = require('https');
|
||||||
|
@ -98,9 +100,12 @@ app.use(function(req, res, next) {
|
||||||
const body = await f.text();
|
const body = await f.text();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
res.send(body)
|
res.send(body)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
app.get("/encryption", async function (req, res) {
|
app.get("/encryption", async function (req, res) {
|
||||||
var v = req.query.v;
|
var v = req.query.v;
|
||||||
|
|
||||||
|
@ -176,6 +181,7 @@ app.get("/watch", async function (req, res) {
|
||||||
if (n === undefined) { comments = ""; }
|
if (n === undefined) { comments = ""; }
|
||||||
if (n !== undefined) { comments = JSON.parse(n).commentCount }
|
if (n !== undefined) { comments = JSON.parse(n).commentCount }
|
||||||
|
|
||||||
|
|
||||||
var fetching = await fetcher(v);
|
var fetching = await fetcher(v);
|
||||||
|
|
||||||
const json = fetching.video.Player;
|
const json = fetching.video.Player;
|
||||||
|
@ -209,6 +215,11 @@ app.get("/watch", async function (req, res) {
|
||||||
// lyrics
|
// lyrics
|
||||||
const lyrics = await lyricsFinder(json.Title);
|
const lyrics = await lyricsFinder(json.Title);
|
||||||
|
|
||||||
|
const summary = await wiki.summary(json.Channel.Name);
|
||||||
|
|
||||||
|
var w = ""
|
||||||
|
if(summary.title === "Not found.") { w = "none" }
|
||||||
|
if(summary.title !== "Not found.") {w = summary}
|
||||||
|
|
||||||
renderTemplate(res, req, "poketube.ejs", {
|
renderTemplate(res, req, "poketube.ejs", {
|
||||||
url: url_e,
|
url: url_e,
|
||||||
|
@ -227,6 +238,7 @@ app.get("/watch", async function (req, res) {
|
||||||
r: r,
|
r: r,
|
||||||
qua: q,
|
qua: q,
|
||||||
ip:ip,
|
ip:ip,
|
||||||
|
wiki:w,
|
||||||
f: f,
|
f: f,
|
||||||
t: config.t_url,
|
t: config.t_url,
|
||||||
optout: t,
|
optout: t,
|
||||||
|
|
Loading…
Reference in a new issue