mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-11-22 15:47:30 +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 = [
|
module.exports = [
|
||||||
{
|
{
|
||||||
route: `/(${constants.regex.video_id})`, priority: -1, methods: ["GET"], code: async ({fill}) => {
|
route: `/(${constants.regex.video_id})`, priority: -1, methods: ["GET"], code: async ({fill, url}) => {
|
||||||
return redirect(`/watch?v=${fill[0]}`, 301)
|
const target = new URLSearchParams(url.search)
|
||||||
|
target.set("v", fill[0])
|
||||||
|
return redirect(`/watch?${target}`, 301)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user