Skip to content

Commit

Permalink
[CI] auto update yt_dlp to upstream commit a0d9967f6822fc279e86bce334…
Browse files Browse the repository at this point in the history
…64194985148727
  • Loading branch information
github-actions[bot] committed Jun 14, 2024
1 parent c2923ae commit f103882
Show file tree
Hide file tree
Showing 9 changed files with 409 additions and 192 deletions.
5 changes: 4 additions & 1 deletion lib/yt_dlp/extractor/_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,10 @@
RTVETelevisionIE,
)
from .rtvs import RTVSIE
from .rtvslo import RTVSLOIE
from .rtvslo import (
RTVSLOIE,
RTVSLOShowIE,
)
from .rudovideo import RudoVideoIE
from .rule34video import Rule34VideoIE
from .rumble import (
Expand Down
48 changes: 38 additions & 10 deletions lib/yt_dlp/extractor/francetv.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .dailymotion import DailymotionIE
from ..networking import HEADRequest
from ..utils import (
clean_html,
determine_ext,
filter_dict,
format_field,
Expand Down Expand Up @@ -33,6 +34,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 +46,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 All @@ -68,6 +83,7 @@ class FranceTVIE(InfoExtractor):
def _extract_video(self, video_id, hostname=None):
is_live = None
videos = []
drm_formats = False
title = None
subtitle = None
episode_number = None
Expand All @@ -85,23 +101,32 @@ def _extract_video(self, video_id, hostname=None):
'device_type': device_type,
'browser': browser,
'domain': hostname,
}), fatal=False)
}), fatal=False, expected_status=422) # 422 json gives detailed error code/message

if not dinfo:
continue

video = traverse_obj(dinfo, ('video', {dict}))
if video:
if video := traverse_obj(dinfo, ('video', {dict})):
videos.append(video)
if duration is None:
duration = video.get('duration')
if is_live is None:
is_live = video.get('is_live')
if spritesheets is None:
spritesheets = video.get('spritesheets')
elif code := traverse_obj(dinfo, ('code', {int})):
if code == 2009:
self.raise_geo_restricted(countries=self._GEO_COUNTRIES)
elif code in (2015, 2017):
# 2015: L'accès à cette vidéo est impossible. (DRM-only)
# 2017: Cette vidéo n'est pas disponible depuis le site web mobile (b/c DRM)
drm_formats = True
continue
self.report_warning(
f'{self.IE_NAME} said: {code} "{clean_html(dinfo.get("message"))}"')
continue

meta = traverse_obj(dinfo, ('meta', {dict}))
if meta:
if meta := traverse_obj(dinfo, ('meta', {dict})):
if title is None:
title = meta.get('title')
# meta['pre_title'] contains season and episode number for series in format "S<ID> E<ID>"
Expand All @@ -114,12 +139,15 @@ def _extract_video(self, video_id, hostname=None):
if timestamp is None:
timestamp = parse_iso8601(meta.get('broadcasted_at'))

if not videos and drm_formats:
self.report_drm(video_id)

formats, subtitles, video_url = [], {}, None
for video in traverse_obj(videos, lambda _, v: url_or_none(v['url'])):
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 +253,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
Loading

0 comments on commit f103882

Please sign in to comment.