mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-17 02:54:42 -05:00
update api url :3
This commit is contained in:
parent
98fa6182bc
commit
aaa0b92e96
1 changed files with 2 additions and 6 deletions
|
@ -30,10 +30,7 @@ function getJson(str) {
|
||||||
|
|
||||||
module.exports = function (app, config, renderTemplate) {
|
module.exports = function (app, config, renderTemplate) {
|
||||||
app.get("/discover", async function (req, res) {
|
app.get("/discover", async function (req, res) {
|
||||||
const trends = await modules.fetch(`${config.tubeApi}trending`);
|
|
||||||
const h = await trends.text();
|
|
||||||
const k = getJson(modules.toJson(h));
|
|
||||||
|
|
||||||
let tab = "";
|
let tab = "";
|
||||||
if (req.query.tab) {
|
if (req.query.tab) {
|
||||||
tab = `/?type=${capitalizeFirstLetter(req.query.tab)}`;
|
tab = `/?type=${capitalizeFirstLetter(req.query.tab)}`;
|
||||||
|
@ -46,13 +43,12 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
if (req.query.mobilesearch) {
|
if (req.query.mobilesearch) {
|
||||||
const query = req.query.mobilesearch;
|
const query = req.query.mobilesearch;
|
||||||
const continuation = req.query.continuation || "";
|
const continuation = req.query.continuation || "";
|
||||||
const search = await modules.fetch(`https://tube-srv.ashley143.gay/api/search?query=${query}&continuation=${continuation}`);
|
const search = await modules.fetch(`https://inner-api.poketube.fun/api/search?query=${query}&continuation=${continuation}`);
|
||||||
const text = await search.text();
|
const text = await search.text();
|
||||||
j = getJson(modules.toJson(text));
|
j = getJson(modules.toJson(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
renderTemplate(res, req, "main.ejs", {
|
renderTemplate(res, req, "main.ejs", {
|
||||||
k,
|
|
||||||
tab: req.query.tab,
|
tab: req.query.tab,
|
||||||
isMobile: req.useragent.isMobile,
|
isMobile: req.useragent.isMobile,
|
||||||
mobilesearch: req.query.mobilesearch,
|
mobilesearch: req.query.mobilesearch,
|
||||||
|
|
Loading…
Reference in a new issue