aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-05-04 21:53:05 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-05-04 21:55:04 +0800
commit0fe2ff78e68ec03d56bf3d9434eb612ffb683977 (patch)
tree4c30fd7db4745184c45cadc0059423215937cbed /youtube_dl/utils.py
parentdc1eed93be7ac2afb3f52237ae0034d24715b4bd (diff)
[NBC] Enhance embedURL extraction (closes #2549)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index a5a5c317e..1013f7c18 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1486,6 +1486,14 @@ def uppercase_escape(s):
s)
+def lowercase_escape(s):
+ unicode_escape = codecs.getdecoder('unicode_escape')
+ return re.sub(
+ r'\\u[0-9a-fA-F]{4}',
+ lambda m: unicode_escape(m.group(0))[0],
+ s)
+
+
def escape_rfc3986(s):
"""Escape non-ASCII characters as suggested by RFC 3986"""
if sys.version_info < (3, 0) and isinstance(s, compat_str):