add /shorts

This commit is contained in:
Ashley 2022-11-13 14:00:40 +01:00
parent 1094e80c5f
commit dec253fd19

View file

@ -1,4 +1,13 @@
const { fetcher,core, wiki,musicInfo, modules, version, initlog, init,} = require("../libpoketube-initsys.js"); const {
fetcher,
core,
wiki,
musicInfo,
modules,
version,
initlog,
init,
} = require("../libpoketube-initsys.js");
const { const {
IsJsonString, IsJsonString,
convert, convert,
@ -12,8 +21,6 @@ const {
const sha384 = modules.hash; const sha384 = modules.hash;
module.exports = function (app, config, renderTemplate) { module.exports = function (app, config, renderTemplate) {
app.get("/hashtag/:id", (req, res) => { app.get("/hashtag/:id", (req, res) => {
if (!req.params.id) { if (!req.params.id) {
return res.redirect("/"); return res.redirect("/");
@ -22,7 +29,15 @@ app.get("/hashtag/:id", (req, res) => {
return res.redirect(`/search?query=${req.params.id}&from=hashtag`); return res.redirect(`/search?query=${req.params.id}&from=hashtag`);
}); });
app.get("/shorts/:id", (req, res) => {
if (!req.params.id) {
return res.redirect("/");
}
return res.redirect(`/watch?v=${req.params.id}&from=short`);
});
app.get("/video/upload", (req, res) => { app.get("/video/upload", (req, res) => {
res.redirect("https://youtube.com/upload"); res.redirect("https://youtube.com/upload");
}); });
} };