1
0
Fork 0
mirror of synced 2024-05-18 19:42:28 +12:00

Handle if something that's not a playlist is given

This commit is contained in:
phxntxm 2017-07-11 12:59:24 -05:00
parent c33b16136f
commit 5f571567a3

View file

@ -51,11 +51,7 @@ class Playlist(EventEmitter):
Imports the songs from `playlist_url` and queues them to be played.
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:
info = await self.downloader.safe_extract_info(self.loop, playlist_url, download=False)
@ -65,6 +61,9 @@ class Playlist(EventEmitter):
if not info:
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.
if info.get('extractor', None) == 'generic':
url_field = 'url'