summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/Checksum.py10
-rw-r--r--module/plugins/hooks/ExternalScripts.py9
-rw-r--r--module/plugins/hooks/LinkdecrypterComHook.py1
3 files changed, 12 insertions, 8 deletions
diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py
index 6ecbfcda2..da4d35df1 100644
--- a/module/plugins/hooks/Checksum.py
+++ b/module/plugins/hooks/Checksum.py
@@ -38,7 +38,7 @@ def compute_checksum(local_file, algorithm):
class Checksum(Addon):
__name__ = "Checksum"
__type__ = "hook"
- __version__ = "0.19"
+ __version__ = "0.20"
__status__ = "testing"
__config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ),
@@ -131,15 +131,15 @@ class Checksum(Addon):
for key in self.algorithms:
if key in data:
- checksum = computeChecksum(local_file, key.replace("-", "").lower())
+ checksum = compute_checksum(local_file, key.replace("-", "").lower())
if checksum:
- if checksum is data[key].lower():
+ if checksum == data[key].lower():
self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') %
(pyfile.name, key.upper(), checksum))
break
else:
self.log_warning(_("%s checksum for file %s does not match (%s != %s)") %
- (key.upper(), pyfile.name, checksum, data[key]))
+ (key.upper(), pyfile.name, checksum, data[key].lower()))
self.check_failed(pyfile, local_file, "Checksums do not match")
else:
self.log_warning(_("Unsupported hashing algorithm"), key.upper())
@@ -186,7 +186,7 @@ class Checksum(Addon):
local_file = fs_encode(fs_join(download_folder, data['NAME']))
algorithm = self.methods.get(file_type, file_type)
- checksum = computeChecksum(local_file, algorithm)
+ checksum = compute_checksum(local_file, algorithm)
if checksum is data['HASH']:
self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') %
(data['NAME'], algorithm, checksum))
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py
index b7495136a..9ad2ac1fa 100644
--- a/module/plugins/hooks/ExternalScripts.py
+++ b/module/plugins/hooks/ExternalScripts.py
@@ -3,6 +3,7 @@
import os
import subprocess
+from module.plugins.internal.Plugin import encode
from module.plugins.internal.Addon import Addon, Expose
from module.utils import fs_encode, save_join as fs_join
@@ -10,7 +11,7 @@ from module.utils import fs_encode, save_join as fs_join
class ExternalScripts(Addon):
__name__ = "ExternalScripts"
__type__ = "hook"
- __version__ = "0.46"
+ __version__ = "0.47"
__status__ = "testing"
__config__ = [("activated", "bool", "Activated" , True ),
@@ -66,7 +67,8 @@ class ExternalScripts(Addon):
self.log_debug(e)
return
- for file in os.listdir(path):
+ for filename in os.listdir(path):
+ file = fs_join(path, filename)
if not os.path.isfile(file):
continue
@@ -77,13 +79,14 @@ class ExternalScripts(Addon):
self.log_warning(_("Script not executable: [%s] %s") % (name, file))
self.scripts[name].append(file)
+ self.log_info(_("Registered script: [%s] %s") % (name, file))
@Expose
def call(self, script, args=[], lock=False):
try:
script = os.path.abspath(script)
- args = [script] + map(encode, args)
+ args = [script] + map(lambda arg: encode(arg) if isinstance(arg, basestring) else encode(str(arg)), args)
self.log_info(_("EXECUTE [%s] %s") % (os.path.dirname(script), args))
p = subprocess.Popen(args, bufsize=-1) #@NOTE: output goes to pyload
diff --git a/module/plugins/hooks/LinkdecrypterComHook.py b/module/plugins/hooks/LinkdecrypterComHook.py
index 6930afdb5..bf437fb6d 100644
--- a/module/plugins/hooks/LinkdecrypterComHook.py
+++ b/module/plugins/hooks/LinkdecrypterComHook.py
@@ -21,6 +21,7 @@ class LinkdecrypterComHook(MultiHook):
__license__ = "GPLv3"
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
+ COOKIES = False
def get_hosters(self):
list = re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.\-, ]+)',