mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-12 14:26:49 +01:00
[youku] Better error handling
This commit is contained in:
parent
f1e66cb2eb
commit
04e7596680
@ -176,13 +176,15 @@ def _real_extract(self, url):
|
|||||||
|
|
||||||
error_code = data1.get('error_code')
|
error_code = data1.get('error_code')
|
||||||
if error_code:
|
if error_code:
|
||||||
# -8 means blocked outside China.
|
|
||||||
# Chinese and English, separated by newline.
|
|
||||||
error = data1.get('error')
|
error = data1.get('error')
|
||||||
raise ExtractorError(
|
if error is not None and '因版权原因无法观看此视频' in error:
|
||||||
error or 'Server reported error %i' %
|
raise ExtractorError(
|
||||||
error_code,
|
'Youku said: Sorry, this video is available in China only', expected=True)
|
||||||
expected=True)
|
else:
|
||||||
|
msg = 'Youku server reported error %i' % error_code
|
||||||
|
if error is not None:
|
||||||
|
msg += ': ' + error
|
||||||
|
raise ExtractorError(msg)
|
||||||
|
|
||||||
title = data1['title']
|
title = data1['title']
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user