projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8696a7f
)
add support to video protected by password
author
Celthi
<txtlu0@gmail.com>
Sat, 12 Dec 2015 03:21:44 +0000
(11:21 +0800)
committer
Celthi
<txtlu0@gmail.com>
Sat, 12 Dec 2015 03:21:44 +0000
(11:21 +0800)
youtube_dl/extractor/youku.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/youku.py
b/youtube_dl/extractor/youku.py
index 9fd0e1e23336e1a06d604b7000fed54067e9bd1e..f1bb482c3f1d8efbbd0fb171e9e73b738db13fce 100644
(file)
--- a/
youtube_dl/extractor/youku.py
+++ b/
youtube_dl/extractor/youku.py
@@
-219,25
+219,25
@@
class YoukuIE(InfoExtractor):
# request basic data
basic_data_url = "http://play.youku.com/play/get.json?vid=%s&ct=12" % video_id
if video_password:
# request basic data
basic_data_url = "http://play.youku.com/play/get.json?vid=%s&ct=12" % video_id
if video_password:
- basic_data_url += '
?passwor
d=%s' % video_password
+ basic_data_url += '
&pw
d=%s' % video_password
data1 = retrieve_data(
basic_data_url,
'Downloading JSON metadata 1')
data2 = retrieve_data(
data1 = retrieve_data(
basic_data_url,
'Downloading JSON metadata 1')
data2 = retrieve_data(
-
"http://play.youku.com/play/get.json?vid=%s&ct=12" % video_id
,
+
basic_data_url
,
'Downloading JSON metadata 2')
'Downloading JSON metadata 2')
- error
_code = data1.get('error_code
')
- if error
_code
:
- error
= data1.get('error
')
- if error
is not None and '因版权原因无法观看此视频' in error
:
+ error
= data1.get('error
')
+ if error:
+ error
_note = error.get('note
')
+ if error
_note is not None and '因版权原因无法观看此视频' in error_note
:
raise ExtractorError(
'Youku said: Sorry, this video is available in China only', expected=True)
else:
raise ExtractorError(
'Youku said: Sorry, this video is available in China only', expected=True)
else:
- msg = 'Youku server reported error %i' % error
_code
+ msg = 'Youku server reported error %i' % error
.get('code')
if error is not None:
if error is not None:
- msg += ': ' + error
+ msg += ': ' + error
_note
raise ExtractorError(msg)
#get video title
raise ExtractorError(msg)
#get video title