diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-09-30 07:56:24 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-10-01 00:08:28 +0200 |
commit | 410f3e73ab268f74a455798ee39de5caba90caea (patch) | |
tree | 4a79ee7c8fe20462a7bdad6bfbeca51fcb7ca747 /youtube_dl/utils.py | |
parent | 07e764439a1cdd3a3b95fbf21acc6a517c6a889e (diff) |
[utils] Fix js_to_json
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index f05747097..59851a8c0 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -673,6 +673,8 @@ class ExtractorError(Exception): expected = True if video_id is not None: msg = video_id + ': ' + msg + if cause: + msg += u' (caused by %r)' % cause if not expected: msg = msg + u'; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.' super(ExtractorError, self).__init__(msg) @@ -1598,7 +1600,9 @@ def js_to_json(code): ([{,]\s*) ("[^"]*"|\'[^\']*\'|[a-z0-9A-Z]+) (:\s*) - ([0-9.]+|true|false|"[^"]*"|\'[^\']*\'|\[|\{) + ([0-9.]+|true|false|"[^"]*"|\'[^\']*\'| + (?=\[|\{) + ) ''', fix_kv, code) res = re.sub(r',(\s*\])', lambda m: m.group(1), res) return res |