Skip to content

Commit

Permalink
[ie/francetv] Fix extractor (#10177)
Browse files Browse the repository at this point in the history
Closes #10175
Authored by: bashonly
  • Loading branch information
bashonly authored Jun 13, 2024
1 parent d7d8618 commit 081708d
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions yt_dlp/extractor/francetv.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class FranceTVIE(InfoExtractor):
_GEO_BYPASS = False

_TESTS = [{
# tokenized url is in dinfo['video']['token']
'url': 'francetv:ec217ecc-0733-48cf-ac06-af1347b849d1',
'info_dict': {
'id': 'ec217ecc-0733-48cf-ac06-af1347b849d1',
Expand All @@ -44,6 +45,19 @@ class FranceTVIE(InfoExtractor):
'upload_date': '20170813',
},
'params': {'skip_download': 'm3u8'},
}, {
# tokenized url is in dinfo['video']['token']['akamai']
'url': 'francetv:c5bda21d-2c6f-4470-8849-3d8327adb2ba',
'info_dict': {
'id': 'c5bda21d-2c6f-4470-8849-3d8327adb2ba',
'ext': 'mp4',
'title': '13h15, le dimanche... - Les mystères de Jésus',
'timestamp': 1514118300,
'duration': 2880,
'thumbnail': r're:^https?://.*\.jpg$',
'upload_date': '20171224',
},
'params': {'skip_download': 'm3u8'},
}, {
'url': 'francetv:162311093',
'only_matching': True,
Expand Down Expand Up @@ -119,7 +133,7 @@ def _extract_video(self, video_id, hostname=None):
video_url = video['url']
format_id = video.get('format')

if token_url := url_or_none(video.get('token')):
if token_url := traverse_obj(video, ('token', (None, 'akamai'), {url_or_none}, any)):
tokenized_url = traverse_obj(self._download_json(
token_url, video_id, f'Downloading signed {format_id} manifest URL',
fatal=False, query={
Expand Down Expand Up @@ -225,13 +239,13 @@ class FranceTVSiteIE(FranceTVBaseInfoExtractor):
_TESTS = [{
'url': 'https://www.france.tv/france-2/13h15-le-dimanche/140921-les-mysteres-de-jesus.html',
'info_dict': {
'id': 'ec217ecc-0733-48cf-ac06-af1347b849d1',
'id': 'c5bda21d-2c6f-4470-8849-3d8327adb2ba',
'ext': 'mp4',
'title': '13h15, le dimanche... - Les mystères de Jésus',
'timestamp': 1502623500,
'duration': 2580,
'timestamp': 1514118300,
'duration': 2880,
'thumbnail': r're:^https?://.*\.jpg$',
'upload_date': '20170813',
'upload_date': '20171224',
},
'params': {
'skip_download': True,
Expand Down

0 comments on commit 081708d

Please sign in to comment.