@@ -17,7 +17,7 @@ function aliasURL(url) {
1717 if ( url . pathname . startsWith ( '/live/' ) || url . pathname . startsWith ( '/shorts/' ) ) {
1818 url . pathname = '/watch' ;
1919 // parts := ['', 'live' || 'shorts', id, ...rest]
20- url . search = `?v=${ encodeURIComponent ( parts [ 2 ] ) } `
20+ url . search = `?v=${ encodeURIComponent ( parts [ 2 ] ) } ` ;
2121 }
2222 break ;
2323
@@ -61,23 +61,23 @@ function aliasURL(url) {
6161
6262 case "b23" :
6363 if ( url . hostname === 'b23.tv' && parts . length === 2 ) {
64- url = new URL ( `https://bilibili.com/_shortLink/${ parts [ 1 ] } ` )
64+ url = new URL ( `https://bilibili.com/_shortLink/${ parts [ 1 ] } ` ) ;
6565 }
6666 break ;
6767
6868 case "dai" :
6969 if ( url . hostname === 'dai.ly' && parts . length === 2 ) {
70- url = new URL ( `https://dailymotion.com/video/${ parts [ 1 ] } ` )
70+ url = new URL ( `https://dailymotion.com/video/${ parts [ 1 ] } ` ) ;
7171 }
7272 break ;
7373
7474 case "facebook" :
7575 case "fb" :
7676 if ( url . searchParams . get ( 'v' ) ) {
77- url = new URL ( `https://web.facebook.com/user/videos/${ url . searchParams . get ( 'v' ) } ` )
77+ url = new URL ( `https://web.facebook.com/user/videos/${ url . searchParams . get ( 'v' ) } ` ) ;
7878 }
7979 if ( url . hostname === 'fb.watch' ) {
80- url = new URL ( `https://web.facebook.com/_shortLink/${ parts [ 1 ] } ` )
80+ url = new URL ( `https://web.facebook.com/_shortLink/${ parts [ 1 ] } ` ) ;
8181 }
8282 break ;
8383
@@ -92,6 +92,9 @@ function aliasURL(url) {
9292 if ( services . vk . altDomains . includes ( url . hostname ) ) {
9393 url . hostname = 'vk.com' ;
9494 }
95+ if ( url . searchParams . get ( 'z' ) ) {
96+ url = new URL ( `https://vk.com/${ url . searchParams . get ( 'z' ) } ` ) ;
97+ }
9598 break ;
9699
97100 case "xhslink" :
@@ -106,7 +109,7 @@ function aliasURL(url) {
106109 url . pathname = `/share/${ idPart . slice ( - 32 ) } ` ;
107110 }
108111 break ;
109-
112+
110113 case "redd" :
111114 /* reddit short video links can be treated by changing https://v.redd.it/<id>
112115 to https://reddit.com/video/<id>.*/
0 commit comments