From c3c5c31517ce121740666440a71becaba11176ac Mon Sep 17 00:00:00 2001 From: Todoroki Date: Wed, 18 Mar 2015 22:19:55 +0900 Subject: [PATCH 1/3] fix nm video DL issue when logged in --- youtube_dl/extractor/niconico.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/youtube_dl/extractor/niconico.py b/youtube_dl/extractor/niconico.py index 7fb4e57df..a48df7f62 100644 --- a/youtube_dl/extractor/niconico.py +++ b/youtube_dl/extractor/niconico.py @@ -89,7 +89,7 @@ class NiconicoIE(InfoExtractor): if self._AUTHENTICATED: # Get flv info flv_info_webpage = self._download_webpage( - 'http://flapi.nicovideo.jp/api/getflv?v=' + video_id, + 'http://flapi.nicovideo.jp/api/getflv/' + video_id + '?as3=1', video_id, 'Downloading flv info') else: # Get external player info @@ -97,7 +97,6 @@ class NiconicoIE(InfoExtractor): 'http://ext.nicovideo.jp/thumb_watch/' + video_id, video_id) thumb_play_key = self._search_regex( r'\'thumbPlayKey\'\s*:\s*\'(.*?)\'', ext_player_info, 'thumbPlayKey') - # Get flv info flv_info_data = compat_urllib_parse.urlencode({ 'k': thumb_play_key, From ee580538fa741fc35faa8210e0245e252bf23e40 Mon Sep 17 00:00:00 2001 From: Todoroki Date: Wed, 18 Mar 2015 22:24:17 +0900 Subject: [PATCH 2/3] fix nm video DL issue when logged in --- youtube_dl/extractor/niconico.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/niconico.py b/youtube_dl/extractor/niconico.py index a48df7f62..4d57ac703 100644 --- a/youtube_dl/extractor/niconico.py +++ b/youtube_dl/extractor/niconico.py @@ -97,6 +97,7 @@ class NiconicoIE(InfoExtractor): 'http://ext.nicovideo.jp/thumb_watch/' + video_id, video_id) thumb_play_key = self._search_regex( r'\'thumbPlayKey\'\s*:\s*\'(.*?)\'', ext_player_info, 'thumbPlayKey') + # Get flv info flv_info_data = compat_urllib_parse.urlencode({ 'k': thumb_play_key, From 1c9a1457fc154697b327a87d9afe674425740287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Fri, 20 Mar 2015 20:53:14 +0600 Subject: [PATCH 3/3] [niconico] Add nm video test --- youtube_dl/extractor/niconico.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/niconico.py b/youtube_dl/extractor/niconico.py index 4d57ac703..ddec7b338 100644 --- a/youtube_dl/extractor/niconico.py +++ b/youtube_dl/extractor/niconico.py @@ -22,7 +22,7 @@ class NiconicoIE(InfoExtractor): IE_NAME = 'niconico' IE_DESC = 'ニコニコ動画' - _TEST = { + _TESTS = [{ 'url': 'http://www.nicovideo.jp/watch/sm22312215', 'md5': 'd1a75c0823e2f629128c43e1212760f9', 'info_dict': { @@ -39,7 +39,24 @@ class NiconicoIE(InfoExtractor): 'username': 'ydl.niconico@gmail.com', 'password': 'youtube-dl', }, - } + }, { + 'url': 'http://www.nicovideo.jp/watch/nm14296458', + 'md5': '8db08e0158457cf852a31519fceea5bc', + 'info_dict': { + 'id': 'nm14296458', + 'ext': 'swf', + 'title': '【鏡音リン】Dance on media【オリジナル】take2!', + 'description': 'md5:', + 'uploader': 'りょうた', + 'uploader_id': '18822557', + 'upload_date': '20110429', + 'duration': 209, + }, + 'params': { + 'username': 'ydl.niconico@gmail.com', + 'password': 'youtube-dl', + }, + }] _VALID_URL = r'https?://(?:www\.|secure\.)?nicovideo\.jp/watch/(?P(?:[a-z]{2})?[0-9]+)' _NETRC_MACHINE = 'niconico'