Support youtu.be redirection
This commit is contained in:
parent
de4438124a
commit
722842b0b4
|
@ -0,0 +1,10 @@
|
|||
const constants = require("../utils/constants")
|
||||
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)
|
||||
}
|
||||
}
|
||||
]
|
|
@ -28,7 +28,7 @@ let constants = {
|
|||
|
||||
regex: {
|
||||
ucid: "[A-Za-z0-9-_]+",
|
||||
video_id: "[A-Za-z0-9-_]+"
|
||||
video_id: "[A-Za-z0-9-_]{11,}"
|
||||
},
|
||||
|
||||
symbols: {
|
||||
|
|
Loading…
Reference in New Issue