X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fniconico.py;h=0f8aa5adad5b2247621ce00249f3bd03a33a104a;hb=486375154cb7d79bd084879467bc70550104b555;hp=dd16d0042edae363914a1870092a7dd7dafff459;hpb=b2e8e7dab567ed9b27817c5dd0cf173bc7fb8cfa;p=youtube-dl diff --git a/youtube_dl/extractor/niconico.py b/youtube_dl/extractor/niconico.py index dd16d0042..0f8aa5ada 100644 --- a/youtube_dl/extractor/niconico.py +++ b/youtube_dl/extractor/niconico.py @@ -67,6 +67,18 @@ class NiconicoIE(InfoExtractor): 'timestamp': 1198527840, # timestamp field has different value if logged in 'duration': 304, }, + }, { + 'url': 'http://www.nicovideo.jp/watch/so22543406', + 'info_dict': { + 'id': '1388129933', + 'ext': 'mp4', + 'title': '【第1回】RADIOアニメロミックス ラブライブ!~のぞえりRadio Garden~', + 'description': 'md5:b27d224bb0ff53d3c8269e9f8b561cf1', + 'timestamp': 1388851200, + 'upload_date': '20140104', + 'uploader': 'アニメロチャンネル', + 'uploader_id': '312', + } }] _VALID_URL = r'https?://(?:www\.|secure\.)?nicovideo\.jp/watch/(?P(?:[a-z]{2})?[0-9]+)' @@ -109,7 +121,10 @@ class NiconicoIE(InfoExtractor): # Get video webpage. We are not actually interested in it for normal # cases, but need the cookies in order to be able to download the # info webpage - webpage = self._download_webpage('http://www.nicovideo.jp/watch/' + video_id, video_id) + webpage, handle = self._download_webpage_handle( + 'http://www.nicovideo.jp/watch/' + video_id, video_id) + if video_id.startswith('so'): + video_id = self._match_id(handle.geturl()) video_info = self._download_xml( 'http://ext.nicovideo.jp/api/getthumbinfo/' + video_id, video_id, @@ -167,7 +182,6 @@ class NiconicoIE(InfoExtractor): extension = xpath_text(video_info, './/movie_type') if not extension: extension = determine_ext(video_real_url) - video_format = extension.upper() thumbnail = ( xpath_text(video_info, './/thumbnail_url') or @@ -226,7 +240,7 @@ class NiconicoIE(InfoExtractor): 'url': video_real_url, 'title': title, 'ext': extension, - 'format': video_format, + 'format_id': 'economy' if video_real_url.endswith('low') else 'normal', 'thumbnail': thumbnail, 'description': description, 'uploader': uploader,