From 9203bf6beace357fd64a05fdb50b802a9d750778 Mon Sep 17 00:00:00 2001 From: Antoine Guillemin Date: Fri, 7 Dec 2018 10:43:39 +0100 Subject: [PATCH] Add age-limit option on dailymotion to download explicit --- youtube_dl/extractor/dailymotion.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/dailymotion.py b/youtube_dl/extractor/dailymotion.py index 1816c559e..6dd0899dd 100644 --- a/youtube_dl/extractor/dailymotion.py +++ b/youtube_dl/extractor/dailymotion.py @@ -182,13 +182,18 @@ class DailymotionIE(DailymotionBaseInfoExtractor): if metadata_url: metadata_url = metadata_url.replace(':videoId', video_id) else: - metadata_url = update_url_query( - 'https://www.dailymotion.com/player/metadata/video/%s' - % video_id, { - 'embedder': url, - 'integration': 'inline', - 'GK_PV5_NEON': '1', - }) + if (17 < age_limit) : + metadata_url = update_url_query( + 'https://www.dailymotion.com/player/metadata/video/%s' + % video_id, {}) + else : + metadata_url = update_url_query( + 'https://www.dailymotion.com/player/metadata/video/%s' + % video_id, { + 'embedder': url, + 'integration': 'inline', + 'GK_PV5_NEON': '1', + }) metadata = self._download_json( metadata_url, video_id, 'Downloading metadata JSON')