aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2012-11-27 23:56:10 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2012-11-27 23:56:10 +0100
commit89fb51dd2d4d7464b919f17b9d5d24a448319dfc (patch)
tree17f9771c8cc90f3d3e1c4214098e35b3f0157a2b
parent01ba00ca42899436c13439226ec61651a6ea6af0 (diff)
downloadyoutube-dl-89fb51dd2d4d7464b919f17b9d5d24a448319dfc.tar.xz
Remove ur references for Python 3.3 support
-rw-r--r--youtube_dl/FileDownloader.py2
-rw-r--r--youtube_dl/utils.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py
index 89beaf453..868023db9 100644
--- a/youtube_dl/FileDownloader.py
+++ b/youtube_dl/FileDownloader.py
@@ -201,7 +201,7 @@ class FileDownloader(object):
def fixed_template(self):
"""Checks if the output template is fixed."""
- return (re.search(ur'(?u)%\(.+?\)s', self.params['outtmpl']) is None)
+ return (re.search(u'(?u)%\\(.+?\\)s', self.params['outtmpl']) is None)
def trouble(self, message=None):
"""Determine action to take when a download problem appears.
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 12e32be98..ccefc66a0 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -77,7 +77,7 @@ def htmlentity_transform(matchobj):
if entity in htmlentitydefs.name2codepoint:
return unichr(htmlentitydefs.name2codepoint[entity])
- mobj = re.match(ur'(?u)#(x?\d+)', entity)
+ mobj = re.match(u'(?u)#(x?\\d+)', entity)
if mobj is not None:
numstr = mobj.group(1)
if numstr.startswith(u'x'):
@@ -198,7 +198,7 @@ def sanitize_open(filename, open_mode):
return (stream, filename)
except (IOError, OSError) as err:
# In case of error, try to remove win32 forbidden chars
- filename = re.sub(ur'[/<>:"\|\?\*]', u'#', filename)
+ filename = re.sub(u'[/<>:"\\|\\\\?\\*]', u'#', filename)
# An exception here should be caught in the caller
stream = open(encodeFilename(filename), open_mode)
@@ -257,7 +257,7 @@ def unescapeHTML(s):
"""
assert type(s) == type(u'')
- result = re.sub(ur'(?u)&(.+?);', htmlentity_transform, s)
+ result = re.sub(u'(?u)&(.+?);', htmlentity_transform, s)
return result
def encodeFilename(s):