New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nicovideo.jp issue #29225
Comments
same issue here |
same issue. different log.
|
It seems that the API has changed – the
That's in |
I've figured the issue out – apparently, Niconico have been recombobulating their API quite a bit lately, including switching from snake case to camel case. Here's a diff patch that makes videos of this type work: @@ -195,7 +195,7 @@
def yesno(boolean):
return 'yes' if boolean else 'no'
- session_api_data = api_data['video']['dmcInfo']['session_api']
+ session_api_data = api_data['media']['delivery']['movie']['session']
session_api_endpoint = session_api_data['urls'][0]
format_id = '-'.join(map(lambda s: remove_start(s['id'], 'archive_'), [video_quality, audio_quality]))
@@ -208,15 +208,15 @@
data=json.dumps({
'session': {
'client_info': {
- 'player_id': session_api_data['player_id'],
+ 'player_id': session_api_data['playerId'],
},
'content_auth': {
- 'auth_type': session_api_data['auth_types'][session_api_data['protocols'][0]],
- 'content_key_timeout': session_api_data['content_key_timeout'],
+ 'auth_type': session_api_data['authTypes'][session_api_data['protocols'][0]],
+ 'content_key_timeout': session_api_data['contentKeyTimeout'],
'service_id': 'nicovideo',
- 'service_user_id': session_api_data['service_user_id']
+ 'service_user_id': session_api_data['serviceUserId']
},
- 'content_id': session_api_data['content_id'],
+ 'content_id': session_api_data['contentId'],
'content_src_id_sets': [{
'content_src_ids': [{
'src_id_to_mux': {
@@ -229,7 +229,7 @@
'content_uri': '',
'keep_method': {
'heartbeat': {
- 'lifetime': session_api_data['heartbeat_lifetime']
+ 'lifetime': session_api_data['heartbeatLifetime']
}
},
'priority': session_api_data['priority'],
@@ -239,14 +239,14 @@
'http_parameters': {
'parameters': {
'http_output_download_parameters': {
- 'use_ssl': yesno(session_api_endpoint['is_ssl']),
- 'use_well_known_port': yesno(session_api_endpoint['is_well_known_port']),
+ 'use_ssl': yesno(session_api_endpoint['isSsl']),
+ 'use_well_known_port': yesno(session_api_endpoint['isWellKnownPort']),
}
}
}
}
},
- 'recipe_id': session_api_data['recipe_id'],
+ 'recipe_id': session_api_data['recipeId'],
'session_operation_auth': {
'session_operation_auth_by_signature': {
'signature': session_api_data['signature'],
@@ -288,7 +288,8 @@
return 'economy' if video_real_url.endswith('low') else 'normal'
try:
- video_real_url = api_data['video']['smileInfo']['url']
+ # video_real_url = api_data['video']['smileInfo']['url']
+ video_real_url = None
except KeyError: # Flash videos
# Get flv info
flv_info_webpage = self._download_webpage(
@@ -335,12 +336,11 @@
else:
formats = []
- dmc_info = api_data['video'].get('dmcInfo')
+ dmc_info = api_data['media']['delivery']['movie']
if dmc_info: # "New" HTML5 videos
- quality_info = dmc_info['quality']
- for audio_quality in quality_info['audios']:
- for video_quality in quality_info['videos']:
- if not audio_quality['available'] or not video_quality['available']:
+ for audio_quality in dmc_info['audios']:
+ for video_quality in dmc_info['videos']:
+ if not audio_quality['isAvailable'] or not video_quality['isAvailable']:
continue
formats.append(self._extract_format_for_quality(
api_data, video_id, audio_quality, video_quality)) I'm hesitant to make a pull request – as it stands, this almost certainly ruins the ability to download other types of videos (like FLV videos, for example). I'll leave the formal fix to someone who's more familiar with Niconico's inner workings. (Does the FLV video endpoint even still work? Does the “old HTML5 video” method still exist? From what I can tell in the API, it might be the case that the DMC approach is the only one at this point, although I may very well be wrong about that.) Here's the fix, either way! |
I'm 99.9% sure that FLV videos at least are entirely dead. 10+ year old videos are served as video/MP2T now when they were certainly flv at the time (this also goes for swf videos, which used to be interactive and now are not). I'd take most videos working over none, in any case, so I'll use this patch for now - thanks! |
Thanks for the patch! Required a bit more fixing though. |
Also getting this issue.
|
Same error here |
For downloading nicovideo.jp, I recommend using one of the following alternatives (this list is copied from my another abandoned project readme file):
|
Checklist
Verbose log
Description
Unable to download from the above website. Related bugs suggest problems with downloading speeds or requiring a login. Neither of those issues appear to be related to the problem I am having.
The text was updated successfully, but these errors were encountered: