0
0
Fork 0

[dailymotion] Fix extraction (closes #17699)

main
Enes 2018-09-29 13:28:56 +03:00 committed by Sergey M․
parent d98cb62e55
commit f60b9803a4
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
1 changed files with 7 additions and 1 deletions

View File

@ -24,6 +24,7 @@ from ..utils import (
str_to_int, str_to_int,
unescapeHTML, unescapeHTML,
urlencode_postdata, urlencode_postdata,
try_get,
) )
@ -172,7 +173,12 @@ class DailymotionIE(DailymotionBaseInfoExtractor):
webpage, 'player v5', default=None) webpage, 'player v5', default=None)
if player_v5: if player_v5:
player = self._parse_json(player_v5, video_id) player = self._parse_json(player_v5, video_id)
metadata = player['metadata'] metadata = try_get(
player, lambda x: x['metadata'], dict) or self._download_json(
'http://www.dailymotion.com/player/metadata/video/%s' % video_id, video_id, query={
'integration': 'inline',
'GK_PV5_NEON': '1',
})
if metadata.get('error', {}).get('type') == 'password_protected': if metadata.get('error', {}).get('type') == 'password_protected':
password = self._downloader.params.get('videopassword') password = self._downloader.params.get('videopassword')