diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-11-16 00:15:58 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-11-16 00:15:58 +0100 |
commit | 6b5445c40996b8803da43ae95bc1ab2b5f4c0a46 (patch) | |
tree | d8ccaf123d56bb11fc1d67cb224aaa8d7298e67b /pyload/plugins | |
parent | [ConfigParser] getPlugin return str (diff) | |
download | pyload-6b5445c40996b8803da43ae95bc1ab2b5f4c0a46.tar.xz |
Spare code cosmetics
Diffstat (limited to 'pyload/plugins')
-rw-r--r-- | pyload/plugins/Plugin.py | 2 | ||||
-rw-r--r-- | pyload/plugins/internal/Crypter.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/pyload/plugins/Plugin.py b/pyload/plugins/Plugin.py index a3ef1d46b..c28b3cd87 100644 --- a/pyload/plugins/Plugin.py +++ b/pyload/plugins/Plugin.py @@ -685,7 +685,7 @@ class Plugin(Base): #produces encoding errors, better log to other file in the future? #self.logDebug("Content: %s" % content) for name, rule in rules.iteritems(): - if type(rule) in (str, unicode): + if isinstance(rule, basestring): if rule in content: if delete: remove(lastDownload) diff --git a/pyload/plugins/internal/Crypter.py b/pyload/plugins/internal/Crypter.py index 4fae07ff1..2bd9328c0 100644 --- a/pyload/plugins/internal/Crypter.py +++ b/pyload/plugins/internal/Crypter.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- +from urlparse import urlparse + from pyload.plugins.Plugin import Plugin -from pyload.utils import save_filename +from pyload.utils import html_unescape, save_filename class Crypter(Plugin): @@ -96,9 +98,7 @@ class Crypter(Plugin): elif not folder_per_package or name != folder: if not folder: - folder = name.replace("http://", "").replace(":", "").replace("/", "_").replace("\\", "_") - - folder = save_filename(folder) #@TODO: move to core code + folder = urlparse(html_unescape(name)).path.split("/")[-1] setFolder(folder) self.logDebug("Set package %(name)s folder to: %(folder)s" % {"name": name, "folder": folder}) |