📝 use validate method to validate playlist url (#171)

📝 use validate method to validate playlist url
This commit is contained in:
Snowflake 2020-12-02 12:06:39 +05:45 committed by GitHub
parent 9e2f0acdc2
commit 183d978c2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
const { Util: { PlaylistURLRegex: playlistURLRegex } } = require('youtube-sr') const ytsr = require('youtube-sr')
const soundcloud = require('soundcloud-scraper') const soundcloud = require('soundcloud-scraper')
const Discord = require('discord.js') const Discord = require('discord.js')
@ -23,7 +23,7 @@ module.exports = class Util {
} }
static isYTPlaylistLink (query) { static isYTPlaylistLink (query) {
return playlistURLRegex.test(query) return ytsr.default.validate(query, "PLAYLIST")
} }
static isYTVideoLink (query) { static isYTVideoLink (query) {