From 45f01de00e1bc076b7f676a669736326178647b1 Mon Sep 17 00:00:00 2001 From: sepro Date: Sun, 6 Apr 2025 20:31:00 +0200 Subject: [PATCH] [utils] `_yield_json_ld`: Make function less fatal (#12855) Authored by: seproDev --- yt_dlp/extractor/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 4c1bc4cf47..d5607296df 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,