Handle if something that's not a playlist is given
This commit is contained in:
parent
c33b16136f
commit
5f571567a3
|
@ -51,11 +51,7 @@ class Playlist(EventEmitter):
|
||||||
Imports the songs from `playlist_url` and queues them to be played.
|
Imports the songs from `playlist_url` and queues them to be played.
|
||||||
|
|
||||||
Returns a list of `entries` that have been enqueued.
|
Returns a list of `entries` that have been enqueued.
|
||||||
|
|
||||||
:param playlist_url: The playlist url to be cut into individual urls and added to the playlist
|
|
||||||
"""
|
"""
|
||||||
position = len(self.entries) + 1
|
|
||||||
entry_list = []
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
info = await self.downloader.safe_extract_info(self.loop, playlist_url, download=False)
|
info = await self.downloader.safe_extract_info(self.loop, playlist_url, download=False)
|
||||||
|
@ -65,6 +61,9 @@ class Playlist(EventEmitter):
|
||||||
if not info:
|
if not info:
|
||||||
raise ExtractionError('Could not extract information from %s' % playlist_url)
|
raise ExtractionError('Could not extract information from %s' % playlist_url)
|
||||||
|
|
||||||
|
if info.get('playlist') is None:
|
||||||
|
raise WrongEntryTypeError('This is not a playlist!')
|
||||||
|
|
||||||
# Once again, the generic extractor fucks things up.
|
# Once again, the generic extractor fucks things up.
|
||||||
if info.get('extractor', None) == 'generic':
|
if info.get('extractor', None) == 'generic':
|
||||||
url_field = 'url'
|
url_field = 'url'
|
||||||
|
|
Loading…
Reference in a new issue