mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 18:59:19 +00:00
Support YouTube shorts
This commit is contained in:
@@ -683,6 +683,18 @@ class DiscordMusicPlayer {
|
||||
if (!videoId) throw new Error('YouTube link is invalid');
|
||||
if (query.split('/')[4]) throw new Error('YouTube link is invalid');
|
||||
|
||||
return {
|
||||
videoId: videoId
|
||||
};
|
||||
} else if (
|
||||
query.startsWith('https://www.youtube.com/shorts/') ||
|
||||
query.startsWith('http://www.youtube.com/shorts/')
|
||||
) {
|
||||
let videoId = query.split('/')[4];
|
||||
|
||||
if (!videoId) throw new Error('YouTube link is invalid');
|
||||
if (query.split('/')[5]) throw new Error('YouTube link is invalid');
|
||||
|
||||
return {
|
||||
videoId: videoId
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user