瀏覽代碼

[iqiyi] Give error message for assertion failures

Yen Chi Hsuan 10 年之前
父節點
當前提交
aacda28b28
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      youtube_dl/extractor/iqiyi.py

+ 4 - 1
youtube_dl/extractor/iqiyi.py

@@ -171,7 +171,10 @@ class IqiyiIE(InfoExtractor):
         enc_key = self.get_enc_key(swf_url, video_id)
 
         raw_data = self.get_raw_data(tvid, video_id, enc_key, _uuid)
-        assert raw_data['code'] == 'A000000'
+
+        if raw_data['code'] != 'A000000':
+            raise ExtractorError('Unable to load data. Error code: ' + raw_data['code'])
+
         if not raw_data['data']['vp']['tkl']:
             raise ExtractorError('No support iQiqy VIP video')