summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-20 01:36:15 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-20 01:36:15 +0200
commit65ecd70df23ffecfbb84c11807edfd284360a5f9 (patch)
tree08701a8d2e2939b08e6eed601cbed9bfcb2069ea /module/plugins
parentMerge pull request #2074 from GammaC0de/patch-6 (diff)
downloadpyload-65ecd70df23ffecfbb84c11807edfd284360a5f9.tar.xz
Spare fixes (2)
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hooks/ExternalScripts.py14
-rw-r--r--module/plugins/internal/Extractor.py4
-rw-r--r--module/plugins/internal/Hoster.py4
-rw-r--r--module/plugins/internal/MultiHoster.py4
-rw-r--r--module/plugins/internal/UnZip.py4
-rw-r--r--module/plugins/internal/utils.py4
6 files changed, 18 insertions, 16 deletions
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py
index 9fd22e0af..04ea5e135 100644
--- a/module/plugins/hooks/ExternalScripts.py
+++ b/module/plugins/hooks/ExternalScripts.py
@@ -10,7 +10,7 @@ from module.plugins.internal.utils import encode, fs_join
class ExternalScripts(Addon):
__name__ = "ExternalScripts"
__type__ = "hook"
- __version__ = "0.52"
+ __version__ = "0.53"
__status__ = "testing"
__config__ = [("activated", "bool", "Activated" , True ),
@@ -114,11 +114,13 @@ class ExternalScripts(Addon):
def before_reconnect(self, ip):
- self._call("before_reconnect", [ip])
+ args = [ip]
+ self._call("before_reconnect", args)
def after_reconnect(self, ip, oldip):
- self._call("after_reconnect", [ip, oldip])
+ args = [ip, oldip]
+ self._call("after_reconnect", args)
def download_preparing(self, pyfile):
@@ -169,14 +171,14 @@ class ExternalScripts(Addon):
def package_deleted(self, pid):
- pack = self.pyload.api.getPackageInfo(pid)
+ pypack = self.pyload.api.getPackageInfo(pid)
if self.pyload.config.get("general", "folder_per_package"):
- dl_folder = fs_join(self.pyload.config.get("general", "download_folder"), pack.folder)
+ dl_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder)
else:
dl_folder = self.pyload.config.get("general", "download_folder")
- args = [pypack.id, pack.name, dl_folder, pack.password]
+ args = [pypack.id, pypack.name, dl_folder, pypack.password]
self._call("package_deleted", args)
diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py
index 864792e49..95395dd1f 100644
--- a/module/plugins/internal/Extractor.py
+++ b/module/plugins/internal/Extractor.py
@@ -36,7 +36,7 @@ class PasswordError(Exception):
class Extractor(Plugin):
__name__ = "Extractor"
__type__ = "extractor"
- __version__ = "0.37"
+ __version__ = "0.38"
__status__ = "testing"
__description__ = """Base extractor plugin"""
@@ -76,7 +76,7 @@ class Extractor(Plugin):
for fname, id, fout in files_ids:
if cls.isarchive(fname):
- pname = re.sub(cls.re_multipart, "", fname) if cls.is_multipart(fname) else os.path.splitext(fname)[0]
+ pname = re.sub(cls.re_multipart, "", fname) if cls.ismultipart(fname) else os.path.splitext(fname)[0]
if pname not in processed:
processed.append(pname)
targets.append((fname, id, fout))
diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py
index 8f76b6c45..60a7e7779 100644
--- a/module/plugins/internal/Hoster.py
+++ b/module/plugins/internal/Hoster.py
@@ -13,7 +13,7 @@ from module.plugins.internal.utils import encode, exists, fixurl, fs_join, parse
class Hoster(Base):
__name__ = "Hoster"
__type__ = "hoster"
- __version__ = "0.40"
+ __version__ = "0.41"
__status__ = "testing"
__pattern__ = r'^unmatchable$'
@@ -98,7 +98,7 @@ class Hoster(Base):
self.restart(premium=False)
else:
- raise Fail(str(e))
+ raise Fail(encode(e))
def isdownload(self, url, resume=None, redirect=True):
diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py
index 6fa28d82d..1f87359ac 100644
--- a/module/plugins/internal/MultiHoster.py
+++ b/module/plugins/internal/MultiHoster.py
@@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, r
class MultiHoster(SimpleHoster):
__name__ = "MultiHoster"
__type__ = "hoster"
- __version__ = "0.55"
+ __version__ = "0.56"
__status__ = "testing"
__pattern__ = r'^unmatchable$'
@@ -86,7 +86,7 @@ class MultiHoster(SimpleHoster):
self.restart(_("Revert to original hoster plugin"))
else:
- raise Fail(str(e))
+ raise Fail(encode(e))
def handle_premium(self, pyfile):
diff --git a/module/plugins/internal/UnZip.py b/module/plugins/internal/UnZip.py
index c14742efa..0b9115bc8 100644
--- a/module/plugins/internal/UnZip.py
+++ b/module/plugins/internal/UnZip.py
@@ -11,7 +11,7 @@ from module.plugins.internal.Extractor import Extractor, ArchiveError, CRCError,
class UnZip(Extractor):
__name__ = "UnZip"
- __version__ = "1.18"
+ __version__ = "1.19"
__status__ = "testing"
__description__ = """Zip extractor plugin"""
@@ -29,7 +29,7 @@ class UnZip(Extractor):
@classmethod
- def is_multipart(cls, filename):
+ def ismultipart(cls, filename):
return False #@NOTE: Unsupported (rarely used anyway)
diff --git a/module/plugins/internal/utils.py b/module/plugins/internal/utils.py
index 3a3ada07d..5d73f432b 100644
--- a/module/plugins/internal/utils.py
+++ b/module/plugins/internal/utils.py
@@ -162,8 +162,8 @@ def encode(value, encoding=None, decoding=None):
if type(value) is unicode:
res = value.encode(encoding or "utf-8")
- #elif type(value) is str:
- #res = encode(decode(value, decoding), encoding)
+ # elif type(value) is str:
+ # res = encode(decode(value, decoding), encoding)
else:
res = str(value)