add new api stuff :3

This commit is contained in:
Ashley 2023-01-11 16:20:38 +00:00
parent 6bcbf9ceb5
commit 0e90b72398

View file

@ -2,7 +2,7 @@
PokeTube is an Free/Libre youtube front-end. this is our main file. PokeTube is an Free/Libre youtube front-end. this is our main file.
Copyright (C) 2021-2022 POKETUBE (https://github.com/iamashley0/poketube) Copyright (C) 2021-2023 POKETUBE (https://github.com/iamashley0/poketube)
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -18,6 +18,7 @@
along with this program. If not, see https://www.gnu.org/licenses/. along with this program. If not, see https://www.gnu.org/licenses/.
*/ */
(async function () {
const { const {
fetcher, fetcher,
core, core,
@ -28,8 +29,9 @@ const {
initlog, initlog,
init, init,
} = require("./src/libpoketube/libpoketube-initsys.js"); } = require("./src/libpoketube/libpoketube-initsys.js");
const media_proxy = require("./src/libpoketube/libpoketube-video.js");
const { sinit } = require("./src/libpoketube/init/superinit.js"); const { sinit } = require("./src/libpoketube/init/superinit.js");
const u = await media_proxy();
initlog("Loading..."); initlog("Loading...");
initlog( initlog(
@ -67,7 +69,6 @@ app.use(modules.express.urlencoded({ extended: true })); // for parsing applicat
app.use(modules.useragent.express()); app.use(modules.useragent.express());
app.use(modules.express.json()); // for parsing application/json app.use(modules.express.json()); // for parsing application/json
const renderTemplate = async (res, req, template, data = {}) => { const renderTemplate = async (res, req, template, data = {}) => {
res.render( res.render(
modules.path.resolve(`${templateDir}${modules.path.sep}${template}`), modules.path.resolve(`${templateDir}${modules.path.sep}${template}`),
@ -93,7 +94,7 @@ this is our config file,you can change stuff here
*/ */
const config = { const config = {
tubeApi: "https://tube-srv.ashley143.gay/api/", tubeApi: "https://tube-srv.ashley143.gay/api/",
invapi: "https://inv.vern.cc/api/v1", invapi: u + "/api/v1",
dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=", dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=",
t_url: "https://t.poketube.fun/", // def matomo url t_url: "https://t.poketube.fun/", // def matomo url
}; };
@ -106,6 +107,5 @@ app.use(function (req, res, next) {
sinit(app, config, renderTemplate); sinit(app, config, renderTemplate);
init(app); init(app);
})();