1
0
Fork 0
mirror of synced 2024-05-23 22:09:38 +12:00

Correct accidental override of info

This commit is contained in:
phxntxm 2017-07-09 14:52:09 -05:00
parent 13ce1d861e
commit a4a47cded3

View file

@ -3,9 +3,10 @@ import time
import asyncio
from .exceptions import ExtractionError, WrongEntryTypeError, LiveStreamError
from .entry import get_header
class YoutubeDLSource(discord.FFmpegPCMAudio):
def __init__(self, playlist, url):
self.playlist = playlist
self.loop = playlist.loop
@ -33,10 +34,10 @@ class YoutubeDLSource(discord.FFmpegPCMAudio):
# Otherwise get the first result
else:
info = info['entries'][0]
self.url = info['webpage_url']
# If this isn't a search, then it is a playlist, this can't be done
else:
raise WrongEntryTypeError("This is a playlist.", True, info.get('webpage_url', None) or info.get('url', None))
raise WrongEntryTypeError("This is a playlist.", True,
info.get('webpage_url', None) or info.get('url', None))
if info['extractor'] in ['generic', 'Dropbox']:
try:
@ -55,7 +56,6 @@ class YoutubeDLSource(discord.FFmpegPCMAudio):
if headers.get('ice-audio-info'):
raise LiveStreamError("Cannot download from a livestream")
if info.get('is_live', False):
raise LiveStreamError("Cannot download from a livestream")