diff options
author | Art Zhitnik <art.zhitnik@gmail.com> | 2012-11-01 23:06:46 +1000 |
---|---|---|
committer | Art Zhitnik <art.zhitnik@gmail.com> | 2012-11-11 14:09:12 +1000 |
commit | 39973a023687e9492e3ecde64f4d1c48b098319d (patch) | |
tree | 4c111790ef891b58b1e5b7e356ca59764ff8cbd3 | |
parent | b7a34316d20d6eee3d44a7c3294cf01592e07388 (diff) |
Solve the bug of parsing titles with unicode (cyrillic)
-rw-r--r-- | youtube_dl/FileDownloader.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index ed5a79f13..4449fe711 100644 --- 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) - 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) - 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): |