projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f1e66cb
)
[youku] Better error handling
author
Yen Chi Hsuan
<yan12125@gmail.com>
Mon, 15 Jun 2015 15:54:55 +0000
(23:54 +0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Mon, 15 Jun 2015 15:54:55 +0000
(23:54 +0800)
youtube_dl/extractor/youku.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/youku.py
b/youtube_dl/extractor/youku.py
index d5b73ebcef71ae52dc9c39367240a908249966a9..91f9f6bff27614306562433eb5a7ca585956469d 100644
(file)
--- a/
youtube_dl/extractor/youku.py
+++ b/
youtube_dl/extractor/youku.py
@@
-176,13
+176,15
@@
class YoukuIE(InfoExtractor):
error_code = data1.get('error_code')
if error_code:
error_code = data1.get('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(
- error or 'Server reported error %i' %
- error_code,
- expected=True)
+ if error is not None and '因版权原因无法观看此视频' in error:
+ raise ExtractorError(
+ 'Youku said: Sorry, this video is available in China only', 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']