mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 05:57:48 +01:00
Update 'server.js'
This commit is contained in:
parent
3e35930728
commit
d4b92acd65
1 changed files with 29 additions and 4 deletions
27
server.js
27
server.js
|
@ -43,6 +43,12 @@ var sha512_224 = require("js-sha512").sha512_224;
|
||||||
|
|
||||||
const musicInfo = require("music-info");
|
const musicInfo = require("music-info");
|
||||||
|
|
||||||
|
var http = require('http');
|
||||||
|
var https = require('https');
|
||||||
|
|
||||||
|
http.globalAgent.maxSockets = Infinity;
|
||||||
|
https.globalAgent.maxSockets = Infinity;
|
||||||
|
|
||||||
var app = express();
|
var app = express();
|
||||||
app.engine("html", require("ejs").renderFile);
|
app.engine("html", require("ejs").renderFile);
|
||||||
app.use(express.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
|
app.use(express.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
|
||||||
|
@ -80,6 +86,25 @@ const config = {
|
||||||
|
|
||||||
// pages
|
// pages
|
||||||
|
|
||||||
|
|
||||||
|
app.use(function(req, res, next) {
|
||||||
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
|
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
app.get("/api/subtitles", async (req, res) => {
|
||||||
|
const id = req.query.v;
|
||||||
|
const l = req.query.h;
|
||||||
|
|
||||||
|
const url = `https://tube.kuylar.dev/proxy/caption/${id}/${l}/`
|
||||||
|
|
||||||
|
let f = await fetch(url);
|
||||||
|
const body = await f.text();
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
@ -152,7 +177,6 @@ app.get("/watch", async function (req, res) {
|
||||||
if (q === "medium") {
|
if (q === "medium") {
|
||||||
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 =
|
const url_e =
|
||||||
url +
|
url +
|
||||||
|
@ -489,3 +513,4 @@ app.get("*", function (req, res) {
|
||||||
// listen
|
// listen
|
||||||
|
|
||||||
app.listen("3000", () => {});
|
app.listen("3000", () => {});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue