diff options
author | Jakub Brož <broz@oksystem.cz> | 2015-09-13 08:53:26 +0200 |
---|---|---|
committer | Jakub Brož <broz@oksystem.cz> | 2015-09-13 08:56:39 +0200 |
commit | 6e6d464f35609828a14dcc09e4045b56686eb90c (patch) | |
tree | e58a5d6f6c1425c5e77eb9c4d404e6163a94546b /module/plugins/internal/Plugin.py | |
parent | [UlozTo] Hoster update (diff) | |
download | pyload-6e6d464f35609828a14dcc09e4045b56686eb90c.tar.xz |
Remove accents from file name #1817
issue: #1817
Diffstat (limited to 'module/plugins/internal/Plugin.py')
-rw-r--r-- | module/plugins/internal/Plugin.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index b0c0bb66e..fd8712b44 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -7,6 +7,7 @@ import inspect import os import re import urllib +import unicodedata if os.name != "nt": import grp @@ -51,6 +52,15 @@ def fixurl(url): return html_unescape(urllib.unquote(url.decode('unicode-escape'))).strip().rstrip('/') +def fixname(m): + m = unicodedata.normalize('NFKD', m) + output = '' + for c in m: + if not unicodedata.combining(c): + output += c + return output + + #@TODO: Move to utils in 0.4.10 def timestamp(): return int(time.time() * 1000) |