aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.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/utils.py
parent1afe753462f0293122dc7a9b534b4f5cdb1e5c4e (diff)
[youtube] Correct invalid JSON (Fixes #2353)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 01c8c017d..fa8f80e02 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1214,3 +1214,9 @@ class PagedList(object):
if end == nextfirstid:
break
return res
+
+
+def uppercase_escape(s):
+ return re.sub(
+ r'\\U([0-9a-fA-F]{8})',
+ lambda m: compat_chr(int(m.group(1), base=16)), s)