aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Lobbenmeier <Stefan.Lobbenmeier@gmail.com>2023-10-09 19:51:37 +0200
committerGitHub <noreply@github.com>2023-10-09 17:51:37 +0000
commit09f815ad52843219a7ee3f2a0dddf6c250c91f0c (patch)
treeaaa56ad70c3176fa3e7ecacacf9ea1c4f00bbacd
parentb7098d46b552a9322c6cea39ba80be5229f922de (diff)
downloadyt-dlp-09f815ad52843219a7ee3f2a0dddf6c250c91f0c.tar.gz
[ie/ArteTV] Support age-restricted content (#8301)
Closes #7782 Authored by: StefanLobbenmeier
-rw-r--r--yt_dlp/extractor/arte.py39
1 files changed, 16 insertions, 23 deletions
diff --git a/yt_dlp/extractor/arte.py b/yt_dlp/extractor/arte.py
index a19cd2a3a..139a3a729 100644
--- a/yt_dlp/extractor/arte.py
+++ b/yt_dlp/extractor/arte.py
@@ -48,17 +48,7 @@ class ArteTVIE(ArteTVBaseIE):
}, {
'note': 'No alt_title',
'url': 'https://www.arte.tv/fr/videos/110371-000-A/la-chaleur-supplice-des-arbres-de-rue/',
- 'info_dict': {
- 'id': '110371-000-A',
- 'ext': 'mp4',
- 'upload_date': '20220718',
- 'duration': 154,
- 'timestamp': 1658162460,
- 'description': 'md5:5890f36fe7dccfadb8b7c0891de54786',
- 'title': 'La chaleur, supplice des arbres de rue',
- 'thumbnail': 'https://api-cdn.arte.tv/img/v2/image/CPE2sQDtD8GLQgt8DuYHLf/940x530',
- },
- 'params': {'skip_download': 'm3u8'}
+ 'only_matching': True,
}, {
'url': 'https://api.arte.tv/api/player/v2/config/de/100605-013-A',
'only_matching': True,
@@ -67,19 +57,20 @@ class ArteTVIE(ArteTVBaseIE):
'only_matching': True,
}, {
'url': 'https://www.arte.tv/de/videos/110203-006-A/zaz/',
+ 'only_matching': True,
+ }, {
+ 'note': 'age-restricted',
+ 'url': 'https://www.arte.tv/de/videos/006785-000-A/the-element-of-crime/',
'info_dict': {
- 'id': '110203-006-A',
- 'chapters': 'count:16',
- 'description': 'md5:cf592f1df52fe52007e3f8eac813c084',
- 'alt_title': 'Zaz',
- 'title': 'Baloise Session 2022',
- 'timestamp': 1668445200,
- 'duration': 4054,
- 'thumbnail': 'https://api-cdn.arte.tv/img/v2/image/ubQjmVCGyRx3hmBuZEK9QZ/940x530',
- 'upload_date': '20221114',
+ 'id': '006785-000-A',
+ 'description': 'md5:c2f94fdfefc8a280e4dab68ab96ab0ba',
+ 'title': 'The Element of Crime',
+ 'timestamp': 1696111200,
+ 'duration': 5849,
+ 'thumbnail': 'https://api-cdn.arte.tv/img/v2/image/q82dTTfyuCXupPsGxXsd7B/940x530',
+ 'upload_date': '20230930',
'ext': 'mp4',
- },
- 'expected_warnings': ['geo restricted']
+ }
}]
_GEO_BYPASS = True
@@ -136,7 +127,9 @@ class ArteTVIE(ArteTVBaseIE):
lang = mobj.group('lang') or mobj.group('lang_2')
langauge_code = self._LANG_MAP.get(lang)
- config = self._download_json(f'{self._API_BASE}/config/{lang}/{video_id}', video_id)
+ config = self._download_json(f'{self._API_BASE}/config/{lang}/{video_id}', video_id, headers={
+ 'x-validated-age': '18'
+ })
geoblocking = traverse_obj(config, ('data', 'attributes', 'restriction', 'geoblocking')) or {}
if geoblocking.get('restrictedArea'):
Un proyecto texto-plano.xyz