diff --git a/src/Util.js b/src/Util.js index 4cec91a..9f6a370 100644 --- a/src/Util.js +++ b/src/Util.js @@ -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') } }