[common] Split _download_json
authorTithen-Firion <Tithen-Firion@users.noreply.github.com>
Fri, 5 Dec 2014 11:07:06 +0000 (12:07 +0100)
committerTithen-Firion <Tithen-Firion@users.noreply.github.com>
Fri, 5 Dec 2014 11:21:21 +0000 (12:21 +0100)
Add ability for extractor to use _parse_json

youtube_dl/extractor/common.py

index e80a2dad0b2e12c5e9d14a486feb0b600de66823..7cbd846f60c22daf8343b242f9ef017bb3dcc60b 100644 (file)
@@ -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: