poke/src/libpoketube/init/pages-redir.js

44 lines
858 B
JavaScript
Raw Normal View History

2022-11-13 14:00:40 +01:00
const {
fetcher,
core,
wiki,
musicInfo,
modules,
version,
initlog,
init,
} = require("../libpoketube-initsys.js");
2022-11-09 17:53:26 +01:00
const {
IsJsonString,
convert,
getFirstLine,
capitalizeFirstLetter,
turntomins,
getRandomInt,
getRandomArbitrary,
} = require("../ptutils/libpt-coreutils.js");
const sha384 = modules.hash;
2022-11-13 14:00:40 +01:00
module.exports = function (app, config, renderTemplate) {
app.get("/hashtag/:id", (req, res) => {
if (!req.params.id) {
return res.redirect("/");
}
return res.redirect(`/search?query=${req.params.id}&from=hashtag`);
});
2022-11-09 17:53:26 +01:00
2022-11-13 14:00:40 +01:00
app.get("/shorts/:id", (req, res) => {
if (!req.params.id) {
return res.redirect("/");
}
2022-11-09 17:53:26 +01:00
2022-11-13 14:00:40 +01:00
return res.redirect(`/watch?v=${req.params.id}&from=short`);
});
2022-11-09 17:53:26 +01:00
2022-11-13 14:00:40 +01:00
app.get("/video/upload", (req, res) => {
res.redirect("https://youtube.com/upload");
});
};