1
0
Fork 0
mirror of synced 2024-05-20 20:42:27 +12:00

Add an exception for some oddly formatted searches that trigger socket.gaierror

This commit is contained in:
Phxntxm 2017-05-07 20:38:24 -05:00
parent 92514b6987
commit 5451395e0a

View file

@ -50,7 +50,11 @@ class Playlist(EventEmitter):
try:
info = await self.downloader.extract_info(self.loop, song_url, download=False)
except Exception as e:
raise ExtractionError('Could not extract information from {}\n\n{}'.format(song_url, e))
if "gaierror" in str(e):
song_url = "ytsearch:" + song_url
info = await self.downloader.extract_info(self.loop, song_url, download=False)
else:
raise ExtractionError('Could not extract information from {}\n\n{}'.format(song_url, e))
if not info:
raise ExtractionError('Could not extract information from %s' % song_url)