mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-11-12 19:37:29 +00:00
Preserve other parameters in video redirection
This commit is contained in:
parent
d3d18bd45f
commit
d50e07f053
@ -3,8 +3,10 @@ const {redirect} = require("pinski/plugins")
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
route: `/(${constants.regex.video_id})`, priority: -1, methods: ["GET"], code: async ({fill}) => {
|
||||
return redirect(`/watch?v=${fill[0]}`, 301)
|
||||
route: `/(${constants.regex.video_id})`, priority: -1, methods: ["GET"], code: async ({fill, url}) => {
|
||||
const target = new URLSearchParams(url.search)
|
||||
target.set("v", fill[0])
|
||||
return redirect(`/watch?${target}`, 301)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user