summary refs log tree commit diff
diff options
context:
space:
mode:
authorTithen-Firion <Tithen-Firion@users.noreply.github.com>2014-12-05 12:07:06 +0100
committerTithen-Firion <Tithen-Firion@users.noreply.github.com>2014-12-05 12:21:21 +0100
commitebb6419960eafbdde055d016b4f95620c724effb (patch)
treeaf7bab3f7fa00e4c50c5b9e720a2be3d61ccb62a
parenteecd6a467dd6b28cd0cdd63a9cebd5a8bfafd4c4 (diff)
downloadyoutube-dl-ebb6419960eafbdde055d016b4f95620c724effb.tar.gz
youtube-dl-ebb6419960eafbdde055d016b4f95620c724effb.tar.xz
youtube-dl-ebb6419960eafbdde055d016b4f95620c724effb.zip
[common] Split _download_json
Add ability for extractor to use _parse_json
-rw-r--r--youtube_dl/extractor/common.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index e80a2dad0..7cbd846f6 100644
--- a/youtube_dl/extractor/common.py
+++ b/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: