mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 18:59:19 +00:00
Support YouTube Music links
This commit is contained in:
@@ -554,7 +554,9 @@ class DiscordMusicPlayer {
|
|||||||
public parseYouTubeLink(query: string): YouTubeLink {
|
public parseYouTubeLink(query: string): YouTubeLink {
|
||||||
if (
|
if (
|
||||||
query.startsWith('https://www.youtube.com/watch?v=') ||
|
query.startsWith('https://www.youtube.com/watch?v=') ||
|
||||||
query.startsWith('http://www.youtube.com/watch?v=')
|
query.startsWith('http://www.youtube.com/watch?v=') ||
|
||||||
|
query.startsWith('https://music.youtube.com/watch?v=') ||
|
||||||
|
query.startsWith('https://music.youtube.com/watch?v=')
|
||||||
) {
|
) {
|
||||||
let data = this.parseURLQuery(query);
|
let data = this.parseURLQuery(query);
|
||||||
if (!data.v) throw new Error('YouTube link is invalid');
|
if (!data.v) throw new Error('YouTube link is invalid');
|
||||||
|
|||||||
Reference in New Issue
Block a user