[iqiyi] Improve error detection for VIP-only videos

Closes #9071
This commit is contained in:
Yen Chi Hsuan 2016-04-06 16:12:16 +08:00
parent 416930d450
commit 8790249c68

View file

@ -368,7 +368,10 @@ def _authenticate_vip_video(self, api_video_url, video_id, tvid, _uuid, do_repor
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