im out of commit messages pwese help me aaaaaaa

This commit is contained in:
Ashley 2023-03-07 17:21:34 +00:00
parent b87f845a18
commit a22f97894c

View file

@ -18,33 +18,20 @@ const {
getRandomArbitrary, getRandomArbitrary,
} = require("../ptutils/libpt-coreutils.js"); } = require("../ptutils/libpt-coreutils.js");
function getJson(str) {
try {
return JSON.parse(str);
} catch {
return null;
}
}
const pkg = require("../../../package.json"); const pkg = require("../../../package.json");
const ver = "v23.0302-CRsAa-MAJOR-stable-git"; const ver = "v23.0302-CRsAa-MAJOR-stable-git";
const branch = "master" const branch = "master";
const codename = "pinkneko" const codename = "pinkneko";
const versionnumber = "210"; const versionnumber = "210";
const response = {
pt_version: ver,
branch,
vernum: versionnumber,
codename,
packages: {
libpt: version,
node: process.version,
v8: process.versions.v8,
},
flac : {
poketube_flac: "1.0a",
apple_musickit:"1.2.1",
poketube_normalize_volume:"1.2.23-yt",
},
piwik:"master",
process: process.versions,
dependencies: pkg.dependencies,
};
module.exports = function (app, config, renderTemplate) { module.exports = function (app, config, renderTemplate) {
app.get("/embed/:v", async function (req, res) { app.get("/embed/:v", async function (req, res) {
var e = req.query.e; var e = req.query.e;
@ -147,6 +134,32 @@ module.exports = function (app, config, renderTemplate) {
}); });
app.get("/api/version.json", async (req, res) => { app.get("/api/version.json", async (req, res) => {
const invidious = await modules
.fetch("https://inv-api.poketube.fun/api/v1/stats")
.then((res) => res.text())
.then((txt) => getJson(txt));
const response = {
pt_version: ver,
branch,
vernum: versionnumber,
codename,
packages: {
libpt: version,
node: process.version,
v8: process.versions.v8,
},
invidious,
flac: {
poketube_flac: "1.0a",
apple_musickit: "1.2.1",
poketube_normalize_volume: "1.2.23-yt",
},
piwik: "master",
process: process.versions,
dependencies: pkg.dependencies,
};
res.json(response); res.json(response);
}); });