From a3e960c1e73999731783c3eca61b83ea87a74d02 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 22 Jun 2022 16:33:03 +0300 Subject: [PATCH] yo --- server.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 823de330..8469cb4d 100644 --- a/server.js +++ b/server.js @@ -48,7 +48,12 @@ const fetcher = require("./src/fetcher.js"); app.get("/watch", async function (req, res) { var v = req.query.v; const getColors = require('get-image-colors') - var e = req.query.e; + var e = req.query.e; + var r = req.query.r; + const { toJson } = require("xml2json"); + const video = await fetch( `https://tube.kuylar.dev/api/video?v=${v}`); + const h = await video.text(); + const k = JSON.parse(toJson(h)); if(!v) res.redirect("/") var fetching = await fetcher(v) const j = fetching.video.Player.Formats.Format, @@ -69,6 +74,8 @@ if (j_.URL != undefined) video: json, date: moment(json.uploadDate).format("LL"), e:e, + k:k, + r:r, lyrics: lyrics.replace(/\n/g, "
"), }); });