diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-11-03 12:09:04 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-11-03 12:09:04 +0100 |
commit | 8e921a978e79d93da3036ce3bdc1fb176c74fabb (patch) | |
tree | 4f85e170c25e1c482fbfd7ccc59cae0f7d68aaca /module | |
parent | [CaptchaManager] Custom timeout support (diff) | |
download | pyload-8e921a978e79d93da3036ce3bdc1fb176c74fabb.tar.xz |
Spare code cosmetics
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/Account.py | 2 | ||||
-rw-r--r-- | module/plugins/Container.py | 2 | ||||
-rw-r--r-- | module/plugins/Crypter.py | 12 | ||||
-rw-r--r-- | module/plugins/Hook.py | 2 | ||||
-rw-r--r-- | module/plugins/Hoster.py | 5 | ||||
-rw-r--r-- | module/plugins/internal/MultiHoster.py | 15 |
6 files changed, 23 insertions, 15 deletions
diff --git a/module/plugins/Account.py b/module/plugins/Account.py index d0736476d..2f7c5d30d 100644 --- a/module/plugins/Account.py +++ b/module/plugins/Account.py @@ -21,7 +21,7 @@ class Account(Base): """ __name__ = "Account" __type__ = "account" - __version__ = "0.3" + __version__ = "0.03" __description__ = """Base account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/Container.py b/module/plugins/Container.py index 0e8b20a86..16d0045a6 100644 --- a/module/plugins/Container.py +++ b/module/plugins/Container.py @@ -12,7 +12,7 @@ from module.utils import save_join class Container(Crypter): __name__ = "Container" __type__ = "container" - __version__ = "0.1" + __version__ = "0.01" __pattern__ = None __config__ = [] #: [("name", "type", "desc", "default")] diff --git a/module/plugins/Crypter.py b/module/plugins/Crypter.py index e7148e11f..b62d0beb9 100644 --- a/module/plugins/Crypter.py +++ b/module/plugins/Crypter.py @@ -7,7 +7,7 @@ from module.utils import save_path class Crypter(Plugin): __name__ = "Crypter" __type__ = "crypter" - __version__ = "0.4" + __version__ = "0.05" __pattern__ = None __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), #: Overrides core.config['general']['folder_per_package'] @@ -18,6 +18,9 @@ class Crypter(Plugin): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + html = None + + def __init__(self, pyfile): #: Put all packages here. It's a list of tuples like: ( name, [list of links], folder ) self.packages = [] @@ -35,6 +38,7 @@ class Crypter(Plugin): if self.urls: self.generatePackages() + elif not self.packages: self.error(_("No link extracted"), "decrypt") @@ -72,7 +76,7 @@ class Crypter(Plugin): for pack in self.packages: name, links, folder = pack - self.logDebug("Parsed package: " + name, + self.logDebug("Parsed package: %s" % name, "%d links" % len(links), "Saved to folder: %s" % folder if folder else "Saved to download folder") @@ -83,7 +87,7 @@ class Crypter(Plugin): if package_password: self.core.api.setPackageData(pid, {"password": package_password}) - setFolder = lambda x: self.core.api.setPackageData(pid, {"folder": x or ""}) #: Workaround to not break API addPackage method + setFolder = lambda x: self.core.api.setPackageData(pid, {"folder": x or ""}) #: Workaround to do not break API addPackage method if use_subfolder: if not subfolder_per_package: @@ -94,7 +98,7 @@ class Crypter(Plugin): if not folder: folder = name.replace("http://", "").replace(":", "").replace("/", "_").replace("\\", "_") - folder = save_path(folder) #@TODO: move to deep code checks + folder = save_path(folder) #@TODO: move to core code setFolder(folder) self.logDebug("Set package %(name)s folder to: %(folder)s" % {"name": name, "folder": folder}) diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py index ede084c3a..18b54d8c0 100644 --- a/module/plugins/Hook.py +++ b/module/plugins/Hook.py @@ -26,7 +26,7 @@ class Hook(Base): """ __name__ = "Hook" __type__ = "hook" - __version__ = "0.2" + __version__ = "0.02" __config__ = [] #: [("name", "type", "desc", "default")] diff --git a/module/plugins/Hoster.py b/module/plugins/Hoster.py index 0768391e5..22e8dbfcb 100644 --- a/module/plugins/Hoster.py +++ b/module/plugins/Hoster.py @@ -11,7 +11,7 @@ def getInfo(self): class Hoster(Plugin): __name__ = "Hoster" __type__ = "hoster" - __version__ = "0.1" + __version__ = "0.02" __pattern__ = None __config__ = [] #: [("name", "type", "desc", "default")] @@ -19,3 +19,6 @@ class Hoster(Plugin): __description__ = """Base hoster plugin""" __license__ = "GPLv3" __authors__ = [("mkaay", "mkaay@mkaay.de")] + + + html = None diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py index 3596641b0..24942f8a3 100644 --- a/module/plugins/internal/MultiHoster.py +++ b/module/plugins/internal/MultiHoster.py @@ -16,13 +16,14 @@ class MultiHoster(Hook): __authors__ = [("pyLoad Team", "admin@pyload.org")] - replacements = [("2shared.com", "twoshared.com"), ("4shared.com", "fourshared.com"), ("cloudnator.com", "shragle.com"), - ("ifile.it", "filecloud.io"), ("easy-share.com", "crocko.com"), ("freakshare.net", "freakshare.com"), - ("hellshare.com", "hellshare.cz"), ("share-rapid.cz", "sharerapid.com"), ("sharerapid.cz", "sharerapid.com"), - ("ul.to", "uploaded.to"), ("uploaded.net", "uploaded.to"), ("1fichier.com", "onefichier.com")] - ignored = [] interval = 24 * 60 * 60 #: reload hosters daily + HOSTER_REPLACEMENTS = [("2shared.com", "twoshared.com"), ("4shared.com", "fourshared.com"), ("cloudnator.com", "shragle.com"), + ("ifile.it", "filecloud.io"), ("easy-share.com", "crocko.com"), ("freakshare.net", "freakshare.com"), + ("hellshare.com", "hellshare.cz"), ("share-rapid.cz", "sharerapid.com"), ("sharerapid.cz", "sharerapid.com"), + ("ul.to", "uploaded.to"), ("uploaded.net", "uploaded.to"), ("1fichier.com", "onefichier.com")] + HOSTER_EXCLUDED = [] + def setup(self): self.hosters = [] @@ -42,7 +43,7 @@ class MultiHoster(Hook): if not self.hosters: try: - hosterSet = self.toHosterSet(self.getHoster()) - set(self.ignored) + hosterSet = self.toHosterSet(self.getHoster()) - set(self.HOSTER_EXCLUDED) except Exception, e: self.logError(e) return [] @@ -68,7 +69,7 @@ class MultiHoster(Hook): def toHosterSet(self, hosters): hosters = set((str(x).strip().lower() for x in hosters)) - for rep in self.replacements: + for rep in self.HOSTER_REPLACEMENTS: if rep[0] in hosters: hosters.remove(rep[0]) hosters.add(rep[1]) |