aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnes <enessolak99@gmail.com>2018-09-29 13:28:56 +0300
committerSergey M․ <dstftw@gmail.com>2018-10-05 02:03:16 +0700
commitf60b9803a473da8e324313d01af91e5676792c77 (patch)
tree9c41233ea2cfb9fa8d6489b4a7b43ad9acc5d004
parentd98cb62e552ee74079fda2e4173a40b14faac3fe (diff)
[dailymotion] Fix extraction (closes #17699)
-rw-r--r--youtube_dl/extractor/dailymotion.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/youtube_dl/extractor/dailymotion.py b/youtube_dl/extractor/dailymotion.py
index 040f0bd02..842d9a259 100644
--- a/youtube_dl/extractor/dailymotion.py
+++ b/youtube_dl/extractor/dailymotion.py
@@ -24,6 +24,7 @@ from ..utils import (
str_to_int,
unescapeHTML,
urlencode_postdata,
+ try_get,
)
@@ -172,7 +173,12 @@ class DailymotionIE(DailymotionBaseInfoExtractor):
webpage, 'player v5', default=None)
if player_v5:
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':
password = self._downloader.params.get('videopassword')