aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-04-06 16:12:16 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2016-04-06 16:12:16 +0800
commit8790249c6860374b4d7eeeffae9e7b30d346eaf7 (patch)
tree07ad59f5a070ed722fc04ea4c7537fab36c94e42 /youtube_dl
parent416930d45007cb1e24e4cd8638d9867dd84f3961 (diff)
[iqiyi] Improve error detection for VIP-only videos
Closes #9071
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/iqiyi.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/extractor/iqiyi.py b/youtube_dl/extractor/iqiyi.py
index 9e8c9432a..88570f261 100644
--- a/youtube_dl/extractor/iqiyi.py
+++ b/youtube_dl/extractor/iqiyi.py
@@ -368,7 +368,10 @@ class IqiyiIE(InfoExtractor):
auth_req, video_id,
note='Downloading video authentication JSON',
errnote='Unable to download video authentication JSON')
- if auth_result['code'] == 'Q00506': # requires a VIP account
+
+ if auth_result['code'] == 'Q00505': # No preview available (不允许试看鉴权失败)
+ raise ExtractorError('This video requires a VIP account', expected=True)
+ if auth_result['code'] == 'Q00506': # End of preview time (试看结束鉴权失败)
if do_report_warning:
self.report_warning('Needs a VIP account for full video')
return False