added /shorts/ support to stop sable from crashing
This commit is contained in:
1 parent
e286911a6a
commit
8b287644d9
1 file changed
+4
@@ -167,6 +167,10 @@ function parseYoutubeLink(url: string): YoutubeLink | null {
|
||||
const split = path.split('?');
|
||||
[videoId] = split;
|
||||
params = split[1]?.split('&');
|
||||
} else if (url.includes('/shorts/')) {
|
||||
const split = path.split('/shorts/');
|
||||
[videoId] = split;
|
||||
params = split[1]?.split('shorts');
|
||||
} else {
|
||||
params = path.split('?')[1].split('&');
|
||||
videoId = params.find((s) => s.startsWith('v='), params)?.split('v=')[1];
|
||||
|
||||
Reference in new issue
Block a user