comments :3

This commit is contained in:
Ashley 2022-10-12 17:04:41 +02:00
parent c27e5afbca
commit 925823e9f5

View file

@ -171,36 +171,29 @@ app.get("/watch", async function (req, res) {
var t = req.query.t;
var q = req.query.quality;
const info = await fetch("http://ip-api.com/json/");
const jj = await info.text();
const ip = JSON.parse(jj);
api.video(v).then((data) => {
const k = data.video;
const json = data.json;
const engagement = data.engagement;
const inv_comments = data.comments;
const inv_vid = data.vid;
const k = data.video
const json = data.json
const engagement = data.engagement
if(api.video(v).b) {
var nnn = data.beta
if (api.video(v).b) {
var nnn = data.beta;
var badges = nnn.channel.badges[0];
var comments = nnn.commentCount;
}
if(!api.video(v).b) {
var nnn = ""
var badges = ""
var comments = ""
if (!api.video(v).b) {
var nnn = "";
var badges = "";
var comments = "";
}
if (!v) res.redirect("/");
//video
@ -226,8 +219,6 @@ if(!api.video(v).b) {
var d = false;
}
renderTemplate(res, req, "poketube.ejs", {
url: url_e,
color: data.color,
@ -242,6 +233,7 @@ if(!api.video(v).b) {
tj: data.channel,
r: r,
qua: q,
inv: inv_comments,
ip: ip,
convert: convert,
wiki: data.wiki,
@ -252,10 +244,10 @@ if(!api.video(v).b) {
desc: desc,
comments: comments,
n: nnn,
inv_vid,
lyrics: "",
});
});
});
app.get("/music", async function (req, res) {
@ -280,11 +272,12 @@ app.get("/music", async function (req, res) {
if (!v) res.redirect("/");
const video = await fetch(config.tubeApi + `video?v=${v}`);
var fetching = await fetcher(v);
const json = fetching.video.Player;
const video = await fetch(config.tubeApi + `video?v=${v}`);
const h = await video.text();
const k = JSON.parse(toJson(h));
@ -547,6 +540,7 @@ app.get("/embed/:v", async function (req, res) {
sha384: sha384,
qua: q,
engagement: engagement,
k: k,
optout: t,
t: config.t_url,
});