More Playlist Error fix
This commit is contained in:
parent
c83897ff2a
commit
50f864c13f
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "play-dl",
|
"name": "play-dl",
|
||||||
"version": "0.5.2",
|
"version": "0.5.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "play-dl",
|
"name": "play-dl",
|
||||||
"version": "0.5.2",
|
"version": "0.5.3",
|
||||||
"description": "YouTube, SoundCloud, Spotify streaming for discord.js bots",
|
"description": "YouTube, SoundCloud, Spotify streaming for discord.js bots",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
|||||||
@ -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')
|
if(url.search('(\\?|\\&)list\\=') === -1) throw new Error('This is not a PlayList URL')
|
||||||
|
|
||||||
let Playlist_id = url.split('list=')[1].split('&')[0]
|
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 new_url = `https://www.youtube.com/playlist?list=${Playlist_id}`
|
||||||
|
|
||||||
let body = await url_get(new_url)
|
let body = await url_get(new_url)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user