parent
d443652c8c
commit
a82bc52491
1 changed files with 2 additions and 4 deletions
|
@ -1,8 +1,6 @@
|
|||
const ytsr = require('youtube-sr')
|
||||
const soundcloud = require('soundcloud-scraper')
|
||||
const Discord = require('discord.js')
|
||||
|
||||
const youtubeVideoRegex = (/(?:youtube\.com\/(?:[^/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/\s]{11})/)
|
||||
const spotifySongRegex = (/https?:\/\/(?:embed\.|open\.)(?:spotify\.com\/)(?:track\/|\?uri=spotify:track:)((\w|-){22})/)
|
||||
|
||||
module.exports = class Util {
|
||||
|
@ -23,10 +21,10 @@ module.exports = class Util {
|
|||
}
|
||||
|
||||
static isYTPlaylistLink (query) {
|
||||
return ytsr.default.validate(query, 'PLAYLIST')
|
||||
return ytsr.validate(query, 'PLAYLIST')
|
||||
}
|
||||
|
||||
static isYTVideoLink (query) {
|
||||
return youtubeVideoRegex.test(query)
|
||||
return ytsr.validate(query, 'VIDEO')
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue