update thignys

This commit is contained in:
Ashley 2022-11-16 11:45:08 +01:00
parent 5c0e4bc21e
commit 714d988aa7

View file

@ -2,13 +2,16 @@ const fs = require("fs");
const express = require("express");
const fetch = require("node-fetch");
const htmlParser = require("node-html-parser");
const lyrics = require("./lyrics.js");
const app = express();
app.use(express.json()); // for parsing application/json
app.use(express.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
next();
});
let Proxy = async (req, res) => {
const url = "https://" + req.originalUrl.slice(10);
@ -43,18 +46,10 @@ const listener = (req, res) => {
Proxy(req, res);
};
app.get("/", (req, res) => res.redirect(`https://poketube.fun/watch?v=l3eww1dnd0k&trck=we_dont_lol&hi=mom&i_like_this=yes&omgfr=tru&AAAAA=BBBBBB&unclebenwhathappend=squidgames`));
app.get("/api/lyrics", async (req, res) => {
const query = req.query.query;
res.json(await lyrics(query))
});
app.get("/", (req, res) =>
res.redirect(`https://poketube.fun/watch?v=l3eww1dnd0k`)
);
app.all("/*", listener);
app.listen(3000, () => {});