mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-27 11:05:54 +00:00
safer _extract_chapters
Authored by: bashonly
This commit is contained in:
parent
3cafe45074
commit
daf2be0f25
@ -56,10 +56,10 @@ class ZDFBaseIE(InfoExtractor):
|
|||||||
return int(mobj.group('width')) / int(mobj.group('height')) if mobj else None
|
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: isinstance(v['anchorOffset'], (int, float)), {
|
||||||
'start_time': ('anchorOffset', {float_or_none}),
|
'start_time': ('anchorOffset', {float_or_none}),
|
||||||
'title': ('anchorLabel', {str}),
|
'title': ('anchorLabel', {str}),
|
||||||
}), default=None)
|
})) or None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _extract_subtitles(src):
|
def _extract_subtitles(src):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user