aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/common.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-02-09 17:56:10 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-02-09 17:56:10 +0100
commit81c2f20b5386d89a62dc27293654d75b77f47473 (patch)
tree1c47e338c343d09884819f0f81544a45209f6dec /youtube_dl/extractor/common.py
parent1afe753462f0293122dc7a9b534b4f5cdb1e5c4e (diff)
[youtube] Correct invalid JSON (Fixes #2353)
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r--youtube_dl/extractor/common.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 2c0c75604..84fca8ba0 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -271,8 +271,11 @@ class InfoExtractor(object):
def _download_json(self, url_or_request, video_id,
note=u'Downloading JSON metadata',
- errnote=u'Unable to download JSON metadata'):
+ errnote=u'Unable to download JSON metadata',
+ transform_source=None):
json_string = self._download_webpage(url_or_request, video_id, note, errnote)
+ if transform_source:
+ json_string = transform_source(json_string)
try:
return json.loads(json_string)
except ValueError as ve: