diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-04-28 21:37:34 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-04-28 21:37:34 +0600 |
commit | eebe6b382eb6bd9e8118b616f3dde48c294e3b0d (patch) | |
tree | fe17a3527638c78f70bac862979567dd60693385 /youtube_dl | |
parent | 0cbcbdd89dbc3573ecfcf68496c54bd84804967d (diff) |
[yandexmusic] Improve error handling
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/yandexmusic.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube_dl/extractor/yandexmusic.py b/youtube_dl/extractor/yandexmusic.py index 0d32a612f..b0e68a087 100644 --- a/youtube_dl/extractor/yandexmusic.py +++ b/youtube_dl/extractor/yandexmusic.py @@ -18,9 +18,10 @@ from ..utils import ( class YandexMusicBaseIE(InfoExtractor): @staticmethod def _handle_error(response): - error = response.get('error') - if error: - raise ExtractorError(error, expected=True) + if isinstance(response, dict): + error = response.get('error') + if error: + raise ExtractorError(error, expected=True) def _download_webpage(self, *args, **kwargs): webpage = super(YandexMusicBaseIE, self)._download_webpage(*args, **kwargs) |