From b1ea23ebd918cc42dba7525844d6e0392ac18c15 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 4 Sep 2022 11:00:51 +0200 Subject: [PATCH] comments :3 --- server.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/server.js b/server.js index 22215ccf..4573e624 100644 --- a/server.js +++ b/server.js @@ -35,11 +35,7 @@ var express = require("express"); var useragent = require("express-useragent"); // hash -var sha512 = require("js-sha512").sha512; -var sha384 = require("js-sha512").sha384; - -var sha512_256 = require("js-sha512").sha512_256; -var sha512_224 = require("js-sha512").sha512_224; +const sha384 = require("js-sha512").sha384; const musicInfo = require("music-info"); @@ -172,13 +168,13 @@ app.get("/watch", async function (req, res) { var nn = ""; - if (n === null) { - nn = ""; - } - - if (n) { - nn = JSON.parse(n); - } + var badges = "" + if (n === undefined) {badges = "";} + if (n !== undefined) {badges = JSON.parse(n).channel.badges[0]} + + var comments = "" + if (n === undefined) { comments = ""; } + if (n !== undefined) { comments = JSON.parse(n).commentCount } var fetching = await fetcher(v); @@ -234,7 +230,8 @@ app.get("/watch", async function (req, res) { f: f, t: config.t_url, optout: t, - nigth:nn, + badges:badges, + comments:comments, lyrics: "", }); });