]> jfr.im git - yt-dlp.git/blobdiff - youtube_dl/utils.py
[youtube] Correct invalid JSON (Fixes #2353)
[yt-dlp.git] / youtube_dl / utils.py
index 01c8c017d53a90477871f0ad4b6ef15250cc5e5b..fa8f80e024c40f4c2676a86971b790ee47484973 100644 (file)
@@ -1214,3 +1214,9 @@ def getslice(self, start=0, end=None):
             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)