1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-23 01:08:10 +00:00

[yandexmusic] Improve error handling

This commit is contained in:
Sergey M․ 2016-04-28 21:37:34 +06:00
parent 0cbcbdd89d
commit eebe6b382e
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -18,9 +18,10 @@ from ..utils import (
class YandexMusicBaseIE(InfoExtractor): class YandexMusicBaseIE(InfoExtractor):
@staticmethod @staticmethod
def _handle_error(response): def _handle_error(response):
error = response.get('error') if isinstance(response, dict):
if error: error = response.get('error')
raise ExtractorError(error, expected=True) if error:
raise ExtractorError(error, expected=True)
def _download_webpage(self, *args, **kwargs): def _download_webpage(self, *args, **kwargs):
webpage = super(YandexMusicBaseIE, self)._download_webpage(*args, **kwargs) webpage = super(YandexMusicBaseIE, self)._download_webpage(*args, **kwargs)