mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-05-03 14:06:07 +00:00
Compare commits
7 Commits
3bb3aa4672
...
6557fc538e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6557fc538e | ||
|
|
fa2e2f789e | ||
|
|
f1fe8dc8d2 | ||
|
|
59ba75dbfe | ||
|
|
bbf362df9c | ||
|
|
67c05c9c43 | ||
|
|
692a396be8 |
@ -27,7 +27,7 @@ class DreiSatIE(ZDFBaseIE):
|
|||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://www.3sat.de/film/ab-18/ab-18---mein-fremdes-ich-100.html',
|
'url': 'https://www.3sat.de/film/ab-18/ab-18---mein-fremdes-ich-100.html',
|
||||||
'md5': '66cb9013ce37f6e008dc99bfcf1356bc',
|
'md5': 'f92638413a11d759bdae95c9d8ec165c',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '221128_mein_fremdes_ich2_ab18',
|
'id': '221128_mein_fremdes_ich2_ab18',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@ -42,7 +42,7 @@ class DreiSatIE(ZDFBaseIE):
|
|||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://www.3sat.de/gesellschaft/37-grad-leben/aus-dem-leben-gerissen-102.html',
|
'url': 'https://www.3sat.de/gesellschaft/37-grad-leben/aus-dem-leben-gerissen-102.html',
|
||||||
'md5': '69f276184c9a24147e4baae728fbc3c4',
|
'md5': 'a903eaf8d1fd635bd3317cd2ad87ec84',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '250323_0903_sendung_sgl',
|
'id': '250323_0903_sendung_sgl',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@ -58,7 +58,7 @@ class DreiSatIE(ZDFBaseIE):
|
|||||||
}, {
|
}, {
|
||||||
# Video with chapters
|
# Video with chapters
|
||||||
'url': 'https://www.3sat.de/kultur/buchmesse/dein-buch-das-beste-von-der-leipziger-buchmesse-2025-teil-1-100.html',
|
'url': 'https://www.3sat.de/kultur/buchmesse/dein-buch-das-beste-von-der-leipziger-buchmesse-2025-teil-1-100.html',
|
||||||
'md5': '65e8f365799d2266c9110d83d748445e',
|
'md5': '6b95790ce52e75f0d050adcdd2711ee6',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '250330_dein_buch1_bum',
|
'id': '250330_dein_buch1_bum',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@ -97,7 +97,9 @@ class DreiSatIE(ZDFBaseIE):
|
|||||||
(('streams', 'default'), None),
|
(('streams', 'default'), None),
|
||||||
('http://zdf.de/rels/streams/ptmd', 'http://zdf.de/rels/streams/ptmd-template'),
|
('http://zdf.de/rels/streams/ptmd', 'http://zdf.de/rels/streams/ptmd-template'),
|
||||||
{str}, any, {require('ptmd path')}))
|
{str}, any, {require('ptmd path')}))
|
||||||
info = self._extract_ptmd(player_url, ptmd_path, video_id, api_token)
|
ptmd_url = self._expand_ptmd_template(player_url, ptmd_path)
|
||||||
|
aspect_ratio = self._parse_aspect_ratio(video_target.get('aspectRatio'))
|
||||||
|
info = self._extract_ptmd_urls(ptmd_url, video_id, api_token, aspect_ratio)
|
||||||
|
|
||||||
return merge_dicts(info, {
|
return merge_dicts(info, {
|
||||||
**traverse_obj(content, {
|
**traverse_obj(content, {
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class PhoenixIE(ZDFBaseIE):
|
|||||||
_VALID_URL = r'https?://(?:www\.)?phoenix\.de/(?:[^/?#]+/)*[^/?#&]*-a-(?P<id>\d+)\.html'
|
_VALID_URL = r'https?://(?:www\.)?phoenix\.de/(?:[^/?#]+/)*[^/?#&]*-a-(?P<id>\d+)\.html'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.phoenix.de/sendungen/dokumentationen/spitzbergen-a-893349.html',
|
'url': 'https://www.phoenix.de/sendungen/dokumentationen/spitzbergen-a-893349.html',
|
||||||
'md5': '768bbcd67a51fbfb22263ecdbc49146d',
|
'md5': 'a79e86d9774d0b3f2102aff988a0bd32',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '221215_phx_spitzbergen',
|
'id': '221215_phx_spitzbergen',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@ -70,9 +70,8 @@ class PhoenixIE(ZDFBaseIE):
|
|||||||
title = title or details['title']
|
title = title or details['title']
|
||||||
content_id = details['tracking']['nielsen']['content']['assetid']
|
content_id = details['tracking']['nielsen']['content']['assetid']
|
||||||
|
|
||||||
info = self._extract_ptmd(
|
info = self._extract_ptmd_urls(
|
||||||
'https://tmd.phoenix.de',
|
f'https://tmd.phoenix.de/tmd/2/android_native_6/vod/ptmd/phoenix/{content_id}',
|
||||||
f'tmd/2/{{playerId}}/vod/ptmd/phoenix/{content_id}',
|
|
||||||
content_id)
|
content_id)
|
||||||
|
|
||||||
duration = int_or_none(try_get(
|
duration = int_or_none(try_get(
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import functools
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
@ -14,8 +15,6 @@ from ..utils import (
|
|||||||
parse_codecs,
|
parse_codecs,
|
||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
parse_qs,
|
parse_qs,
|
||||||
qualities,
|
|
||||||
try_get,
|
|
||||||
unified_timestamp,
|
unified_timestamp,
|
||||||
url_or_none,
|
url_or_none,
|
||||||
urljoin,
|
urljoin,
|
||||||
@ -26,7 +25,6 @@ from ..utils.traversal import traverse_obj
|
|||||||
|
|
||||||
class ZDFBaseIE(InfoExtractor):
|
class ZDFBaseIE(InfoExtractor):
|
||||||
_GEO_COUNTRIES = ['DE']
|
_GEO_COUNTRIES = ['DE']
|
||||||
_QUALITIES = ('auto', 'low', 'med', 'high', 'veryhigh', 'hd', 'fhd', 'uhd')
|
|
||||||
|
|
||||||
def _call_api(self, url, video_id, item, api_token=None):
|
def _call_api(self, url, video_id, item, api_token=None):
|
||||||
headers = {'Api-Auth': api_token} if api_token else {}
|
headers = {'Api-Auth': api_token} if api_token else {}
|
||||||
@ -34,6 +32,12 @@ class ZDFBaseIE(InfoExtractor):
|
|||||||
url, video_id, note=f'Downloading {item}',
|
url, video_id, note=f'Downloading {item}',
|
||||||
errnote=f'Failed to download {item}', headers=headers)
|
errnote=f'Failed to download {item}', headers=headers)
|
||||||
|
|
||||||
|
def _parse_aspect_ratio(self, aspect_ratio):
|
||||||
|
if not aspect_ratio or not isinstance(aspect_ratio, str):
|
||||||
|
return None
|
||||||
|
mobj = re.match(r'(?P<width>\d+):(?P<height>\d+)', aspect_ratio)
|
||||||
|
return int(mobj.group('width')) / int(mobj.group('height')) if mobj else None
|
||||||
|
|
||||||
def _extract_chapters(self, data):
|
def _extract_chapters(self, data):
|
||||||
return traverse_obj(data, (lambda _, v: 'anchorOffset' in v, {
|
return traverse_obj(data, (lambda _, v: 'anchorOffset' in v, {
|
||||||
'start_time': ('anchorOffset', {float_or_none}),
|
'start_time': ('anchorOffset', {float_or_none}),
|
||||||
@ -55,75 +59,66 @@ class ZDFBaseIE(InfoExtractor):
|
|||||||
})
|
})
|
||||||
return subtitles
|
return subtitles
|
||||||
|
|
||||||
def _extract_format(self, video_id, formats, format_urls, meta):
|
def _expand_ptmd_template(self, api_base_url, template):
|
||||||
format_url = meta['url']
|
return urljoin(api_base_url, template.replace('{playerId}', 'android_native_6'))
|
||||||
if format_url in format_urls:
|
|
||||||
return
|
def _extract_ptmd_urls(self, ptmd_urls, video_id, api_token=None, aspect_ratio=None):
|
||||||
format_urls.add(format_url)
|
ptmd_urls = variadic(ptmd_urls)
|
||||||
ext = determine_ext(format_url)
|
ptmd_info = []
|
||||||
if ext == 'm3u8':
|
for url in ptmd_urls:
|
||||||
fmts = self._extract_m3u8_formats(
|
ptmd_info.append({
|
||||||
format_url, video_id, 'mp4', m3u8_id='hls', fatal=False)
|
'url': url,
|
||||||
elif ext == 'mpd':
|
'dgs': False,
|
||||||
fmts = self._extract_mpd_formats(
|
|
||||||
format_url, video_id, mpd_id='dash', fatal=False)
|
|
||||||
else:
|
|
||||||
f = parse_codecs(meta.get('mimeCodec'))
|
|
||||||
if not f and meta.get('type'):
|
|
||||||
data = meta['type'].split('_')
|
|
||||||
if len(data) >= 3 and data[2] == ext:
|
|
||||||
f = {'vcodec': data[0], 'acodec': data[1]}
|
|
||||||
f.update({
|
|
||||||
'url': format_url,
|
|
||||||
'height': int_or_none(meta.get('highestVerticalResolution')),
|
|
||||||
'format_id': join_nonempty('http', meta.get('type'), meta.get('quality')),
|
|
||||||
'tbr': int_or_none(self._search_regex(r'_(\d+)k_', format_url, 'tbr', default=None)),
|
|
||||||
})
|
})
|
||||||
fmts = [f]
|
return self._extract_ptmd(ptmd_info, video_id, api_token, aspect_ratio)
|
||||||
formats.extend(merge_dicts(f, {
|
|
||||||
'format_note': join_nonempty(meta.get('quality'), meta.get('class'), delim=', '),
|
|
||||||
'language': meta.get('language'),
|
|
||||||
'language_preference': 10 if meta.get('class') == 'main' else -10 if meta.get('class') == 'ad' else -1,
|
|
||||||
'quality': qualities(self._QUALITIES)(meta.get('quality')),
|
|
||||||
}) for f in fmts)
|
|
||||||
|
|
||||||
def _extract_ptmd(self, api_base_url, templates, video_id, api_token=None):
|
def _extract_ptmd(self, ptmd_info, video_id, api_token=None, aspect_ratio=None):
|
||||||
# TODO: If there are multiple PTMD templates,
|
ptmd_info = variadic(ptmd_info)
|
||||||
# usually one of them is a sign-language variant of the video.
|
|
||||||
# The format order works out fine as is and prefers the "regular" video,
|
|
||||||
# but this should probably be made more explicit.
|
|
||||||
|
|
||||||
# TODO: HTTPS formats are extracted without resolution information
|
|
||||||
# However, we know vertical resolution and the caller often knows apsect ratio.
|
|
||||||
# So we could calculate the correct resulution from those two data points.
|
|
||||||
templates = variadic(templates)
|
|
||||||
src_captions = []
|
src_captions = []
|
||||||
|
|
||||||
content_id = None
|
content_id = None
|
||||||
duration = None
|
duration = None
|
||||||
formats = []
|
formats = []
|
||||||
track_uris = set()
|
track_uris = set()
|
||||||
for template in templates:
|
for info in ptmd_info:
|
||||||
ptmd_url = urljoin(api_base_url, template.replace(
|
ptmd = self._call_api(info['url'], video_id, 'PTMD data', api_token)
|
||||||
'{playerId}', 'android_native_6'))
|
basename = ptmd.get('basename') or info['url'].split('/')[-2]
|
||||||
ptmd = self._call_api(ptmd_url, video_id, 'PTMD data', api_token)
|
if not content_id and not info['dgs']:
|
||||||
# As per above TODO on sign language videos variants,
|
content_id = basename
|
||||||
# prefer content_id from the last entry to get the "regular" ID.
|
|
||||||
content_id = ptmd.get('basename') or ptmd_url.split('/')[-2]
|
|
||||||
duration = (duration or traverse_obj(ptmd, ('attributes', 'duration', 'value', {float_or_none(scale=1000)})))
|
duration = (duration or traverse_obj(ptmd, ('attributes', 'duration', 'value', {float_or_none(scale=1000)})))
|
||||||
src_captions += ptmd.get('captions') or []
|
src_captions += ptmd.get('captions') or []
|
||||||
for stream in traverse_obj(ptmd, ('priorityList', ..., 'formitaeten', ..., {dict})):
|
for stream in traverse_obj(ptmd, ('priorityList', ..., 'formitaeten', ..., {dict})):
|
||||||
for quality in traverse_obj(stream, ('qualities', ..., {dict})):
|
for quality in traverse_obj(stream, ('qualities', ..., {dict})):
|
||||||
for variant in traverse_obj(quality, ('audio', 'tracks', lambda _, v: url_or_none(v['uri']))):
|
for variant in traverse_obj(quality, ('audio', 'tracks', lambda _, v: url_or_none(v['uri']))):
|
||||||
self._extract_format(
|
format_url = variant['uri']
|
||||||
content_id, formats, track_uris, {
|
if format_url in track_uris:
|
||||||
'url': variant.get('uri'),
|
continue
|
||||||
'type': stream.get('type'),
|
track_uris.add(format_url)
|
||||||
'mimeCodec': quality.get('mimeCodec'),
|
ext = determine_ext(format_url)
|
||||||
'quality': quality.get('quality'),
|
if ext == 'm3u8':
|
||||||
'class': variant.get('class'),
|
fmts = self._extract_m3u8_formats(
|
||||||
'language': variant.get('language'),
|
format_url, basename, 'mp4', m3u8_id='hls', fatal=False)
|
||||||
})
|
elif ext == 'mpd':
|
||||||
|
fmts = self._extract_mpd_formats(
|
||||||
|
format_url, basename, mpd_id='dash', fatal=False)
|
||||||
|
else:
|
||||||
|
height = int_or_none(quality.get('highestVerticalResolution'))
|
||||||
|
width = round(aspect_ratio * height) if aspect_ratio and height else None
|
||||||
|
fmts = [{
|
||||||
|
'url': format_url,
|
||||||
|
**parse_codecs(quality.get('mimeCodec')),
|
||||||
|
'height': height,
|
||||||
|
'width': width,
|
||||||
|
'format_id': join_nonempty('http', stream.get('type')),
|
||||||
|
'tbr': int_or_none(self._search_regex(r'_(\d+)k_', format_url, 'tbr', default=None)),
|
||||||
|
}]
|
||||||
|
formats.extend(merge_dicts(f, {
|
||||||
|
'format_note': join_nonempty(
|
||||||
|
variant.get('class'), 'dgs' if info['dgs'] else '', delim=', '),
|
||||||
|
'language': variant.get('language'),
|
||||||
|
'preference': -2 if info['dgs'] else -1,
|
||||||
|
'language_preference': 10 if variant.get('class') == 'main' else -10 if variant.get('class') == 'ad' else -1,
|
||||||
|
}) for f in fmts)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'extractor_key': ZDFIE.ie_key(),
|
'extractor_key': ZDFIE.ie_key(),
|
||||||
@ -131,7 +126,6 @@ class ZDFBaseIE(InfoExtractor):
|
|||||||
'duration': duration,
|
'duration': duration,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'subtitles': self._extract_subtitles(src_captions),
|
'subtitles': self._extract_subtitles(src_captions),
|
||||||
'_format_sort_fields': ('tbr', 'res', 'quality', 'language_preference'),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def _get_api_token(self, video_id):
|
def _get_api_token(self, video_id):
|
||||||
@ -303,7 +297,7 @@ class ZDFIE(ZDFBaseIE):
|
|||||||
# Video with chapters
|
# Video with chapters
|
||||||
# Also: video with sign-language variant
|
# Also: video with sign-language variant
|
||||||
'url': 'https://www.zdf.de/video/magazine/heute-journal-104/heute-journal-vom-19-12-2021-100',
|
'url': 'https://www.zdf.de/video/magazine/heute-journal-104/heute-journal-vom-19-12-2021-100',
|
||||||
'md5': '1175003f28507bd27b266181c4de9f56',
|
'md5': '6ada39465497a84fb98d48ffff69e7b7',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'heute-journal-vom-19-12-2021-100',
|
'id': 'heute-journal-vom-19-12-2021-100',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@ -326,7 +320,7 @@ class ZDFIE(ZDFBaseIE):
|
|||||||
}, {
|
}, {
|
||||||
# Video that requires fallback extraction
|
# Video that requires fallback extraction
|
||||||
'url': 'https://www.zdf.de/nachrichten/politik/deutschland/koalitionsverhandlungen-spd-cdu-csu-dobrindt-100.html',
|
'url': 'https://www.zdf.de/nachrichten/politik/deutschland/koalitionsverhandlungen-spd-cdu-csu-dobrindt-100.html',
|
||||||
'md5': '95903ecbd37f2881b4462d074b8f8c44',
|
'md5': 'c3a78514dd993a5781aa3afe50db51e2',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'koalitionsverhandlungen-spd-cdu-csu-dobrindt-100',
|
'id': 'koalitionsverhandlungen-spd-cdu-csu-dobrindt-100',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@ -381,7 +375,7 @@ class ZDFIE(ZDFBaseIE):
|
|||||||
'url': 'https://www.zdf.de/serien/northern-lights/begegnung-auf-der-bruecke-100.html',
|
'url': 'https://www.zdf.de/serien/northern-lights/begegnung-auf-der-bruecke-100.html',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'begegnung-auf-der-bruecke-100',
|
'id': 'begegnung-auf-der-bruecke-100',
|
||||||
'ext': 'mp4',
|
'ext': 'webm',
|
||||||
'title': 'Begegnung auf der Brücke',
|
'title': 'Begegnung auf der Brücke',
|
||||||
'description': 'md5:e53a555da87447f7f1207f10353f8e45',
|
'description': 'md5:e53a555da87447f7f1207f10353f8e45',
|
||||||
'duration': 3083.0,
|
'duration': 3083.0,
|
||||||
@ -483,6 +477,16 @@ query VideoByCanonical($canonical: String!) {
|
|||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
def _extract_ptmd(self, ptmd_info, video_id, api_token=None, aspect_ratio=None):
|
||||||
|
ptmd_data = super()._extract_ptmd(ptmd_info, video_id, api_token, aspect_ratio)
|
||||||
|
# We can't use the ID from PTMD extraction as the video ID
|
||||||
|
# because it is not available during playlist extraction.
|
||||||
|
# We fix it here manually instead of inside the base class
|
||||||
|
# because other extractors do rely on using it as their ID.
|
||||||
|
ptmd_data['_old_archive_ids'] = [make_archive_id(ZDFIE, ptmd_data['id'])]
|
||||||
|
del ptmd_data['id']
|
||||||
|
return ptmd_data
|
||||||
|
|
||||||
# This fallback should generally only happen for pages under `zdf.de/nachrichten`.
|
# This fallback should generally only happen for pages under `zdf.de/nachrichten`.
|
||||||
# They are on a separate website for which GraphQL often doesn't return results.
|
# They are on a separate website for which GraphQL often doesn't return results.
|
||||||
# The API used here is no longer in use by official clients and likely deprecated.
|
# The API used here is no longer in use by official clients and likely deprecated.
|
||||||
@ -495,11 +499,10 @@ query VideoByCanonical($canonical: String!) {
|
|||||||
errnote='Failed to download fallback metadata')
|
errnote='Failed to download fallback metadata')
|
||||||
document = video['document']
|
document = video['document']
|
||||||
|
|
||||||
content_id = document.get('basename')
|
ptmd_url = traverse_obj(document, (
|
||||||
formats = []
|
('streamApiUrlAndroid', ('streams', 0, 'streamApiUrlAndroid')),
|
||||||
format_urls = set()
|
{url_or_none}, any))
|
||||||
for f in traverse_obj(document, ('formitaeten', ..., {dict})):
|
ptmd_data = self._extract_ptmd_urls(ptmd_url, document_id, self._get_api_token(document_id))
|
||||||
self._extract_format(document_id, formats, format_urls, f)
|
|
||||||
|
|
||||||
thumbnails = []
|
thumbnails = []
|
||||||
for thumbnail_key, thumbnail in traverse_obj(document, ('teaserBild', {dict.items})):
|
for thumbnail_key, thumbnail in traverse_obj(document, ('teaserBild', {dict.items})):
|
||||||
@ -515,15 +518,16 @@ query VideoByCanonical($canonical: String!) {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
'id': document_id,
|
'id': document_id,
|
||||||
'title': document.get('titel'),
|
|
||||||
'description': document.get('beschreibung'),
|
|
||||||
'duration': int_or_none(document.get('length')),
|
|
||||||
'timestamp': unified_timestamp(document.get('date')) or unified_timestamp(
|
|
||||||
try_get(video, lambda x: x['meta']['editorialDate'], str)),
|
|
||||||
'thumbnails': thumbnails,
|
'thumbnails': thumbnails,
|
||||||
'subtitles': self._extract_subtitles(document.get('captions') or []),
|
**ptmd_data,
|
||||||
'formats': formats,
|
**traverse_obj(video, {
|
||||||
'_old_archive_ids': [make_archive_id(ZDFIE, content_id)] if content_id else [],
|
'title': ('document', 'titel', {str}),
|
||||||
|
'description': ('document', 'beschreibung', {str}),
|
||||||
|
'timestamp': (
|
||||||
|
(('document', 'date'), ('meta', 'editorialDate')),
|
||||||
|
{unified_timestamp}, any),
|
||||||
|
'subtitles': ('document', 'captions', {self._extract_subtitles}),
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
@ -536,22 +540,20 @@ query VideoByCanonical($canonical: String!) {
|
|||||||
|
|
||||||
if not video_data:
|
if not video_data:
|
||||||
return self._extract_fallback(video_id)
|
return self._extract_fallback(video_id)
|
||||||
|
ptmd_nodes = traverse_obj(video_data, ('currentMedia', 'nodes'))
|
||||||
ptmd_templates = traverse_obj(
|
ptmd_info = traverse_obj(ptmd_nodes, (..., {
|
||||||
video_data, ('currentMedia', 'nodes', ..., 'ptmdTemplate'))
|
'url': ('ptmdTemplate', {functools.partial(self._expand_ptmd_template, 'https://api.zdf.de')}),
|
||||||
ptmd_data = self._extract_ptmd(
|
# Sign-language variant (DGS = *D*eutsche *G*ebärden*s*prache')
|
||||||
'https://api.zdf.de', ptmd_templates, video_id,
|
'dgs': ('vodMediaType', {lambda x: x == 'DGS'}),
|
||||||
self._get_api_token(video_id))
|
}))
|
||||||
# We can't use the ID from PTMD extraction as the video ID
|
aspect_ratio = traverse_obj(ptmd_nodes, (
|
||||||
# because it is not available during playlist extraction.
|
..., 'aspectRatio', {self._parse_aspect_ratio}, any))
|
||||||
# We fix it here manually instead of inside the method
|
ptmd_result = self._extract_ptmd(
|
||||||
# because other extractors do rely on using it as their ID.
|
ptmd_info, video_id, self._get_api_token(video_id), aspect_ratio)
|
||||||
ptmd_data['_old_archive_ids'] = [make_archive_id(ZDFIE, ptmd_data['id'])]
|
|
||||||
del ptmd_data['id']
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
**ptmd_data,
|
**ptmd_result,
|
||||||
**traverse_obj(video_data, {
|
**traverse_obj(video_data, {
|
||||||
'title': ('title', {str}),
|
'title': ('title', {str}),
|
||||||
'description': (('leadParagraph', ('teaser', 'description')), any, {str}),
|
'description': (('leadParagraph', ('teaser', 'description')), any, {str}),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user