diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index ae8af61de..6b46db357 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -665,11 +665,11 @@ class InfoExtractor(object): return self._parse_json( json_string, video_id, transform_source=transform_source, fatal=fatal) - def _parse_json(self, json_string, video_id, transform_source=None, fatal=True): + def _parse_json(self, json_string, video_id, transform_source=None, fatal=True, strict=True): if transform_source: json_string = transform_source(json_string) try: - return json.loads(json_string) + return json.loads(json_string, strict=strict) except ValueError as ve: errmsg = '%s: Failed to parse JSON ' % video_id if fatal: diff --git a/youtube_dl/extractor/gamestar.py b/youtube_dl/extractor/gamestar.py index e607d6ab8..f9da04342 100644 --- a/youtube_dl/extractor/gamestar.py +++ b/youtube_dl/extractor/gamestar.py @@ -35,7 +35,7 @@ class GameStarIE(InfoExtractor): # while _search_json_ld finds only the first one json_ld = self._parse_json(self._search_regex( r'(?s)]+type=(["\'])application/ld\+json\1[^>]*>(?P[^<]+VideoObject[^<]+)', - webpage, 'JSON-LD', group='json_ld'), video_id) + webpage, 'JSON-LD', group='json_ld'), video_id, strict=False) info_dict = self._json_ld(json_ld, video_id) info_dict['title'] = remove_end(info_dict['title'], ' - GameStar')