Correct accidental override of info
This commit is contained in:
parent
13ce1d861e
commit
a4a47cded3
|
@ -3,9 +3,10 @@ import time
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from .exceptions import ExtractionError, WrongEntryTypeError, LiveStreamError
|
from .exceptions import ExtractionError, WrongEntryTypeError, LiveStreamError
|
||||||
|
from .entry import get_header
|
||||||
|
|
||||||
|
|
||||||
class YoutubeDLSource(discord.FFmpegPCMAudio):
|
class YoutubeDLSource(discord.FFmpegPCMAudio):
|
||||||
|
|
||||||
def __init__(self, playlist, url):
|
def __init__(self, playlist, url):
|
||||||
self.playlist = playlist
|
self.playlist = playlist
|
||||||
self.loop = playlist.loop
|
self.loop = playlist.loop
|
||||||
|
@ -33,10 +34,10 @@ class YoutubeDLSource(discord.FFmpegPCMAudio):
|
||||||
# Otherwise get the first result
|
# Otherwise get the first result
|
||||||
else:
|
else:
|
||||||
info = info['entries'][0]
|
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
|
# If this isn't a search, then it is a playlist, this can't be done
|
||||||
else:
|
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']:
|
if info['extractor'] in ['generic', 'Dropbox']:
|
||||||
try:
|
try:
|
||||||
|
@ -55,7 +56,6 @@ class YoutubeDLSource(discord.FFmpegPCMAudio):
|
||||||
if headers.get('ice-audio-info'):
|
if headers.get('ice-audio-info'):
|
||||||
raise LiveStreamError("Cannot download from a livestream")
|
raise LiveStreamError("Cannot download from a livestream")
|
||||||
|
|
||||||
|
|
||||||
if info.get('is_live', False):
|
if info.get('is_live', False):
|
||||||
raise LiveStreamError("Cannot download from a livestream")
|
raise LiveStreamError("Cannot download from a livestream")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue