aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/extractor/common.py
diff options
context:
space:
mode:
authorsepro <sepro@sepr0.com>2025-04-06 20:31:00 +0200
committerGitHub <noreply@github.com>2025-04-06 20:31:00 +0200
commit45f01de00e1bc076b7f676a669736326178647b1 (patch)
tree712ae3c4002accd244312ac187f913a57836bc69 /yt_dlp/extractor/common.py
parentdb6d1f145ad583e0220637726029f8f2fa6200a0 (diff)
[utils] `_yield_json_ld`: Make function less fatal (#12855)
Authored by: seproDev
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r--yt_dlp/extractor/common.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index 4c1bc4cf4..d5607296d 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -1570,6 +1570,8 @@ class InfoExtractor:
"""Yield all json ld objects in the html"""
if default is not NO_DEFAULT:
fatal = False
+ if not fatal and not isinstance(html, str):
+ return
for mobj in re.finditer(JSON_LD_RE, html):
json_ld_item = self._parse_json(
mobj.group('json_ld'), video_id, fatal=fatal,