aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-06-15 23:46:07 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-06-15 23:46:07 +0800
commitf1e66cb2eb40b48c6508acbe57207a2d99792bf0 (patch)
tree26d157903d345d91d8fce0d4bc2a2b1b19d1e0e6
parentee69799262e8344742b9d8b492fe792b4d586f6a (diff)
downloadyoutube-dl-f1e66cb2eb40b48c6508acbe57207a2d99792bf0.tar.xz
[youku] Change video_id and add a multipart test case
-rw-r--r--youtube_dl/extractor/youku.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/youtube_dl/extractor/youku.py b/youtube_dl/extractor/youku.py
index d8162a0c5..d5b73ebce 100644
--- a/youtube_dl/extractor/youku.py
+++ b/youtube_dl/extractor/youku.py
@@ -25,13 +25,20 @@ class YoukuIE(InfoExtractor):
'url': 'http://v.youku.com/v_show/id_XMTc1ODE5Njcy.html',
'md5': '5f3af4192eabacc4501508d54a8cabd7',
'info_dict': {
- 'id': 'XMTc1ODE5Njcy',
+ 'id': 'XMTc1ODE5Njcy_part1',
'title': '★Smile﹗♡ Git Fresh -Booty Music舞蹈.',
'ext': 'flv'
}
}, {
'url': 'http://player.youku.com/player.php/sid/XNDgyMDQ2NTQw/v.swf',
'only_matching': True,
+ }, {
+ 'url': 'http://v.youku.com/v_show/id_XODgxNjg1Mzk2_ev_1.html',
+ 'info_dict': {
+ 'id': 'XODgxNjg1Mzk2',
+ 'title': '武媚娘传奇 85',
+ },
+ 'playlist_count': 11,
}]
def construct_video_urls(self, data1, data2):
@@ -201,20 +208,14 @@ class YoukuIE(InfoExtractor):
for i in range(len(entries)):
entries[i].update(
{
- 'id': '_part%d' % (i + 1),
+ 'id': '%s_part%d' % (video_id, i + 1),
'title': title,
}
)
- if len(entries) > 1:
- info = {
- '_type': 'multi_video',
- 'id': video_id,
- 'title': title,
- 'entries': entries,
- }
- else:
- info = entries[0]
- info['id'] = video_id
-
- return info
+ return {
+ '_type': 'multi_video',
+ 'id': video_id,
+ 'title': title,
+ 'entries': entries,
+ }