mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-10 02:43:44 +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
|
||||
|
||||
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}),
|
||||
'title': ('anchorLabel', {str}),
|
||||
}), default=None)
|
||||
})) or None
|
||||
|
||||
@staticmethod
|
||||
def _extract_subtitles(src):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user