mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-10-31 07:50:11 +01:00
[common] Split _download_json
Add ability for extractor to use _parse_json
This commit is contained in:
parent
eecd6a467d
commit
ebb6419960
@ -390,6 +390,10 @@ def _download_json(self, url_or_request, video_id,
|
|||||||
url_or_request, video_id, note, errnote, fatal=fatal)
|
url_or_request, video_id, note, errnote, fatal=fatal)
|
||||||
if (not fatal) and json_string is False:
|
if (not fatal) and json_string is False:
|
||||||
return None
|
return None
|
||||||
|
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):
|
||||||
if transform_source:
|
if transform_source:
|
||||||
json_string = transform_source(json_string)
|
json_string = transform_source(json_string)
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user