mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-13 02:18:11 +01:00
im out of commit messages pwese help me aaaaaaa
This commit is contained in:
parent
2584bacb27
commit
f118dbdbef
1 changed files with 37 additions and 24 deletions
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue