More Playlist Error fix

This commit is contained in:
killer069 2021-08-24 20:14:51 +05:30
parent c83897ff2a
commit 50f864c13f
3 changed files with 3 additions and 3 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "play-dl",
"version": "0.5.2",
"version": "0.5.3",
"lockfileVersion": 2,
"requires": true,
"packages": {

View File

@ -1,6 +1,6 @@
{
"name": "play-dl",
"version": "0.5.2",
"version": "0.5.3",
"description": "YouTube, SoundCloud, Spotify streaming for discord.js bots",
"main": "dist/index.js",
"typings": "dist/index.d.ts",

View File

@ -112,7 +112,7 @@ export async function playlist_info(url : string) {
if(url.search('(\\?|\\&)list\\=') === -1) throw new Error('This is not a PlayList URL')
let Playlist_id = url.split('list=')[1].split('&')[0]
if(Playlist_id.length !== 34) throw new Error('This is not a PlayList URL')
if(Playlist_id.length !== 34 || Playlist_id.startsWith('PL')) throw new Error('This is not a PlayList URL')
let new_url = `https://www.youtube.com/playlist?list=${Playlist_id}`
let body = await url_get(new_url)