aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/letv.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-01-20 03:31:34 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2016-01-20 03:31:34 +0800
commit26de1bba83b3269653b571682cf962899b6231b7 (patch)
tree23c37c4e3a8f4c9c5ec521f1eb0f9fbcbfcfcc0b /youtube_dl/extractor/letv.py
parente0690782b8531f9962950693fe33a5d4a4f494f6 (diff)
[letv] LetvCloud: check error messages from server
Diffstat (limited to 'youtube_dl/extractor/letv.py')
-rw-r--r--youtube_dl/extractor/letv.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/extractor/letv.py b/youtube_dl/extractor/letv.py
index b8d4f5bb8..177d53bbb 100644
--- a/youtube_dl/extractor/letv.py
+++ b/youtube_dl/extractor/letv.py
@@ -287,6 +287,14 @@ class LetvCloudIE(InfoExtractor):
'uu=' + uu + '&vu=' + vu)
play_json = self._download_json(play_json_req, media_id, 'Downloading playJson data')
+ if not play_json.get('data'):
+ if play_json.get('message'):
+ raise ExtractorError('Letv cloud said: %s' % play_json['message'], expected=True)
+ elif play_json.get('code'):
+ raise ExtractorError('Letv cloud returned error %d' % play_json['code'], expected=True)
+ else:
+ raise ExtractorError('Letv cloud returned an unknwon error')
+
formats = []
for media in play_json['data']['video_info']['media'].values():
play_url = media['play_url']