projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b7a3431
)
Solve the bug of parsing titles with unicode (cyrillic)
author
Art Zhitnik
<art.zhitnik@gmail.com>
Thu, 1 Nov 2012 13:06:46 +0000
(23:06 +1000)
committer
Art Zhitnik
<art.zhitnik@gmail.com>
Sun, 11 Nov 2012 04:09:12 +0000
(14:09 +1000)
youtube_dl/FileDownloader.py
patch
|
blob
|
history
diff --git
a/youtube_dl/FileDownloader.py
b/youtube_dl/FileDownloader.py
index ed5a79f13d1b12d45c03f4f676282adf41d51714..4449fe711f28fbcfc427b5b23719d3e5cbdf045c 100644
(file)
--- a/
youtube_dl/FileDownloader.py
+++ b/
youtube_dl/FileDownloader.py
@@
-333,11
+333,15
@@
class FileDownloader(object):
title = info_dict['title']
matchtitle = self.params.get('matchtitle', False)
title = info_dict['title']
matchtitle = self.params.get('matchtitle', False)
- if matchtitle and not re.search(matchtitle, title, re.IGNORECASE):
- return u'[download] "' + title + '" title did not match pattern "' + matchtitle + '"'
+ if matchtitle:
+ matchtitle = matchtitle.decode('utf8')
+ if not re.search(matchtitle, title, re.IGNORECASE):
+ return u'[download] "' + title + '" title did not match pattern "' + matchtitle + '"'
rejecttitle = self.params.get('rejecttitle', False)
rejecttitle = self.params.get('rejecttitle', False)
- if rejecttitle and re.search(rejecttitle, title, re.IGNORECASE):
- return u'"' + title + '" title matched reject pattern "' + rejecttitle + '"'
+ if rejecttitle:
+ rejecttitle = rejecttitle.decode('utf8')
+ if re.search(rejecttitle, title, re.IGNORECASE):
+ return u'"' + title + '" title matched reject pattern "' + rejecttitle + '"'
return None
def process_info(self, info_dict):
return None
def process_info(self, info_dict):