[utils] _yield_json_ld: Make function less fatal (#12855)
Authored by: seproDev
This commit is contained in:
parent
db6d1f145a
commit
45f01de00e
1 changed files with 2 additions and 0 deletions
|
|
@ -1570,6 +1570,8 @@ class InfoExtractor:
|
||||||
"""Yield all json ld objects in the html"""
|
"""Yield all json ld objects in the html"""
|
||||||
if default is not NO_DEFAULT:
|
if default is not NO_DEFAULT:
|
||||||
fatal = False
|
fatal = False
|
||||||
|
if not fatal and not isinstance(html, str):
|
||||||
|
return
|
||||||
for mobj in re.finditer(JSON_LD_RE, html):
|
for mobj in re.finditer(JSON_LD_RE, html):
|
||||||
json_ld_item = self._parse_json(
|
json_ld_item = self._parse_json(
|
||||||
mobj.group('json_ld'), video_id, fatal=fatal,
|
mobj.group('json_ld'), video_id, fatal=fatal,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue