浏览代码

[common] Split _download_json
Add ability for extractor to use _parse_json

Tithen-Firion 10 年之前
父节点
当前提交
ebb6419960
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      youtube_dl/extractor/common.py

+ 4 - 0
youtube_dl/extractor/common.py

@@ -390,6 +390,10 @@ class InfoExtractor(object):
             url_or_request, video_id, note, errnote, fatal=fatal)
         if (not fatal) and json_string is False:
             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:
             json_string = transform_source(json_string)
         try: