summaryrefslogtreecommitdiffstats
path: root/module/plugins/Crypter.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-03 12:09:04 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-03 12:09:04 +0100
commit8e921a978e79d93da3036ce3bdc1fb176c74fabb (patch)
tree4f85e170c25e1c482fbfd7ccc59cae0f7d68aaca /module/plugins/Crypter.py
parent[CaptchaManager] Custom timeout support (diff)
downloadpyload-8e921a978e79d93da3036ce3bdc1fb176c74fabb.tar.xz
Spare code cosmetics
Diffstat (limited to 'module/plugins/Crypter.py')
-rw-r--r--module/plugins/Crypter.py12
1 files changed, 8 insertions, 4 deletions
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})