From 2d2e8914fa17d4de87bd18f60d416461ba9fa4f7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 1 Jun 2015 19:47:18 +0200 Subject: [XFSHoster] Improve OFFLINE_PATTERN --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 92d89dc01..62872992c 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -31,11 +31,11 @@ class XFileSharingPro(Hook): HOSTER_BUILTIN = [#WORKING HOSTERS: "backin.net", "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "fileparadox.in", "filevice.com", "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", "ryushare.com", - "salefiles.com", "sendmyway.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + "salefiles.com", "sendmyway.com", "sharesix.com", "thefile.me", "verzend.be", "worldbytez.com", "xvidstage.com", #NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", - "vidbull.com", "worldbytez.com", "zalaa.com", "zomgupload.com", + "vidbull.com", "zalaa.com", "zomgupload.com", #NOT WORKING: "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] CRYPTER_BUILTIN = ["junocloud.me", "rapidfileshare.net"] -- cgit v1.2.3 From 74be49e90e044ee25c5e7f2898e65d2026c99862 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 2 Jun 2015 05:46:41 +0200 Subject: [UserAgentSwitcher] Update --- module/plugins/hooks/UserAgentSwitcher.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py index 5f9fd5212..74c43f7c4 100644 --- a/module/plugins/hooks/UserAgentSwitcher.py +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -8,10 +8,12 @@ from module.plugins.Hook import Hook class UserAgentSwitcher(Hook): __name__ = "UserAgentSwitcher" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" - __config__ = [("activated", "bool", "Activated" , True ), - ("useragent", "str" , "Custom user-agent string" , "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0")] + __config__ = [("activated" , "bool", "Activated" , True ), + ("connecttimeout", "int" , "Connection timeout in seconds" , 60 ), + ("maxredirs" , "int" , "Maximum number of redirects to follow" , 10 ), + ("useragent" , "str" , "Custom user-agent string" , "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0")] __description__ = """Custom user-agent""" __license__ = "GPLv3" @@ -26,7 +28,16 @@ class UserAgentSwitcher(Hook): def downloadPreparing(self, pyfile): - useragent = self.getConfig('useragent').encode("utf8", "replace") #@TODO: Remove `encode` in 0.4.10 + connecttimeout = self.getConfig('connecttimeout') + maxredirs = self.getConfig('maxredirs') + useragent = self.getConfig('useragent').encode("utf8", "replace") #@TODO: Remove `encode` in 0.4.10 + + if connecttimeout: + pyfile.plugin.req.http.c.setopt(pycurl.CONNECTTIMEOUT, connecttimeout) + + if maxredirs: + pyfile.plugin.req.http.c.setopt(pycurl.MAXREDIRS, maxredirs) + if useragent: self.logDebug("Use custom user-agent string: " + useragent) pyfile.plugin.req.http.c.setopt(pycurl.USERAGENT, useragent) -- cgit v1.2.3 From 5685fdfcdc98de4e22711694a461e3fdd1c33885 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 5 Jun 2015 15:27:39 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1450 --- module/plugins/hooks/PremiumizeMeHook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py index e081fb389..f13520323 100644 --- a/module/plugins/hooks/PremiumizeMeHook.py +++ b/module/plugins/hooks/PremiumizeMeHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class PremiumizeMeHook(MultiHook): __name__ = "PremiumizeMeHook" __type__ = "hook" - __version__ = "0.17" + __version__ = "0.18" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), @@ -26,7 +26,7 @@ class PremiumizeMeHook(MultiHook): # Get supported hosters list from premiumize.me using the # json API v1 (see https://secure.premiumize.me/?show=api) - answer = self.getURL("https://api.premiumize.me/pm-api/v1.php", + answer = self.getURL("http://api.premiumize.me/pm-api/v1.php", get={'method': "hosterlist", 'params[login]': user, 'params[pass]': data['password']}) data = json_loads(answer) -- cgit v1.2.3 From b9a16ec6d3ea9711e0d7e349cc0c32a79ffbc62a Mon Sep 17 00:00:00 2001 From: EvolutionClip Date: Fri, 5 Jun 2015 22:49:33 +0200 Subject: Create HighWayMe.py --- module/plugins/hooks/HighWayMe.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 module/plugins/hooks/HighWayMe.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/HighWayMe.py b/module/plugins/hooks/HighWayMe.py new file mode 100644 index 000000000..2a1ff2991 --- /dev/null +++ b/module/plugins/hooks/HighWayMe.py @@ -0,0 +1,29 @@ ++# -*- coding: utf-8 -*- ++ ++from module.common.json_layer import json_loads ++from module.plugins.internal.MultiHook import MultiHook ++ ++ ++class HighWayMeHook(MultiHook): ++ __name__ = "HighWayMeHook" ++ __type__ = "hook" ++ __version__ = "0.01" ++ ++ __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ++ ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), ++ ("revertfailed" , "bool" , "Revert to standard download if fails", True ), ++ ("reload" , "bool" , "Reload plugin list" , True ), ++ ("reloadinterval", "int" , "Reload interval in hours" , 12 )] ++ ++ __description__ = """High-Way.Me hook plugin""" ++ __license__ = "GPLv3" ++ __authors__ = [("EvolutionClip", "evolutionclip@live.de")] ++ ++ ++ def getHosters(self): ++ json_data = self.getURL("https://high-way.me/api.php", get={'hoster': 1}) ++ json_data = json_loads(json_data) ++ ++ host_list = [element['name'] for element in json_data['hoster']] ++ ++ return host_list -- cgit v1.2.3 From b81d202ab0eeb692a85ee4dda946810fb9886f59 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 6 Jun 2015 03:33:26 +0200 Subject: [HighWayMe] Cleanup --- module/plugins/hooks/HighWayMe.py | 55 ++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 29 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/HighWayMe.py b/module/plugins/hooks/HighWayMe.py index 2a1ff2991..7d5c88ecc 100644 --- a/module/plugins/hooks/HighWayMe.py +++ b/module/plugins/hooks/HighWayMe.py @@ -1,29 +1,26 @@ -+# -*- coding: utf-8 -*- -+ -+from module.common.json_layer import json_loads -+from module.plugins.internal.MultiHook import MultiHook -+ -+ -+class HighWayMeHook(MultiHook): -+ __name__ = "HighWayMeHook" -+ __type__ = "hook" -+ __version__ = "0.01" -+ -+ __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), -+ ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), -+ ("revertfailed" , "bool" , "Revert to standard download if fails", True ), -+ ("reload" , "bool" , "Reload plugin list" , True ), -+ ("reloadinterval", "int" , "Reload interval in hours" , 12 )] -+ -+ __description__ = """High-Way.Me hook plugin""" -+ __license__ = "GPLv3" -+ __authors__ = [("EvolutionClip", "evolutionclip@live.de")] -+ -+ -+ def getHosters(self): -+ json_data = self.getURL("https://high-way.me/api.php", get={'hoster': 1}) -+ json_data = json_loads(json_data) -+ -+ host_list = [element['name'] for element in json_data['hoster']] -+ -+ return host_list +# -*- coding: utf-8 -*- + +from module.common.json_layer import json_loads +from module.plugins.internal.MultiHook import MultiHook + + +class HighWayMeHook(MultiHook): + __name__ = "HighWayMeHook" + __type__ = "hook" + __version__ = "0.02" + + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + + __description__ = """High-Way.me hook plugin""" + __license__ = "GPLv3" + __authors__ = [("EvolutionClip", "evolutionclip@live.de")] + + + def getHosters(self): + json_data = json_loads(self.getURL("https://high-way.me/api.php", + get={'hoster': 1})) + return [element['name'] for element in json_data['hoster']] -- cgit v1.2.3 From 6283481a29e49776703ce6688b3e4fcb5dd11bf2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 04:02:12 +0200 Subject: [FreeWayMe] Fixup --- module/plugins/hooks/FreeWayMeHook.py | 13 +++---------- module/plugins/hooks/PremiumizeMeHook.py | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/FreeWayMeHook.py b/module/plugins/hooks/FreeWayMeHook.py index baea44540..b4219a953 100644 --- a/module/plugins/hooks/FreeWayMeHook.py +++ b/module/plugins/hooks/FreeWayMeHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class FreeWayMeHook(MultiHook): __name__ = "FreeWayMeHook" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), @@ -20,13 +20,6 @@ class FreeWayMeHook(MultiHook): def getHosters(self): - # Get account data - if not self.account or not self.account.canUse(): - hostis = self.getURL("https://www.free-way.me/ajax/jd.php", get={"id": 3}).replace("\"", "").strip() - else: - self.logDebug("AccountInfo available - Get HosterList with User Pass") - (user, data) = self.account.selectAccount() - hostis = self.getURL("https://www.free-way.me/ajax/jd.php", get={"id": 3, "user": user, "pass": data['password']}).replace("\"", "").strip() - - self.logDebug("hosters: %s" % hostis) + user, data = self.account.selectAccount() + hostis = self.getURL("http://www.free-way.bz/ajax/jd.php", get={"id": 3, "user": user, "pass": data['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10 return [x.strip() for x in hostis.split(",") if x.strip()] diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py index f13520323..35ad70970 100644 --- a/module/plugins/hooks/PremiumizeMeHook.py +++ b/module/plugins/hooks/PremiumizeMeHook.py @@ -26,7 +26,7 @@ class PremiumizeMeHook(MultiHook): # Get supported hosters list from premiumize.me using the # json API v1 (see https://secure.premiumize.me/?show=api) - answer = self.getURL("http://api.premiumize.me/pm-api/v1.php", + answer = self.getURL("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10 get={'method': "hosterlist", 'params[login]': user, 'params[pass]': data['password']}) data = json_loads(answer) -- cgit v1.2.3 From 45b6242579ac65444fd278e5ecde96be29136bbe Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 05:49:47 +0200 Subject: New plugins: FiledropperCom & FileuploadNet --- module/plugins/hooks/XFileSharingPro.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 62872992c..485d4ce78 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -29,13 +29,16 @@ class XFileSharingPro(Hook): r'https?://(?:[^/]+\.)?(?P%s)/(?:user|folder)s?/\w+')} HOSTER_BUILTIN = [#WORKING HOSTERS: - "backin.net", "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "fileparadox.in", - "filevice.com", "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", "ryushare.com", - "salefiles.com", "sendmyway.com", "sharesix.com", "thefile.me", "verzend.be", "worldbytez.com", "xvidstage.com", + "backin.net", "eyesfile.ca", "file4safe.com", "fileband.com", + "filedwon.com", "fileparadox.in", "filevice.com", "hostingbulk.com", + "junkyvideo.com", "linestorage.com", "ravishare.com", "ryushare.com", + "salefiles.com", "sendmyway.com", "sharebeast.com", "sharesix.com", + "thefile.me", "verzend.be", "worldbytez.com", "xvidstage.com", #NOT TESTED: - "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", - "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", - "vidbull.com", "zalaa.com", "zomgupload.com", + "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", + "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharerepo.com", + "shareswift.com", "uploadbaz.com", "uploadc.com", "vidbull.com", + "zalaa.com", "zomgupload.com", #NOT WORKING: "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] CRYPTER_BUILTIN = ["junocloud.me", "rapidfileshare.net"] -- cgit v1.2.3 From 0e1ef9bc01579328e17e79416fa3c1c7b77adcc8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 06:08:01 +0200 Subject: Update everything --- module/plugins/hooks/AndroidPhoneNotify.py | 4 ++-- module/plugins/hooks/AntiVirus.py | 4 ++-- module/plugins/hooks/BypassCaptcha.py | 4 ++-- module/plugins/hooks/Captcha9Kw.py | 4 ++-- module/plugins/hooks/CaptchaBrotherhood.py | 4 ++-- module/plugins/hooks/Checksum.py | 4 ++-- module/plugins/hooks/ClickAndLoad.py | 4 ++-- module/plugins/hooks/DeathByCaptcha.py | 4 ++-- module/plugins/hooks/DeleteFinished.py | 4 ++-- module/plugins/hooks/DownloadScheduler.py | 4 ++-- module/plugins/hooks/ExpertDecoders.py | 4 ++-- module/plugins/hooks/ExternalScripts.py | 4 ++-- module/plugins/hooks/ExtractArchive.py | 4 ++-- module/plugins/hooks/HotFolder.py | 4 ++-- module/plugins/hooks/IRCInterface.py | 4 ++-- module/plugins/hooks/ImageTyperz.py | 4 ++-- module/plugins/hooks/JustPremium.py | 4 ++-- module/plugins/hooks/MergeFiles.py | 4 ++-- module/plugins/hooks/MultiHome.py | 4 ++-- module/plugins/hooks/RestartFailed.py | 4 ++-- module/plugins/hooks/SkipRev.py | 6 +++--- module/plugins/hooks/UnSkipOnFail.py | 4 ++-- module/plugins/hooks/UpdateManager.py | 4 ++-- module/plugins/hooks/UserAgentSwitcher.py | 4 ++-- module/plugins/hooks/WindowsPhoneNotify.py | 4 ++-- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 26 files changed, 53 insertions(+), 53 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index a8a1cff72..f987a890b 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -3,13 +3,13 @@ import time from module.network.RequestFactory import getURL -from module.plugins.Hook import Hook, Expose +from module.plugins.internal.Hook import Hook, Expose class AndroidPhoneNotify(Hook): __name__ = "AndroidPhoneNotify" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" __config__ = [("apikey" , "str" , "API key" , "" ), ("notifycaptcha" , "bool", "Notify captcha request" , True ), diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index c620f556d..0b5eb1410 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -9,14 +9,14 @@ try: except ImportError: pass -from module.plugins.Hook import Hook, Expose, threaded +from module.plugins.internal.Hook import Hook, Expose, threaded from module.utils import fs_encode, save_join class AntiVirus(Hook): __name__ = "AntiVirus" __type__ = "hook" - __version__ = "0.09" + __version__ = "0.10" #@TODO: add trash option (use Send2Trash lib) __config__ = [("action" , "Antivirus default;Delete;Quarantine", "Manage infected files" , "Antivirus default"), diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 9e01edfa2..e2abf617c 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -4,7 +4,7 @@ import pycurl from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getURL, getRequest -from module.plugins.Hook import Hook, threaded +from module.plugins.internal.Hook import Hook, threaded class BypassCaptchaException(Exception): @@ -28,7 +28,7 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __type__ = "hook" - __version__ = "0.06" + __version__ = "0.07" __config__ = [("force", "bool", "Force BC even if client is connected", False), ("passkey", "password", "Passkey", "")] diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 60482b8fc..7f37c225e 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -10,13 +10,13 @@ from base64 import b64encode from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getURL -from module.plugins.Hook import Hook, threaded +from module.plugins.internal.Hook import Hook, threaded class Captcha9Kw(Hook): __name__ = "Captcha9Kw" __type__ = "hook" - __version__ = "0.28" + __version__ = "0.29" __config__ = [("ssl" , "bool" , "Use HTTPS" , True ), ("force" , "bool" , "Force captcha resolving even if client is connected" , True ), diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index bda080037..6dbb67335 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -13,7 +13,7 @@ except ImportError: import Image from module.network.RequestFactory import getURL, getRequest -from module.plugins.Hook import Hook, threaded +from module.plugins.internal.Hook import Hook, threaded class CaptchaBrotherhoodException(Exception): @@ -37,7 +37,7 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" __config__ = [("username", "str", "Username", ""), ("force", "bool", "Force CT even if client is connected", False), diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index ab7daf701..13374f7bd 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -7,7 +7,7 @@ import os import re import zlib -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook from module.utils import save_join, fs_encode @@ -38,7 +38,7 @@ def computeChecksum(local_file, algorithm): class Checksum(Hook): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __config__ = [("check_checksum", "bool", "Check checksum? (If False only size will be verified)", True), ("check_action", "fail;retry;nothing", "What to do if check fails?", "retry"), diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index a7862045e..b910902c6 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -10,7 +10,7 @@ except ImportError: from threading import Lock -from module.plugins.Hook import Hook, threaded +from module.plugins.internal.Hook import Hook, threaded def forward(source, destination): @@ -29,7 +29,7 @@ def forward(source, destination): class ClickAndLoad(Hook): __name__ = "ClickAndLoad" __type__ = "hook" - __version__ = "0.43" + __version__ = "0.44" __config__ = [("activated", "bool", "Activated" , True), ("port" , "int" , "Port" , 9666), diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index f9618f011..63c2cd41d 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -11,7 +11,7 @@ from base64 import b64encode from module.common.json_layer import json_loads from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getRequest -from module.plugins.Hook import Hook, threaded +from module.plugins.internal.Hook import Hook, threaded class DeathByCaptchaException(Exception): @@ -51,7 +51,7 @@ class DeathByCaptchaException(Exception): class DeathByCaptcha(Hook): __name__ = "DeathByCaptcha" __type__ = "hook" - __version__ = "0.06" + __version__ = "0.07" __config__ = [("username", "str", "Username", ""), ("passkey", "password", "Password", ""), diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index be17c3c0f..5920b9a35 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.database import style -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook class DeleteFinished(Hook): __name__ = "DeleteFinished" __type__ = "hook" - __version__ = "1.12" + __version__ = "1.13" __config__ = [("interval" , "int" , "Check interval in hours" , 72 ), ("deloffline", "bool", "Delete package with offline links", False)] diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 9c74ac1d4..314e5913e 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -3,13 +3,13 @@ import re import time -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook class DownloadScheduler(Hook): __name__ = "DownloadScheduler" __type__ = "hook" - __version__ = "0.22" + __version__ = "0.23" __config__ = [("timetable", "str", "List time periods as hh:mm full or number(kB/s)", "0:00 full, 7:00 250, 10:00 0, 17:00 150"), diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index ccd48f664..105abca79 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -9,13 +9,13 @@ from base64 import b64encode from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getURL, getRequest -from module.plugins.Hook import Hook, threaded +from module.plugins.internal.Hook import Hook, threaded class ExpertDecoders(Hook): __name__ = "ExpertDecoders" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __config__ = [("force", "bool", "Force CT even if client is connected", False), ("passkey", "password", "Access key", "")] diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index a0815499b..a4f698f98 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -3,14 +3,14 @@ import os import subprocess -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook from module.utils import fs_encode, save_join class ExternalScripts(Hook): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.39" + __version__ = "0.40" __config__ = [("activated", "bool", "Activated" , True ), ("waitend" , "bool", "Wait script ending", False)] diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 3e371ec2b..67ebfc49c 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -53,7 +53,7 @@ if os.name != "nt": from grp import getgrnam from pwd import getpwnam -from module.plugins.Hook import Hook, Expose, threaded +from module.plugins.internal.Hook import Hook, Expose, threaded from module.plugins.internal.Extractor import ArchiveError, CRCError, PasswordError from module.plugins.internal.SimpleHoster import replace_patterns from module.utils import fs_encode, save_join, uniqify @@ -110,7 +110,7 @@ class ArchiveQueue(object): class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.44" + __version__ = "1.45" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract with full paths" , True ), diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index f771cf232..ff5240e35 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -7,14 +7,14 @@ import time from shutil import move -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook from module.utils import fs_encode, save_join class HotFolder(Hook): __name__ = "HotFolder" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("folder" , "str" , "Folder to observe" , "container"), ("watch_file", "bool", "Observe link file" , False ), diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 33fde3d20..751556158 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -12,14 +12,14 @@ from threading import Thread from module.Api import PackageDoesNotExists, FileDoesNotExists from module.network.RequestFactory import getURL -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook from module.utils import formatSize class IRCInterface(Thread, Hook): __name__ = "IRCInterface" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" __config__ = [("host", "str", "IRC-Server Address", "Enter your server here!"), ("port", "int", "IRC-Server Port", 6667), diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index f1fcacb71..4114a33a8 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -8,7 +8,7 @@ import re from base64 import b64encode from module.network.RequestFactory import getURL, getRequest -from module.plugins.Hook import Hook, threaded +from module.plugins.internal.Hook import Hook, threaded class ImageTyperzException(Exception): @@ -32,7 +32,7 @@ class ImageTyperzException(Exception): class ImageTyperz(Hook): __name__ = "ImageTyperz" __type__ = "hook" - __version__ = "0.06" + __version__ = "0.07" __config__ = [("username", "str", "Username", ""), ("passkey", "password", "Password", ""), diff --git a/module/plugins/hooks/JustPremium.py b/module/plugins/hooks/JustPremium.py index f66747f82..19a552e49 100644 --- a/module/plugins/hooks/JustPremium.py +++ b/module/plugins/hooks/JustPremium.py @@ -2,13 +2,13 @@ import re -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook class JustPremium(Hook): __name__ = "JustPremium" __type__ = "hook" - __version__ = "0.22" + __version__ = "0.23" __config__ = [("excluded", "str", "Exclude hosters (comma separated)", ""), ("included", "str", "Include hosters (comma separated)", "")] diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 941938920..db7432eac 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -6,14 +6,14 @@ import os import re import traceback -from module.plugins.Hook import Hook, threaded +from module.plugins.internal.Hook import Hook, threaded from module.utils import save_join class MergeFiles(Hook): __name__ = "MergeFiles" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index a26d139c0..af68fe2bc 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -2,13 +2,13 @@ import time -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook class MultiHome(Hook): __name__ = "MultiHome" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("interfaces", "str", "Interfaces", "None")] diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 865af2a6b..837d903b2 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook class RestartFailed(Hook): __name__ = "RestartFailed" __type__ = "hook" - __version__ = "1.58" + __version__ = "1.59" __config__ = [("interval", "int", "Check interval in minutes", 90)] diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 7901ca540..9737ec9a9 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -7,14 +7,14 @@ import urlparse from types import MethodType from module.PyFile import PyFile -from module.plugins.Hook import Hook -from module.plugins.Plugin import SkipDownload +from module.plugins.internal.Hook import Hook +from module.plugins.internal.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.29" + __version__ = "0.30" __config__ = [("mode" , "Auto;Manual", "Choose recovery archives to skip" , "Auto"), ("revtokeep", "int" , "Number of recovery archives to keep for package", 0 )] diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 9059d0350..b9ae93fee 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- from module.PyFile import PyFile -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 98d602226..249c799d8 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -10,7 +10,7 @@ import time from operator import itemgetter from module.network.RequestFactory import getURL -from module.plugins.Hook import Expose, Hook, threaded +from module.plugins.internal.Hook import Expose, Hook, threaded from module.utils import save_join @@ -29,7 +29,7 @@ def exists(path): class UpdateManager(Hook): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.52" + __version__ = "0.53" __config__ = [("activated" , "bool", "Activated" , True ), ("checkinterval", "int" , "Check interval in hours" , 8 ), diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py index 74c43f7c4..0637936f9 100644 --- a/module/plugins/hooks/UserAgentSwitcher.py +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -2,13 +2,13 @@ import pycurl -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook class UserAgentSwitcher(Hook): __name__ = "UserAgentSwitcher" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" __config__ = [("activated" , "bool", "Activated" , True ), ("connecttimeout", "int" , "Connection timeout in seconds" , 60 ), diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 8f66761f6..dfc93f89c 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -3,13 +3,13 @@ import httplib import time -from module.plugins.Hook import Hook, Expose +from module.plugins.internal.Hook import Hook, Expose class WindowsPhoneNotify(Hook): __name__ = "WindowsPhoneNotify" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.11" __config__ = [("push-id" , "str" , "Push ID" , "" ), ("push-url" , "str" , "Push url" , "" ), diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 485d4ce78..10ca4fb9b 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -2,13 +2,13 @@ import re -from module.plugins.Hook import Hook +from module.plugins.internal.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.38" + __version__ = "0.39" __config__ = [("activated" , "bool", "Activated" , True ), ("use_hoster_list" , "bool", "Load listed hosters only" , False), -- cgit v1.2.3 From af68a12707d30d2c66f314517b2979bf9810d49e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Jun 2015 10:15:40 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1459 (2) --- module/plugins/hooks/PremiumToHook.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/PremiumToHook.py b/module/plugins/hooks/PremiumToHook.py index ef2a84223..11f0f3c8a 100644 --- a/module/plugins/hooks/PremiumToHook.py +++ b/module/plugins/hooks/PremiumToHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class PremiumToHook(MultiHook): __name__ = "PremiumToHook" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), @@ -22,6 +22,7 @@ class PremiumToHook(MultiHook): def getHosters(self): + user, data = self.account.selectAccount() html = self.getURL("http://premium.to/api/hosters.php", - get={'username': self.account.username, 'password': self.account.password}) + get={'username': user, 'password': data['password']}) return [x.strip() for x in html.replace("\"", "").split(";")] -- cgit v1.2.3 From da1180bc2d428ad52fbbecda8473fc1fb7267438 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Jun 2015 01:52:24 +0200 Subject: [SimpleHoster] Improve checkFile --- module/plugins/hooks/AntiVirus.py | 2 +- module/plugins/hooks/Captcha9Kw.py | 2 +- module/plugins/hooks/ExtractArchive.py | 2 +- module/plugins/hooks/RestartFailed.py | 2 +- module/plugins/hooks/UpdateManager.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 0b5eb1410..09872650f 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -91,7 +91,7 @@ class AntiVirus(Hook): shutil.move(file, self.getConfig('quardir')) else: - self.logDebug(_("Successfully moved file to trash")) + self.logDebug("Successfully moved file to trash") elif action == "Quarantine": pyfile.setCustomStatus(_("file moving")) diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 7f37c225e..18a078bdb 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -139,7 +139,7 @@ class Captcha9Kw(Hook): self.logError(_("Bad upload: %s") % res) return - self.logDebug(_("NewCaptchaID ticket: %s") % res, task.captchaFile) + self.logDebug("NewCaptchaID ticket: %s" % res, task.captchaFile) task.data["ticket"] = res diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 67ebfc49c..f311d5b49 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -482,7 +482,7 @@ class ExtractArchive(Hook): self.logWarning(_("Unable to move %s to trash: %s") % (os.path.basename(f), e.message)) else: - self.logDebug(_("Successfully moved %s to trash") % os.path.basename(f)) + self.logDebug("Successfully moved %s to trash" % os.path.basename(f)) self.logInfo(name, _("Extracting finished")) extracted_files = archive.files or archive.list() diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 837d903b2..c29b9cee4 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -30,7 +30,7 @@ class RestartFailed(Hook): def periodical(self): - self.logDebug(_("Restart failed downloads")) + self.logDebug("Restart failed downloads") self.core.api.restartFailed() diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 249c799d8..f8eb25bc1 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -39,7 +39,7 @@ class UpdateManager(Hook): ("reloadplugins", "bool", "Monitor plugin code changes in debug mode", True ), ("nodebugupdate", "bool", "Don't update plugins in debug mode" , False)] - __description__ = """ Check for updates """ + __description__ = """Check for updates""" __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -- cgit v1.2.3 From 043e3dfd83bb217ea15280fef6523fcca691fbf2 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Thu, 11 Jun 2015 01:47:38 +0300 Subject: fix #1475 --- module/plugins/hooks/ExternalScripts.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index a4f698f98..60a343f67 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -10,7 +10,7 @@ from module.utils import fs_encode, save_join class ExternalScripts(Hook): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.40" + __version__ = "0.41" __config__ = [("activated", "bool", "Activated" , True ), ("waitend" , "bool", "Wait script ending", False)] @@ -25,17 +25,17 @@ class ExternalScripts(Hook): interval = 0 #@TODO: Remove in 0.4.10 + event_list = ["archive_extract_failed", "archive_extracted" , + "package_extract_failed", "package_extracted" , + "all_archives_extracted", "all_archives_processed", + "allDownloadsFinished" , "allDownloadsProcessed" , + "packageDeleted"] + def setup(self): self.info = {'oldip': None} self.scripts = {} - self.event_list = ["archive_extract_failed", "archive_extracted" , - "package_extract_failed", "package_extracted" , - "all_archives_extracted", "all_archives_processed", - "allDownloadsFinished" , "allDownloadsProcessed" , - "packageDeleted"] - folders = ["pyload_start", "pyload_restart", "pyload_stop", "before_reconnect", "after_reconnect", "download_preparing", "download_failed", "download_finished", -- cgit v1.2.3 From b7c7ecbd96514e084378fad00180073380462b67 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 14 Jun 2015 18:36:31 +0200 Subject: Revert https://github.com/pyload/pyload/commit/043e3dfd83bb217ea15280fef6523fcca691fbf2 --- module/plugins/hooks/ExternalScripts.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 60a343f67..b5164a5aa 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -10,7 +10,7 @@ from module.utils import fs_encode, save_join class ExternalScripts(Hook): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.41" + __version__ = "0.42" __config__ = [("activated", "bool", "Activated" , True ), ("waitend" , "bool", "Wait script ending", False)] @@ -25,17 +25,17 @@ class ExternalScripts(Hook): interval = 0 #@TODO: Remove in 0.4.10 - event_list = ["archive_extract_failed", "archive_extracted" , - "package_extract_failed", "package_extracted" , - "all_archives_extracted", "all_archives_processed", - "allDownloadsFinished" , "allDownloadsProcessed" , - "packageDeleted"] - def setup(self): self.info = {'oldip': None} self.scripts = {} + self.event_list = ["archive_extract_failed", "archive_extracted" , + "package_extract_failed", "package_extracted" , + "all_archives_extracted", "all_archives_processed", + "allDownloadsFinished" , "allDownloadsProcessed" , + "packageDeleted"] + folders = ["pyload_start", "pyload_restart", "pyload_stop", "before_reconnect", "after_reconnect", "download_preparing", "download_failed", "download_finished", -- cgit v1.2.3 From f4b893e5ee24769584a2da1866c665489f7019ec Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 06:56:13 +0200 Subject: Hook plugin code cosmetics --- module/plugins/hooks/AndroidPhoneNotify.py | 6 +++--- module/plugins/hooks/BypassCaptcha.py | 2 +- module/plugins/hooks/Captcha9Kw.py | 2 +- module/plugins/hooks/CaptchaBrotherhood.py | 2 +- module/plugins/hooks/DeathByCaptcha.py | 2 +- module/plugins/hooks/ExpertDecoders.py | 2 +- module/plugins/hooks/IRCInterface.py | 2 +- module/plugins/hooks/ImageTyperz.py | 2 +- module/plugins/hooks/WindowsPhoneNotify.py | 6 +++--- 9 files changed, 13 insertions(+), 13 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index f987a890b..d582a4a31 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -60,7 +60,7 @@ class AndroidPhoneNotify(Hook): self.notify(_("Exiting pyLoad")) - def newCaptchaTask(self, task): + def captcha_task(self, task): if not self.getConfig('notifycaptcha'): return @@ -97,13 +97,13 @@ class AndroidPhoneNotify(Hook): elapsed_time = time.time() - self.last_notify - if elapsed_time < self.getConf("sendtimewait"): + if elapsed_time < self.getConfig("sendtimewait"): return if elapsed_time > 60: self.notifications = 0 - elif self.notifications >= self.getConf("sendpermin"): + elif self.notifications >= self.getConfig("sendpermin"): return getURL("http://www.notifymyandroid.com/publicapi/notify", diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index e2abf617c..4b50ef800 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -95,7 +95,7 @@ class BypassCaptcha(Hook): self.logError(_("Could not send response"), e) - def newCaptchaTask(self, task): + def captcha_task(self, task): if "service" in task.data: return False diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 18a078bdb..ea15d7651 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -165,7 +165,7 @@ class Captcha9Kw(Hook): task.setResult(result) - def newCaptchaTask(self, task): + def captcha_task(self, task): if not task.isTextual() and not task.isPositional(): return diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 6dbb67335..eecf49515 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -132,7 +132,7 @@ class CaptchaBrotherhood(Hook): return res - def newCaptchaTask(self, task): + def captcha_task(self, task): if "service" in task.data: return False diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 63c2cd41d..073f01d57 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -162,7 +162,7 @@ class DeathByCaptcha(Hook): return ticket, result - def newCaptchaTask(self, task): + def captcha_task(self, task): if "service" in task.data: return False diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 105abca79..8a2a836aa 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -72,7 +72,7 @@ class ExpertDecoders(Hook): task.setResult(result) - def newCaptchaTask(self, task): + def captcha_task(self, task): if not task.isTextual(): return False diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 751556158..7e4d50384 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -71,7 +71,7 @@ class IRCInterface(Thread, Hook): pass - def newCaptchaTask(self, task): + def captcha_task(self, task): if self.getConfig('captcha') and task.isTextual(): task.handler.append(self) task.setWaiting(60) diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 4114a33a8..06c371f1d 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -109,7 +109,7 @@ class ImageTyperz(Hook): return ticket, result - def newCaptchaTask(self, task): + def captcha_task(self, task): if "service" in task.data: return False diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index dfc93f89c..97e3b6da4 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -61,7 +61,7 @@ class WindowsPhoneNotify(Hook): self.notify(_("Exiting pyLoad")) - def newCaptchaTask(self, task): + def captcha_task(self, task): if not self.getConfig('notifycaptcha'): return @@ -104,13 +104,13 @@ class WindowsPhoneNotify(Hook): elapsed_time = time.time() - self.last_notify - if elapsed_time < self.getConf("sendtimewait"): + if elapsed_time < self.getConfig("sendtimewait"): return if elapsed_time > 60: self.notifications = 0 - elif self.notifications >= self.getConf("sendpermin"): + elif self.notifications >= self.getConfig("sendpermin"): return request = self.getXmlData("%s: %s" % (event, msg) if msg else event) -- cgit v1.2.3 From c9144f451b74e4d3cc67935b9e73c662ac870c6e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 07:18:39 +0200 Subject: Hook plugin code cosmetics (2) --- module/plugins/hooks/AndroidPhoneNotify.py | 4 ++-- module/plugins/hooks/Checksum.py | 2 +- module/plugins/hooks/ClickAndLoad.py | 2 +- module/plugins/hooks/DeleteFinished.py | 4 ++-- module/plugins/hooks/DownloadScheduler.py | 2 +- module/plugins/hooks/ExternalScripts.py | 2 +- module/plugins/hooks/ExtractArchive.py | 2 +- module/plugins/hooks/IRCInterface.py | 2 +- module/plugins/hooks/MultiHome.py | 2 +- module/plugins/hooks/RestartFailed.py | 2 +- module/plugins/hooks/UpdateManager.py | 2 +- module/plugins/hooks/WindowsPhoneNotify.py | 4 ++-- module/plugins/hooks/XFileSharingPro.py | 4 ++-- module/plugins/hooks/XMPPInterface.py | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index d582a4a31..c9493bfd0 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -46,11 +46,11 @@ class AndroidPhoneNotify(Hook): self.notify(_("Plugins updated"), str(type_plugins)) - def coreReady(self): + def activate(self): self.key = self.getConfig('apikey') - def coreExiting(self): + def exit(self): if not self.getConfig('notifyexit'): return diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 13374f7bd..f132c37d1 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -63,7 +63,7 @@ class Checksum(Hook): 'default': r'^(?P[0-9A-Fa-f]+)\s+\*?(?P.+)$'} - def coreReady(self): + def activate(self): if not self.getConfig('check_checksum'): self.logInfo(_("Checksum validation is disabled in plugin configuration")) diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index b910902c6..e9e231a28 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -48,7 +48,7 @@ class ClickAndLoad(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def coreReady(self): + def activate(self): if not self.config['webinterface']['activated']: return diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 5920b9a35..29bd7a4e1 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -44,11 +44,11 @@ class DeleteFinished(Hook): # self.initPeriodical() - def unload(self): + def deactivate(self): self.manager.removeEvent('packageFinished', self.wakeup) - def coreReady(self): + def activate(self): self.info['sleep'] = True # interval = self.getConfig('interval') # self.pluginConfigChanged(self.__name__, 'interval', interval) diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 314e5913e..773de7c4b 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -29,7 +29,7 @@ class DownloadScheduler(Hook): self.cb = None # callback to scheduler job; will be by removed hookmanager when hook unloaded - def coreReady(self): + def activate(self): self.updateSchedule() diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index b5164a5aa..140dcb057 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -103,7 +103,7 @@ class ExternalScripts(Hook): self.callScript(script) - def coreExiting(self): + def exit(self): for script in self.scripts['pyload_restart' if self.core.do_restart else 'pyload_stop']: self.callScript(script) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index f311d5b49..dae04c811 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -154,7 +154,7 @@ class ExtractArchive(Hook): self.repair = False - def coreReady(self): + def activate(self): for p in ("UnRar", "SevenZip", "UnZip"): try: module = self.core.pluginManager.loadModule("internal", p) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 7e4d50384..b3b3d9b89 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -46,7 +46,7 @@ class IRCInterface(Thread, Hook): self.setDaemon(True) - def coreReady(self): + def activate(self): self.abort = False self.more = [] self.new_package = {} diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index af68fe2bc..63c1fee05 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -43,7 +43,7 @@ class MultiHome(Hook): self.interfaces.append(Interface(interface)) - def coreReady(self): + def activate(self): requestFactory = self.core.requestFactory oldGetRequest = requestFactory.getRequest diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index c29b9cee4..eb49a5418 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -40,6 +40,6 @@ class RestartFailed(Hook): self.interval = self.MIN_CHECK_INTERVAL - def coreReady(self): + def activate(self): # self.pluginConfigChanged(self.__name__, "interval", self.getConfig('interval')) self.interval = max(self.MIN_CHECK_INTERVAL, self.getConfig('interval') * 60) diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index f8eb25bc1..958be4e12 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -50,7 +50,7 @@ class UpdateManager(Hook): MIN_CHECK_INTERVAL = 3 * 60 * 60 #: 3 hours - def coreReady(self): + def activate(self): if self.checkonstart: self.core.api.pauseServer() self.update() diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 97e3b6da4..86a5f2308 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -47,11 +47,11 @@ class WindowsPhoneNotify(Hook): self.notify(_("Plugins updated"), str(type_plugins)) - def coreReady(self): + def activate(self): self.key = (self.getConfig('push-id'), self.getConfig('push-url')) - def coreExiting(self): + def exit(self): if not self.getConfig('notifyexit'): return diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 10ca4fb9b..f13a78d4a 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -53,7 +53,7 @@ class XFileSharingPro(Hook): # self.event_list = ["pluginConfigChanged"] - def coreReady(self): + def activate(self): self.loadPattern() @@ -104,7 +104,7 @@ class XFileSharingPro(Hook): dict['re'] = re.compile(dict['pattern']) - def unload(self): + def deactivate(self): # self.unloadHoster("BasePlugin") for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index b61428392..e93da98bf 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -59,7 +59,7 @@ class XMPPInterface(IRCInterface, JabberClient): ] - def coreReady(self): + def activate(self): self.new_package = {} self.start() -- cgit v1.2.3 From 9e39f47b966f220671f70b946793672517c0a3ba Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Tue, 16 Jun 2015 10:58:44 +0300 Subject: fix #1507 --- module/plugins/hooks/SkipRev.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 9737ec9a9..da9f24883 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -8,13 +8,13 @@ from types import MethodType from module.PyFile import PyFile from module.plugins.internal.Hook import Hook -from module.plugins.internal.Plugin import SkipDownload +from module.plugins.internal.Plugin import Skip class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.30" + __version__ = "0.31" __config__ = [("mode" , "Auto;Manual", "Choose recovery archives to skip" , "Auto"), ("revtokeep", "int" , "Number of recovery archives to keep for package", 0 )] @@ -35,7 +35,7 @@ class SkipRev(Hook): def _setup(self): self.pyfile.plugin._setup() if self.pyfile.hasStatus("skipped"): - raise SkipDownload(self.pyfile.statusname or self.pyfile.pluginname) + raise Skip(self.pyfile.statusname or self.pyfile.pluginname) def _name(self, pyfile): -- cgit v1.2.3 From 9ce720d5d7e328cc761b4a6d7517c5d8cb862caf Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Wed, 24 Jun 2015 00:26:27 +0300 Subject: HighWayMe.py -> HighWayMeHook.py --- module/plugins/hooks/HighWayMe.py | 26 -------------------------- module/plugins/hooks/HighWayMeHook.py | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 module/plugins/hooks/HighWayMe.py create mode 100644 module/plugins/hooks/HighWayMeHook.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/HighWayMe.py b/module/plugins/hooks/HighWayMe.py deleted file mode 100644 index 7d5c88ecc..000000000 --- a/module/plugins/hooks/HighWayMe.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.common.json_layer import json_loads -from module.plugins.internal.MultiHook import MultiHook - - -class HighWayMeHook(MultiHook): - __name__ = "HighWayMeHook" - __type__ = "hook" - __version__ = "0.02" - - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] - - __description__ = """High-Way.me hook plugin""" - __license__ = "GPLv3" - __authors__ = [("EvolutionClip", "evolutionclip@live.de")] - - - def getHosters(self): - json_data = json_loads(self.getURL("https://high-way.me/api.php", - get={'hoster': 1})) - return [element['name'] for element in json_data['hoster']] diff --git a/module/plugins/hooks/HighWayMeHook.py b/module/plugins/hooks/HighWayMeHook.py new file mode 100644 index 000000000..ff4d3f96b --- /dev/null +++ b/module/plugins/hooks/HighWayMeHook.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- + +from module.common.json_layer import json_loads +from module.plugins.internal.MultiHook import MultiHook + + +class HighWayMeHook(MultiHook): + __name__ = "HighWayMeHook" + __type__ = "hook" + __version__ = "0.03" + + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), + ("revertfailed" , "bool" , "Revert to standard download if fails", True ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + + __description__ = """High-Way.me hook plugin""" + __license__ = "GPLv3" + __authors__ = [("EvolutionClip", "evolutionclip@live.de")] + + + def getHosters(self): + json_data = json_loads(self.getURL("https://high-way.me/api.php", + get={'hoster': 1})) + return [element['name'] for element in json_data['hoster']] -- cgit v1.2.3 From 5a139055ae658d3a05cbb658cbd66aeae0d01db5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 15 Jun 2015 21:06:10 +0200 Subject: Spare code cosmetics --- module/plugins/hooks/AndroidPhoneNotify.py | 2 +- module/plugins/hooks/AntiVirus.py | 6 ++-- module/plugins/hooks/BypassCaptcha.py | 4 +-- module/plugins/hooks/Captcha9Kw.py | 4 +-- module/plugins/hooks/CaptchaBrotherhood.py | 2 +- module/plugins/hooks/Checksum.py | 16 ++++----- module/plugins/hooks/ClickAndLoad.py | 6 ++-- module/plugins/hooks/DeathByCaptcha.py | 2 +- module/plugins/hooks/DeleteFinished.py | 10 +++--- module/plugins/hooks/ExpertDecoders.py | 2 +- module/plugins/hooks/ExternalScripts.py | 56 +++++++++++++++--------------- module/plugins/hooks/ExtractArchive.py | 26 +++++++------- module/plugins/hooks/HotFolder.py | 4 +-- module/plugins/hooks/IRCInterface.py | 4 +-- module/plugins/hooks/ImageTyperz.py | 2 +- module/plugins/hooks/MergeFiles.py | 14 ++++---- module/plugins/hooks/MultiHome.py | 2 +- module/plugins/hooks/RestartFailed.py | 2 +- module/plugins/hooks/SkipRev.py | 4 +-- module/plugins/hooks/UnSkipOnFail.py | 2 +- module/plugins/hooks/UpdateManager.py | 8 ++--- module/plugins/hooks/UserAgentSwitcher.py | 2 +- module/plugins/hooks/WindowsPhoneNotify.py | 2 +- module/plugins/hooks/XFileSharingPro.py | 2 +- module/plugins/hooks/XMPPInterface.py | 8 ++--- 25 files changed, 96 insertions(+), 96 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index c9493bfd0..e775b785b 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -67,7 +67,7 @@ class AndroidPhoneNotify(Hook): self.notify(_("Captcha"), _("New request waiting user input")) - def packageFinished(self, pypack): + def package_finished(self, pypack): if self.getConfig('notifypackage'): self.notify(_("Package finished"), pypack.name) diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 09872650f..1faa6ebe3 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -10,7 +10,7 @@ except ImportError: pass from module.plugins.internal.Hook import Hook, Expose, threaded -from module.utils import fs_encode, save_join +from module.utils import fs_encode, save_join as fs_join class AntiVirus(Hook): @@ -108,11 +108,11 @@ class AntiVirus(Hook): thread.finishFile(pyfile) - def downloadFinished(self, pyfile): + def download_finished(self, pyfile): return self.scan(pyfile) - def downloadFailed(self, pyfile): + def download_failed(self, pyfile): #: Check if pyfile is still "failed", # maybe might has been restarted in meantime if pyfile.status == 8 and self.getConfig('scanfailed'): diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 4b50ef800..bbbe96b73 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -118,12 +118,12 @@ class BypassCaptcha(Hook): self.logInfo(_("Your %s account has not enough credits") % self.__name__) - def captchaCorrect(self, task): + def captcha_correct(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], True) - def captchaInvalid(self, task): + def captcha_invalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], False) diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index ea15d7651..85bbb7924 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -246,9 +246,9 @@ class Captcha9Kw(Hook): self.logDebug("Could not send %s request: %s" % (type, res)) - def captchaCorrect(self, task): + def captcha_correct(self, task): self._captchaResponse(task, True) - def captchaInvalid(self, task): + def captcha_invalid(self, task): self._captchaResponse(task, False) diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index eecf49515..1f2bbf956 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -154,7 +154,7 @@ class CaptchaBrotherhood(Hook): self.logInfo(_("Your CaptchaBrotherhood Account has not enough credits")) - def captchaInvalid(self, task): + def captcha_invalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: res = self.api_response("complainCaptcha", task.data['ticket']) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index f132c37d1..9287fda9c 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -8,7 +8,7 @@ import re import zlib from module.plugins.internal.Hook import Hook -from module.utils import save_join, fs_encode +from module.utils import save_join as fs_join, fs_encode def computeChecksum(local_file, algorithm): @@ -78,7 +78,7 @@ class Checksum(Hook): self.formats = self.algorithms + ["sfv", "crc", "hash"] - def downloadFinished(self, pyfile): + def download_finished(self, pyfile): """ Compute checksum for the downloaded file and compare it with the hash provided by the hoster. pyfile.plugin.check_data should be a dictionary which can contain: @@ -104,8 +104,8 @@ class Checksum(Hook): self.checkFailed(pyfile, None, "No file downloaded") local_file = fs_encode(pyfile.plugin.lastDownload) - #download_folder = self.config['general']['download_folder'] - #local_file = fs_encode(save_join(download_folder, pyfile.package().folder, pyfile.name)) + #download_folder = self.core.config['general']['download_folder'] + #local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name)) if not os.path.isfile(local_file): self.checkFailed(pyfile, None, "File does not exist") @@ -164,8 +164,8 @@ class Checksum(Hook): pyfile.plugin.fail(reason=msg) - def packageFinished(self, pypack): - download_folder = save_join(self.config['general']['download_folder'], pypack.folder, "") + def package_finished(self, pypack): + download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder, "") for link in pypack.getChildren().itervalues(): file_type = os.path.splitext(link['name'])[1][1:].lower() @@ -173,7 +173,7 @@ class Checksum(Hook): if file_type not in self.formats: continue - hash_file = fs_encode(save_join(download_folder, link['name'])) + hash_file = fs_encode(fs_join(download_folder, link['name'])) if not os.path.isfile(hash_file): self.logWarning(_("File not found"), link['name']) continue @@ -185,7 +185,7 @@ class Checksum(Hook): data = m.groupdict() self.logDebug(link['name'], data) - local_file = fs_encode(save_join(download_folder, data['NAME'])) + local_file = fs_encode(fs_join(download_folder, data['NAME'])) algorithm = self.methods.get(file_type, file_type) checksum = computeChecksum(local_file, algorithm) if checksum == data['HASH']: diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index e9e231a28..81a446ef3 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -49,11 +49,11 @@ class ClickAndLoad(Hook): def activate(self): - if not self.config['webinterface']['activated']: + if not self.core.config['webinterface']['activated']: return ip = "" if self.getConfig('extern') else "127.0.0.1" - webport = self.config['webinterface']['port'] + webport = self.core.config['webinterface']['port'] cnlport = self.getConfig('port') self.proxy(ip, webport, cnlport) @@ -85,7 +85,7 @@ class ClickAndLoad(Hook): server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if self.config['webinterface']['https']: + if self.core.config['webinterface']['https']: try: server_socket = ssl.wrap_socket(server_socket) diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 073f01d57..1ece35bdb 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -194,7 +194,7 @@ class DeathByCaptcha(Hook): self._processCaptcha(task) - def captchaInvalid(self, task): + def captcha_invalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: try: res = self.api_response("captcha/%d/report" % task.data['ticket'], True) diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 29bd7a4e1..38d2a7ed0 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -35,17 +35,17 @@ class DeleteFinished(Hook): self.logInfo(msg % (_('including') if deloffline else _('excluding'))) self.deleteFinished(mode) self.info['sleep'] = True - self.addEvent('packageFinished', self.wakeup) + self.addEvent('package_finished', self.wakeup) # def pluginConfigChanged(self, plugin, name, value): # if name == "interval" and value != self.interval: # self.interval = value * 3600 - # self.initPeriodical() + # self.init_periodical() def deactivate(self): - self.manager.removeEvent('packageFinished', self.wakeup) + self.manager.removeEvent('package_finished', self.wakeup) def activate(self): @@ -53,7 +53,7 @@ class DeleteFinished(Hook): # interval = self.getConfig('interval') # self.pluginConfigChanged(self.__name__, 'interval', interval) self.interval = max(self.MIN_CHECK_INTERVAL, self.getConfig('interval') * 60 * 60) - self.addEvent('packageFinished', self.wakeup) + self.addEvent('package_finished', self.wakeup) ## own methods ## @@ -64,7 +64,7 @@ class DeleteFinished(Hook): def wakeup(self, pypack): - self.manager.removeEvent('packageFinished', self.wakeup) + self.manager.removeEvent('package_finished', self.wakeup) self.info['sleep'] = False diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 8a2a836aa..13289f8d1 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -91,7 +91,7 @@ class ExpertDecoders(Hook): self.logInfo(_("Your ExpertDecoders Account has not enough credits")) - def captchaInvalid(self, task): + def captcha_invalid(self, task): if "ticket" in task.data: try: diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 140dcb057..85df87a23 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -4,7 +4,7 @@ import os import subprocess from module.plugins.internal.Hook import Hook -from module.utils import fs_encode, save_join +from module.utils import fs_encode, save_join as fs_join class ExternalScripts(Hook): @@ -66,7 +66,7 @@ class ExternalScripts(Hook): return for filename in os.listdir(dir): - file = save_join(dir, filename) + file = fs_join(dir, filename) if not os.path.isfile(file): continue @@ -108,41 +108,41 @@ class ExternalScripts(Hook): self.callScript(script) - def beforeReconnecting(self, ip): + def before_reconnect(self, ip): for script in self.scripts['before_reconnect']: self.callScript(script, ip) self.info['oldip'] = ip - def afterReconnecting(self, ip): + def after_reconnect(self, ip): for script in self.scripts['after_reconnect']: self.callScript(script, ip, self.info['oldip']) #@TODO: Use built-in oldip in 0.4.10 - def downloadPreparing(self, pyfile): + def download_preparing(self, pyfile): for script in self.scripts['download_preparing']: self.callScript(script, pyfile.id, pyfile.name, None, pyfile.pluginname, pyfile.url) - def downloadFailed(self, pyfile): - if self.config['general']['folder_per_package']: - download_folder = save_join(self.config['general']['download_folder'], pyfile.package().folder) + def download_failed(self, pyfile): + if self.core.config['general']['folder_per_package']: + download_folder = fs_join(self.core.config['general']['download_folder'], pyfile.package().folder) else: - download_folder = self.config['general']['download_folder'] + download_folder = self.core.config['general']['download_folder'] for script in self.scripts['download_failed']: - file = save_join(download_folder, pyfile.name) + file = fs_join(download_folder, pyfile.name) self.callScript(script, pyfile.id, pyfile.name, file, pyfile.pluginname, pyfile.url) - def downloadFinished(self, pyfile): - if self.config['general']['folder_per_package']: - download_folder = save_join(self.config['general']['download_folder'], pyfile.package().folder) + def download_finished(self, pyfile): + if self.core.config['general']['folder_per_package']: + download_folder = fs_join(self.core.config['general']['download_folder'], pyfile.package().folder) else: - download_folder = self.config['general']['download_folder'] + download_folder = self.core.config['general']['download_folder'] for script in self.scripts['download_finished']: - file = save_join(download_folder, pyfile.name) + file = fs_join(download_folder, pyfile.name) self.callScript(script, pyfile.id, pyfile.name, file, pyfile.pluginname, pyfile.url) @@ -156,11 +156,11 @@ class ExternalScripts(Hook): self.callScript(script, pyfile.id, pyfile.name, archive.filename, archive.out, archive.files) - def packageFinished(self, pypack): - if self.config['general']['folder_per_package']: - download_folder = save_join(self.config['general']['download_folder'], pypack.folder) + def package_finished(self, pypack): + if self.core.config['general']['folder_per_package']: + download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder) else: - download_folder = self.config['general']['download_folder'] + download_folder = self.core.config['general']['download_folder'] for script in self.scripts['package_finished']: self.callScript(script, pypack.id, pypack.name, download_folder, pypack.password) @@ -169,30 +169,30 @@ class ExternalScripts(Hook): def packageDeleted(self, pid): pack = self.core.api.getPackageInfo(pid) - if self.config['general']['folder_per_package']: - download_folder = save_join(self.config['general']['download_folder'], pack.folder) + if self.core.config['general']['folder_per_package']: + download_folder = fs_join(self.core.config['general']['download_folder'], pack.folder) else: - download_folder = self.config['general']['download_folder'] + download_folder = self.core.config['general']['download_folder'] for script in self.scripts['package_deleted']: self.callScript(script, pack.id, pack.name, download_folder, pack.password) def package_extract_failed(self, pypack): - if self.config['general']['folder_per_package']: - download_folder = save_join(self.config['general']['download_folder'], pypack.folder) + if self.core.config['general']['folder_per_package']: + download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder) else: - download_folder = self.config['general']['download_folder'] + download_folder = self.core.config['general']['download_folder'] for script in self.scripts['package_extract_failed']: self.callScript(script, pypack.id, pypack.name, download_folder, pypack.password) def package_extracted(self, pypack): - if self.config['general']['folder_per_package']: - download_folder = save_join(self.config['general']['download_folder'], pypack.folder) + if self.core.config['general']['folder_per_package']: + download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder) else: - download_folder = self.config['general']['download_folder'] + download_folder = self.core.config['general']['download_folder'] for script in self.scripts['package_extracted']: self.callScript(script, pypack.id, pypack.name, download_folder) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index dae04c811..2c0d68f3e 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -56,7 +56,7 @@ if os.name != "nt": from module.plugins.internal.Hook import Hook, Expose, threaded from module.plugins.internal.Extractor import ArchiveError, CRCError, PasswordError from module.plugins.internal.SimpleHoster import replace_patterns -from module.utils import fs_encode, save_join, uniqify +from module.utils import fs_encode, save_join as fs_join, uniqify class ArchiveQueue(object): @@ -220,7 +220,7 @@ class ExtractArchive(Hook): self.queue.remove(pid) - def packageFinished(self, pypack): + def package_finished(self, pypack): self.queue.add(pypack.id) if not self.getConfig('waitall') and not self.extracting: self.extractQueued() @@ -261,7 +261,7 @@ class ExtractArchive(Hook): # reload from txt file self.reloadPasswords() - download_folder = self.config['general']['download_folder'] + download_folder = self.core.config['general']['download_folder'] # iterate packages -> extractors -> targets for pid in ids: @@ -274,17 +274,17 @@ class ExtractArchive(Hook): self.logInfo(_("Check package: %s") % pypack.name) # determine output folder - out = save_join(download_folder, pypack.folder, destination, "") #: force trailing slash + out = fs_join(download_folder, pypack.folder, destination, "") #: force trailing slash if subfolder: - out = save_join(out, pypack.folder) + out = fs_join(out, pypack.folder) if not os.path.exists(out): os.makedirs(out) matched = False success = True - files_ids = dict((pylink['name'],((save_join(download_folder, pypack.folder, pylink['name'])), pylink['id'], out)) for pylink \ + files_ids = dict((pylink['name'],((fs_join(download_folder, pypack.folder, pylink['name'])), pylink['id'], out)) for pylink \ in sorted(pypack.getChildren().itervalues(), key=lambda k: k['name'])).values() #: remove duplicates # check as long there are unseen files @@ -344,7 +344,7 @@ class ExtractArchive(Hook): self.setPermissions(new_files) for filename in new_files: - file = fs_encode(save_join(os.path.dirname(archive.filename), filename)) + file = fs_encode(fs_join(os.path.dirname(archive.filename), filename)) if not os.path.exists(file): self.logDebug("New file %s does not exists" % filename) continue @@ -554,16 +554,16 @@ class ExtractArchive(Hook): continue try: - if self.config['permission']['change_file']: + if self.core.config['permission']['change_file']: if os.path.isfile(f): - os.chmod(f, int(self.config['permission']['file'], 8)) + os.chmod(f, int(self.core.config['permission']['file'], 8)) elif os.path.isdir(f): - os.chmod(f, int(self.config['permission']['folder'], 8)) + os.chmod(f, int(self.core.config['permission']['folder'], 8)) - if self.config['permission']['change_dl'] and os.name != "nt": - uid = getpwnam(self.config['permission']['user'])[2] - gid = getgrnam(self.config['permission']['group'])[2] + if self.core.config['permission']['change_dl'] and os.name != "nt": + uid = getpwnam(self.core.config['permission']['user'])[2] + gid = getgrnam(self.core.config['permission']['group'])[2] os.chown(f, uid, gid) except Exception, e: diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index ff5240e35..8c922f47a 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -8,7 +8,7 @@ import time from shutil import move from module.plugins.internal.Hook import Hook -from module.utils import fs_encode, save_join +from module.utils import fs_encode, save_join as fs_join class HotFolder(Hook): @@ -50,7 +50,7 @@ class HotFolder(Hook): name = "%s_%s.txt" % (file, time.strftime("%H-%M-%S_%d%b%Y")) - with open(save_join(folder, "finished", name), "wb") as f: + with open(fs_join(folder, "finished", name), "wb") as f: f.write(content) self.core.api.addPackage(f.name, [f.name], 1) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index b3b3d9b89..e24691bde 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -54,7 +54,7 @@ class IRCInterface(Thread, Hook): self.start() - def packageFinished(self, pypack): + def package_finished(self, pypack): try: if self.getConfig('info_pack'): self.response(_("Package finished: %s") % pypack.name) @@ -62,7 +62,7 @@ class IRCInterface(Thread, Hook): pass - def downloadFinished(self, pyfile): + def download_finished(self, pyfile): try: if self.getConfig('info_file'): self.response( diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 06c371f1d..7fb642250 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -132,7 +132,7 @@ class ImageTyperz(Hook): self.logInfo(_("Your %s account has not enough credits") % self.__name__) - def captchaInvalid(self, task): + def captcha_invalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: res = getURL(self.RESPOND_URL, post={'action': "SETBADIMAGE", diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index db7432eac..0b0f7e475 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -7,7 +7,7 @@ import re import traceback from module.plugins.internal.Hook import Hook, threaded -from module.utils import save_join +from module.utils import save_join as fs_join class MergeFiles(Hook): @@ -32,7 +32,7 @@ class MergeFiles(Hook): @threaded - def packageFinished(self, pack): + def package_finished(self, pack): files = {} fid_dict = {} for fid, data in pack.getChildren().iteritems(): @@ -43,15 +43,15 @@ class MergeFiles(Hook): files[data['name'][:-4]].sort() fid_dict[data['name']] = fid - download_folder = self.config['general']['download_folder'] + download_folder = self.core.config['general']['download_folder'] - if self.config['general']['folder_per_package']: - download_folder = save_join(download_folder, pack.folder) + if self.core.config['general']['folder_per_package']: + download_folder = fs_join(download_folder, pack.folder) for name, file_list in files.iteritems(): self.logInfo(_("Starting merging of"), name) - with open(save_join(download_folder, name), "wb") as final_file: + with open(fs_join(download_folder, name), "wb") as final_file: for splitted_file in file_list: self.logDebug("Merging part", splitted_file) @@ -60,7 +60,7 @@ class MergeFiles(Hook): pyfile.setStatus("processing") try: - with open(save_join(download_folder, splitted_file), "rb") as s_file: + with open(fs_join(download_folder, splitted_file), "rb") as s_file: size_written = 0 s_file_size = int(os.path.getsize(os.path.join(download_folder, splitted_file))) while True: diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 63c1fee05..fe7f39a12 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -28,7 +28,7 @@ class MultiHome(Hook): self.parseInterfaces(self.getConfig('interfaces').split(";")) if not self.interfaces: - self.parseInterfaces([self.config['download']['interface']]) + self.parseInterfaces([self.core.config['download']['interface']]) self.setConfig("interfaces", self.toConfig()) diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index eb49a5418..153b4716c 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -24,7 +24,7 @@ class RestartFailed(Hook): # if self.MIN_CHECK_INTERVAL <= interval != self.interval: # self.core.scheduler.removeJob(self.cb) # self.interval = interval - # self.initPeriodical() + # self.init_periodical() # else: # self.logDebug("Invalid interval value, kept current") diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index da9f24883..0457f9b55 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -59,7 +59,7 @@ class SkipRev(Hook): link.order) - def downloadPreparing(self, pyfile): + def download_preparing(self, pyfile): name = self._name(pyfile) if pyfile.statusname is _("unskipped") or not name.endswith(".rev") or not ".part" in name: @@ -85,7 +85,7 @@ class SkipRev(Hook): pyfile.plugin.setup = MethodType(self._setup, pyfile.plugin) - def downloadFailed(self, pyfile): + def download_failed(self, pyfile): #: Check if pyfile is still "failed", # maybe might has been restarted in meantime if pyfile.status != 8 or pyfile.name.rsplit('.', 1)[-1].strip() not in ("rar", "rev"): diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index b9ae93fee..234e1052b 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -23,7 +23,7 @@ class UnSkipOnFail(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def downloadFailed(self, pyfile): + def download_failed(self, pyfile): #: Check if pyfile is still "failed", # maybe might has been restarted in meantime if pyfile.status != 8: diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 958be4e12..f555e4ff3 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -11,7 +11,7 @@ from operator import itemgetter from module.network.RequestFactory import getURL from module.plugins.internal.Hook import Expose, Hook, threaded -from module.utils import save_join +from module.utils import save_join as fs_join # Case-sensitive os.path.exists @@ -57,7 +57,7 @@ class UpdateManager(Hook): if self.do_restart is False: self.core.api.unpauseServer() - self.initPeriodical() + self.init_periodical() def setup(self): @@ -257,7 +257,7 @@ class UpdateManager(Hook): m = VERSION.search(content) if m and m.group(2) == version: - with open(save_join("userplugins", prefix, filename), "wb") as f: + with open(fs_join("userplugins", prefix, filename), "wb") as f: f.write(content) updated.append((prefix, name)) @@ -303,7 +303,7 @@ class UpdateManager(Hook): rootplugins = os.path.join(pypath, "module", "plugins") for dir in ("userplugins", rootplugins): - py_filename = save_join(dir, type, name + ".py") + py_filename = fs_join(dir, type, name + ".py") pyc_filename = py_filename + "c" if type == "hook": diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py index 0637936f9..0504ec9d0 100644 --- a/module/plugins/hooks/UserAgentSwitcher.py +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -27,7 +27,7 @@ class UserAgentSwitcher(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def downloadPreparing(self, pyfile): + def download_preparing(self, pyfile): connecttimeout = self.getConfig('connecttimeout') maxredirs = self.getConfig('maxredirs') useragent = self.getConfig('useragent').encode("utf8", "replace") #@TODO: Remove `encode` in 0.4.10 diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 86a5f2308..713499322 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -68,7 +68,7 @@ class WindowsPhoneNotify(Hook): self.notify(_("Captcha"), _("New request waiting user input")) - def packageFinished(self, pypack): + def package_finished(self, pypack): if self.getConfig('notifypackage'): self.notify(_("Package finished"), pypack.name) diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index f13a78d4a..8ef5941d1 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -126,7 +126,7 @@ class XFileSharingPro(Hook): return False - # def downloadFailed(self, pyfile): + # def download_failed(self, pyfile): # if pyfile.pluginname == "BasePlugin" \ # and pyfile.hasStatus("failed") \ # and not self.getConfig('use_hoster_list') \ diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index e93da98bf..053817bef 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -65,7 +65,7 @@ class XMPPInterface(IRCInterface, JabberClient): self.start() - def packageFinished(self, pypack): + def package_finished(self, pypack): try: if self.getConfig('info_pack'): self.announce(_("Package finished: %s") % pypack.name) @@ -73,7 +73,7 @@ class XMPPInterface(IRCInterface, JabberClient): pass - def downloadFinished(self, pyfile): + def download_finished(self, pyfile): try: if self.getConfig('info_file'): self.announce( @@ -200,11 +200,11 @@ class XMPPInterface(IRCInterface, JabberClient): stream.send(m) - def beforeReconnecting(self, ip): + def before_reconnect(self, ip): self.disconnect() - def afterReconnecting(self, ip): + def after_reconnect(self, ip): self.connect() -- cgit v1.2.3 From c1764e2fea0bb05164c83a876e8cd58b97f58f25 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Jun 2015 17:31:38 +0200 Subject: Update all --- module/plugins/hooks/AlldebridComHook.py | 2 +- module/plugins/hooks/AndroidPhoneNotify.py | 3 +-- module/plugins/hooks/BypassCaptcha.py | 18 +++++++++--------- module/plugins/hooks/Captcha9Kw.py | 12 +++++------- module/plugins/hooks/CaptchaBrotherhood.py | 6 +++--- module/plugins/hooks/DeathByCaptcha.py | 8 +++++--- module/plugins/hooks/DebridItaliaComHook.py | 2 +- module/plugins/hooks/EasybytezComHook.py | 2 +- module/plugins/hooks/ExpertDecoders.py | 13 +++++++------ module/plugins/hooks/ExternalScripts.py | 5 +++-- module/plugins/hooks/ExtractArchive.py | 2 +- module/plugins/hooks/FastixRuHook.py | 2 +- module/plugins/hooks/FreeWayMeHook.py | 2 +- module/plugins/hooks/HighWayMeHook.py | 2 +- module/plugins/hooks/IRCInterface.py | 5 ++--- module/plugins/hooks/ImageTyperz.py | 17 +++++++++-------- module/plugins/hooks/LinkdecrypterComHook.py | 2 +- module/plugins/hooks/LinksnappyComHook.py | 2 +- module/plugins/hooks/MegaDebridEuHook.py | 2 +- module/plugins/hooks/MultishareCzHook.py | 2 +- module/plugins/hooks/MyfastfileComHook.py | 2 +- module/plugins/hooks/NoPremiumPlHook.py | 2 +- module/plugins/hooks/OverLoadMeHook.py | 2 +- module/plugins/hooks/PremiumToHook.py | 2 +- module/plugins/hooks/PremiumizeMeHook.py | 2 +- module/plugins/hooks/RPNetBizHook.py | 2 +- module/plugins/hooks/RapideoPlHook.py | 2 +- module/plugins/hooks/RealdebridComHook.py | 2 +- module/plugins/hooks/RehostToHook.py | 2 +- module/plugins/hooks/SimplyPremiumComHook.py | 2 +- module/plugins/hooks/SimplydebridComHook.py | 2 +- module/plugins/hooks/SkipRev.py | 3 +-- module/plugins/hooks/UpdateManager.py | 6 +++--- module/plugins/hooks/UserAgentSwitcher.py | 2 +- module/plugins/hooks/XMPPInterface.py | 2 +- 35 files changed, 72 insertions(+), 72 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridComHook.py b/module/plugins/hooks/AlldebridComHook.py index 092921134..c55f013a4 100644 --- a/module/plugins/hooks/AlldebridComHook.py +++ b/module/plugins/hooks/AlldebridComHook.py @@ -22,6 +22,6 @@ class AlldebridComHook(MultiHook): def getHosters(self): https = "https" if self.getConfig('ssl') else "http" - html = self.getURL(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip() + html = self.load(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip() return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index e775b785b..daf4c1a27 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -2,7 +2,6 @@ import time -from module.network.RequestFactory import getURL from module.plugins.internal.Hook import Hook, Expose @@ -106,7 +105,7 @@ class AndroidPhoneNotify(Hook): elif self.notifications >= self.getConfig("sendpermin"): return - getURL("http://www.notifymyandroid.com/publicapi/notify", + self.load("http://www.notifymyandroid.com/publicapi/notify", get={'apikey' : key, 'application': "pyLoad", 'event' : event, diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index bbbe96b73..1651ea067 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -3,7 +3,7 @@ import pycurl from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getURL, getRequest +from module.network.RequestFactory import getRequest from module.plugins.internal.Hook import Hook, threaded @@ -54,7 +54,7 @@ class BypassCaptcha(Hook): def getCredits(self): - res = getURL(self.GETCREDITS_URL, post={"key": self.getConfig('passkey')}) + res = self.load(self.GETCREDITS_URL, post={"key": self.getConfig('passkey')}) data = dict(x.split(' ', 1) for x in res.splitlines()) return int(data['Left']) @@ -67,12 +67,12 @@ class BypassCaptcha(Hook): req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: - res = req.load(self.SUBMIT_URL, - post={'vendor_key': self.PYLOAD_KEY, - 'key': self.getConfig('passkey'), - 'gen_task_id': "1", - 'file': (pycurl.FORM_FILE, captcha)}, - multipart=True) + res = self.load(self.SUBMIT_URL, + post={'vendor_key': self.PYLOAD_KEY, + 'key': self.getConfig('passkey'), + 'gen_task_id': "1", + 'file': (pycurl.FORM_FILE, captcha)}, + req=req) finally: req.close() @@ -89,7 +89,7 @@ class BypassCaptcha(Hook): def respond(self, ticket, success): try: - res = getURL(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig('passkey'), + res = self.load(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig('passkey'), "cv": 1 if success else 0}) except BadHeader, e: self.logError(_("Could not send response"), e) diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 85bbb7924..a67e5bfc3 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -8,8 +8,6 @@ import time from base64 import b64encode from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getURL - from module.plugins.internal.Hook import Hook, threaded @@ -48,7 +46,7 @@ class Captcha9Kw(Hook): def getCredits(self): - res = getURL(self.API_URL, + res = self.load(self.API_URL, get={'apikey': self.getConfig('passkey'), 'pyload': "1", 'source': "pyload", @@ -129,7 +127,7 @@ class Captcha9Kw(Hook): for _i in xrange(5): try: - res = getURL(self.API_URL, post=post_data) + res = self.load(self.API_URL, post=post_data) except BadHeader, e: time.sleep(3) else: @@ -144,7 +142,7 @@ class Captcha9Kw(Hook): task.data["ticket"] = res for _i in xrange(int(self.getConfig('timeout') / 5)): - result = getURL(self.API_URL, + result = self.load(self.API_URL, get={'apikey': self.getConfig('passkey'), 'id' : res, 'pyload': "1", @@ -186,7 +184,7 @@ class Captcha9Kw(Hook): pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) for _i in xrange(5): - servercheck = getURL("http://www.9kw.eu/grafik/servercheck.txt") + servercheck = self.load("http://www.9kw.eu/grafik/servercheck.txt") if queue < re.search(r'queue=(\d+)', servercheck).group(1): break @@ -227,7 +225,7 @@ class Captcha9Kw(Hook): passkey = self.getConfig('passkey') for _i in xrange(3): - res = getURL(self.API_URL, + res = self.load(self.API_URL, get={'action' : "usercaptchacorrectback", 'apikey' : passkey, 'api_key': passkey, diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 1f2bbf956..3992c6ca7 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -12,7 +12,7 @@ try: except ImportError: import Image -from module.network.RequestFactory import getURL, getRequest +from module.network.RequestFactory import getRequest from module.plugins.internal.Hook import Hook, threaded @@ -59,7 +59,7 @@ class CaptchaBrotherhood(Hook): def getCredits(self): - res = getURL(self.API_URL + "askCredits.aspx", + res = self.load(self.API_URL + "askCredits.aspx", get={"username": self.getConfig('username'), "password": self.getConfig('passkey')}) if not res.startswith("OK"): raise CaptchaBrotherhoodException(res) @@ -122,7 +122,7 @@ class CaptchaBrotherhood(Hook): def api_response(self, api, ticket): - res = getURL("%s%s.aspx" % (self.API_URL, api), + res = self.load("%s%s.aspx" % (self.API_URL, api), get={"username": self.getConfig('username'), "password": self.getConfig('passkey'), "captchaID": ticket}) diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 1ece35bdb..50331d512 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -84,9 +84,11 @@ class DeathByCaptcha(Hook): res = None try: - json = req.load("%s%s" % (self.API_URL, api), - post=post, - multipart=multipart) + json = self.load("%s%s" % (self.API_URL, api), + post=post, + multipart=multipart, + req=req) + self.logDebug(json) res = json_loads(json) diff --git a/module/plugins/hooks/DebridItaliaComHook.py b/module/plugins/hooks/DebridItaliaComHook.py index 36b307696..b9a5f1b60 100644 --- a/module/plugins/hooks/DebridItaliaComHook.py +++ b/module/plugins/hooks/DebridItaliaComHook.py @@ -23,4 +23,4 @@ class DebridItaliaComHook(MultiHook): def getHosters(self): - return self.getURL("http://debriditalia.com/api.php", get={'hosts': ""}).replace('"', '').split(',') + return self.load("http://debriditalia.com/api.php", get={'hosts': ""}).replace('"', '').split(',') diff --git a/module/plugins/hooks/EasybytezComHook.py b/module/plugins/hooks/EasybytezComHook.py index 43efb5048..951d95479 100644 --- a/module/plugins/hooks/EasybytezComHook.py +++ b/module/plugins/hooks/EasybytezComHook.py @@ -25,6 +25,6 @@ class EasybytezComHook(MultiHook): user, data = self.account.selectAccount() req = self.account.getAccountRequest(user) - html = req.load("http://www.easybytez.com") + html = self.load("http://www.easybytez.com", req=req) return re.search(r'\s*Supported sites:(.*)', html).group(1).split(',') diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 13289f8d1..af5f2cfcd 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -8,7 +8,7 @@ import uuid from base64 import b64encode from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getURL, getRequest +from module.network.RequestFactory import getRequest from module.plugins.internal.Hook import Hook, threaded @@ -36,7 +36,7 @@ class ExpertDecoders(Hook): def getCredits(self): - res = getURL(self.API_URL, post={"key": self.getConfig('passkey'), "action": "balance"}) + res = self.load(self.API_URL, post={"key": self.getConfig('passkey'), "action": "balance"}) if res.isdigit(): self.logInfo(_("%s credits left") % res) @@ -60,11 +60,12 @@ class ExpertDecoders(Hook): req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: - result = req.load(self.API_URL, - post={'action' : "upload", + result = self.load(self.API_URL, + post={'action' : "upload", 'key' : self.getConfig('passkey'), 'file' : b64encode(data), - 'gen_task_id': ticket}) + 'gen_task_id': ticket}, + req=req) finally: req.close() @@ -95,7 +96,7 @@ class ExpertDecoders(Hook): if "ticket" in task.data: try: - res = getURL(self.API_URL, + res = self.load(self.API_URL, post={'action': "refund", 'key': self.getConfig('passkey'), 'gen_task_id': task.data['ticket']}) self.logInfo(_("Request refund"), res) diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 85df87a23..6b3d21d68 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -82,11 +82,12 @@ class ExternalScripts(Hook): def callScript(self, script, *args): try: - cmd_args = [fs_encode(str(x) if not isinstance(x, basestring) else x) for x in args] - cmd = [script] + cmd_args + cmd_args = (fs_encode(x) if isinstande(x, basestring) else str(x) for x in args) #@NOTE: `fs_encode` -> `encode` in 0.4.10 self.logDebug("Executing: %s" % os.path.abspath(script), "Args: " + ' '.join(cmd_args)) + cmd = (script,) + cmd_args + p = subprocess.Popen(cmd, bufsize=-1) #@NOTE: output goes to pyload if self.getConfig('waitend'): p.communicate() diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 2c0d68f3e..c9f368e9f 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -54,8 +54,8 @@ if os.name != "nt": from pwd import getpwnam from module.plugins.internal.Hook import Hook, Expose, threaded +from module.plugins.internal.Plugin import replace_patterns from module.plugins.internal.Extractor import ArchiveError, CRCError, PasswordError -from module.plugins.internal.SimpleHoster import replace_patterns from module.utils import fs_encode, save_join as fs_join, uniqify diff --git a/module/plugins/hooks/FastixRuHook.py b/module/plugins/hooks/FastixRuHook.py index 16e30e93a..24b18cb9f 100644 --- a/module/plugins/hooks/FastixRuHook.py +++ b/module/plugins/hooks/FastixRuHook.py @@ -21,7 +21,7 @@ class FastixRuHook(MultiHook): def getHosters(self): - html = self.getURL("http://fastix.ru/api_v2", + html = self.load("http://fastix.ru/api_v2", get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y", 'sub' : "allowed_sources"}) host_list = json_loads(html) diff --git a/module/plugins/hooks/FreeWayMeHook.py b/module/plugins/hooks/FreeWayMeHook.py index b4219a953..473bd7d26 100644 --- a/module/plugins/hooks/FreeWayMeHook.py +++ b/module/plugins/hooks/FreeWayMeHook.py @@ -21,5 +21,5 @@ class FreeWayMeHook(MultiHook): def getHosters(self): user, data = self.account.selectAccount() - hostis = self.getURL("http://www.free-way.bz/ajax/jd.php", get={"id": 3, "user": user, "pass": data['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10 + hostis = self.load("http://www.free-way.bz/ajax/jd.php", get={"id": 3, "user": user, "pass": data['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10 return [x.strip() for x in hostis.split(",") if x.strip()] diff --git a/module/plugins/hooks/HighWayMeHook.py b/module/plugins/hooks/HighWayMeHook.py index ff4d3f96b..c04fc969e 100644 --- a/module/plugins/hooks/HighWayMeHook.py +++ b/module/plugins/hooks/HighWayMeHook.py @@ -21,6 +21,6 @@ class HighWayMeHook(MultiHook): def getHosters(self): - json_data = json_loads(self.getURL("https://high-way.me/api.php", + json_data = json_loads(self.load("https://high-way.me/api.php", get={'hoster': 1})) return [element['name'] for element in json_data['hoster']] diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index e24691bde..9176f2d2c 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -11,7 +11,6 @@ from select import select from threading import Thread from module.Api import PackageDoesNotExists, FileDoesNotExists -from module.network.RequestFactory import getURL from module.plugins.internal.Hook import Hook from module.utils import formatSize @@ -76,8 +75,8 @@ class IRCInterface(Thread, Hook): task.handler.append(self) task.setWaiting(60) - html = getURL("http://www.freeimagehosting.net/upload.php", - post={"attached": (pycurl.FORM_FILE, task.captchaFile)}, multipart=True) + html = self.load("http://www.freeimagehosting.net/upload.php", + post={"attached": (pycurl.FORM_FILE, task.captchaFile)}) url = re.search(r"\[img\]([^\[]+)\[/img\]\[/url\]", html).group(1) self.response(_("New Captcha Request: %s") % url) diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 7fb642250..15097fd5a 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -7,7 +7,7 @@ import re from base64 import b64encode -from module.network.RequestFactory import getURL, getRequest +from module.network.RequestFactory import getRequest from module.plugins.internal.Hook import Hook, threaded @@ -56,7 +56,7 @@ class ImageTyperz(Hook): def getCredits(self): - res = getURL(self.GETCREDITS_URL, + res = self.load(self.GETCREDITS_URL, post={'action': "REQUESTBALANCE", 'username': self.getConfig('username'), 'password': self.getConfig('passkey')}) @@ -89,11 +89,12 @@ class ImageTyperz(Hook): data = f.read() data = b64encode(data) - res = req.load(self.SUBMIT_URL, - post={'action': "UPLOADCAPTCHA", - 'username': self.getConfig('username'), - 'password': self.getConfig('passkey'), "file": data}, - multipart=multipart) + res = self.load(self.SUBMIT_URL, + post={'action': "UPLOADCAPTCHA", + 'username': self.getConfig('username'), + 'password': self.getConfig('passkey'), "file": data}, + multipart=multipart, + req=req) finally: req.close() @@ -134,7 +135,7 @@ class ImageTyperz(Hook): def captcha_invalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: - res = getURL(self.RESPOND_URL, + res = self.load(self.RESPOND_URL, post={'action': "SETBADIMAGE", 'username': self.getConfig('username'), 'password': self.getConfig('passkey'), diff --git a/module/plugins/hooks/LinkdecrypterComHook.py b/module/plugins/hooks/LinkdecrypterComHook.py index b2eaece62..76167524b 100644 --- a/module/plugins/hooks/LinkdecrypterComHook.py +++ b/module/plugins/hooks/LinkdecrypterComHook.py @@ -23,7 +23,7 @@ class LinkdecrypterComHook(MultiHook): def getHosters(self): list = re.search(r'>Supported\(\d+\): (.[\w.\-, ]+)', - self.getURL("http://linkdecrypter.com/", decode=True).replace("(g)", "")).group(1).split(', ') + self.load("http://linkdecrypter.com/").replace("(g)", "")).group(1).split(', ') try: list.remove("download.serienjunkies.org") except ValueError: diff --git a/module/plugins/hooks/LinksnappyComHook.py b/module/plugins/hooks/LinksnappyComHook.py index 72282575b..d1bd19f1e 100644 --- a/module/plugins/hooks/LinksnappyComHook.py +++ b/module/plugins/hooks/LinksnappyComHook.py @@ -21,7 +21,7 @@ class LinksnappyComHook(MultiHook): def getHosters(self): - json_data = self.getURL("http://gen.linksnappy.com/lseAPI.php", get={'act': "FILEHOSTS"}) + json_data = self.load("http://gen.linksnappy.com/lseAPI.php", get={'act': "FILEHOSTS"}) json_data = json_loads(json_data) return json_data['return'].keys() diff --git a/module/plugins/hooks/MegaDebridEuHook.py b/module/plugins/hooks/MegaDebridEuHook.py index 0de7b4dcf..0e18f6f9d 100644 --- a/module/plugins/hooks/MegaDebridEuHook.py +++ b/module/plugins/hooks/MegaDebridEuHook.py @@ -21,7 +21,7 @@ class MegaDebridEuHook(MultiHook): def getHosters(self): - reponse = self.getURL("http://www.mega-debrid.eu/api.php", get={'action': "getHosters"}) + reponse = self.load("http://www.mega-debrid.eu/api.php", get={'action': "getHosters"}) json_data = json_loads(reponse) if json_data['response_code'] == "ok": diff --git a/module/plugins/hooks/MultishareCzHook.py b/module/plugins/hooks/MultishareCzHook.py index 6052b7673..c3e923d9b 100644 --- a/module/plugins/hooks/MultishareCzHook.py +++ b/module/plugins/hooks/MultishareCzHook.py @@ -25,5 +25,5 @@ class MultishareCzHook(MultiHook): def getHosters(self): - html = self.getURL("http://www.multishare.cz/monitoring/") + html = self.load("http://www.multishare.cz/monitoring/") return re.findall(self.HOSTER_PATTERN, html) diff --git a/module/plugins/hooks/MyfastfileComHook.py b/module/plugins/hooks/MyfastfileComHook.py index 20a1cfac2..10d128a31 100644 --- a/module/plugins/hooks/MyfastfileComHook.py +++ b/module/plugins/hooks/MyfastfileComHook.py @@ -21,7 +21,7 @@ class MyfastfileComHook(MultiHook): def getHosters(self): - json_data = self.getURL("http://myfastfile.com/api.php", get={'hosts': ""}, decode=True) + json_data = self.load("http://myfastfile.com/api.php", get={'hosts': ""}) self.logDebug("JSON data", json_data) json_data = json_loads(json_data) diff --git a/module/plugins/hooks/NoPremiumPlHook.py b/module/plugins/hooks/NoPremiumPlHook.py index b5a007ff9..264f3462a 100644 --- a/module/plugins/hooks/NoPremiumPlHook.py +++ b/module/plugins/hooks/NoPremiumPlHook.py @@ -21,7 +21,7 @@ class NoPremiumPlHook(MultiHook): def getHosters(self): - hostings = json_loads(self.getURL("https://www.nopremium.pl/clipboard.php?json=3").strip()) + hostings = json_loads(self.load("https://www.nopremium.pl/clipboard.php?json=3").strip()) hostings_domains = [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] self.logDebug(hostings_domains) diff --git a/module/plugins/hooks/OverLoadMeHook.py b/module/plugins/hooks/OverLoadMeHook.py index d608a2ecd..a618938a4 100644 --- a/module/plugins/hooks/OverLoadMeHook.py +++ b/module/plugins/hooks/OverLoadMeHook.py @@ -22,7 +22,7 @@ class OverLoadMeHook(MultiHook): def getHosters(self): https = "https" if self.getConfig('ssl') else "http" - html = self.getURL(https + "://api.over-load.me/hoster.php", + html = self.load(https + "://api.over-load.me/hoster.php", get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip() self.logDebug("Hosterlist", html) diff --git a/module/plugins/hooks/PremiumToHook.py b/module/plugins/hooks/PremiumToHook.py index 11f0f3c8a..63e3c72c8 100644 --- a/module/plugins/hooks/PremiumToHook.py +++ b/module/plugins/hooks/PremiumToHook.py @@ -23,6 +23,6 @@ class PremiumToHook(MultiHook): def getHosters(self): user, data = self.account.selectAccount() - html = self.getURL("http://premium.to/api/hosters.php", + html = self.load("http://premium.to/api/hosters.php", get={'username': user, 'password': data['password']}) return [x.strip() for x in html.replace("\"", "").split(";")] diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py index 35ad70970..bc803b1f5 100644 --- a/module/plugins/hooks/PremiumizeMeHook.py +++ b/module/plugins/hooks/PremiumizeMeHook.py @@ -26,7 +26,7 @@ class PremiumizeMeHook(MultiHook): # Get supported hosters list from premiumize.me using the # json API v1 (see https://secure.premiumize.me/?show=api) - answer = self.getURL("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10 + answer = self.load("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10 get={'method': "hosterlist", 'params[login]': user, 'params[pass]': data['password']}) data = json_loads(answer) diff --git a/module/plugins/hooks/RPNetBizHook.py b/module/plugins/hooks/RPNetBizHook.py index 10332948d..872eb7e08 100644 --- a/module/plugins/hooks/RPNetBizHook.py +++ b/module/plugins/hooks/RPNetBizHook.py @@ -24,7 +24,7 @@ class RPNetBizHook(MultiHook): # Get account data user, data = self.account.selectAccount() - res = self.getURL("https://premium.rpnet.biz/client_api.php", + res = self.load("https://premium.rpnet.biz/client_api.php", get={'username': user, 'password': data['password'], 'action': "showHosterList"}) hoster_list = json_loads(res) diff --git a/module/plugins/hooks/RapideoPlHook.py b/module/plugins/hooks/RapideoPlHook.py index 0400f07ba..f498def2a 100644 --- a/module/plugins/hooks/RapideoPlHook.py +++ b/module/plugins/hooks/RapideoPlHook.py @@ -21,7 +21,7 @@ class RapideoPlHook(MultiHook): def getHosters(self): - hostings = json_loads(self.getURL("https://www.rapideo.pl/clipboard.php?json=3").strip()) + hostings = json_loads(self.load("https://www.rapideo.pl/clipboard.php?json=3").strip()) hostings_domains = [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] self.logDebug(hostings_domains) diff --git a/module/plugins/hooks/RealdebridComHook.py b/module/plugins/hooks/RealdebridComHook.py index aa0c9f640..d1a503136 100644 --- a/module/plugins/hooks/RealdebridComHook.py +++ b/module/plugins/hooks/RealdebridComHook.py @@ -22,6 +22,6 @@ class RealdebridComHook(MultiHook): def getHosters(self): https = "https" if self.getConfig('ssl') else "http" - html = self.getURL(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip() + html = self.load(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip() return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/RehostToHook.py b/module/plugins/hooks/RehostToHook.py index a2415129a..febad818a 100644 --- a/module/plugins/hooks/RehostToHook.py +++ b/module/plugins/hooks/RehostToHook.py @@ -21,7 +21,7 @@ class RehostToHook(MultiHook): def getHosters(self): user, data = self.account.selectAccount() - html = self.getURL("http://rehost.to/api.php", + html = self.load("http://rehost.to/api.php", get={'cmd' : "get_supported_och_dl", 'long_ses': self.account.getAccountInfo(user)['session']}) return [x.strip() for x in html.replace("\"", "").split(",")] diff --git a/module/plugins/hooks/SimplyPremiumComHook.py b/module/plugins/hooks/SimplyPremiumComHook.py index 116e3a76e..e211abd30 100644 --- a/module/plugins/hooks/SimplyPremiumComHook.py +++ b/module/plugins/hooks/SimplyPremiumComHook.py @@ -21,7 +21,7 @@ class SimplyPremiumComHook(MultiHook): def getHosters(self): - json_data = self.getURL("http://www.simply-premium.com/api/hosts.php", get={'format': "json", 'online': 1}) + json_data = self.load("http://www.simply-premium.com/api/hosts.php", get={'format': "json", 'online': 1}) json_data = json_loads(json_data) host_list = [element['regex'] for element in json_data['result']] diff --git a/module/plugins/hooks/SimplydebridComHook.py b/module/plugins/hooks/SimplydebridComHook.py index 01629df99..b844aad49 100644 --- a/module/plugins/hooks/SimplydebridComHook.py +++ b/module/plugins/hooks/SimplydebridComHook.py @@ -20,5 +20,5 @@ class SimplydebridComHook(MultiHook): def getHosters(self): - html = self.getURL("http://simply-debrid.com/api.php", get={'list': 1}) + html = self.load("http://simply-debrid.com/api.php", get={'list': 1}) return [x.strip() for x in html.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 0457f9b55..32454d255 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -8,7 +8,6 @@ from types import MethodType from module.PyFile import PyFile from module.plugins.internal.Hook import Hook -from module.plugins.internal.Plugin import Skip class SkipRev(Hook): @@ -35,7 +34,7 @@ class SkipRev(Hook): def _setup(self): self.pyfile.plugin._setup() if self.pyfile.hasStatus("skipped"): - raise Skip(self.pyfile.statusname or self.pyfile.pluginname) + self.skip(self.pyfile.statusname or self.pyfile.pluginname) def _name(self, pyfile): diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index f555e4ff3..26b0cc448 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -9,7 +9,6 @@ import time from operator import itemgetter -from module.network.RequestFactory import getURL from module.plugins.internal.Hook import Expose, Hook, threaded from module.utils import save_join as fs_join @@ -128,7 +127,8 @@ class UpdateManager(Hook): def server_response(self): try: - return getURL(self.SERVER_URL, get={'v': self.core.api.getServerVersion()}).splitlines() + return self.load(self.SERVER_URL, + get={'v': self.core.api.getServerVersion()}).splitlines() except Exception: self.logWarning(_("Unable to retrieve server to get updates")) @@ -253,7 +253,7 @@ class UpdateManager(Hook): 'oldver': oldver, 'newver': newver}) try: - content = getURL(url % plugin) + content = self.load(url % plugin) m = VERSION.search(content) if m and m.group(2) == version: diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py index 0504ec9d0..ea2d84a43 100644 --- a/module/plugins/hooks/UserAgentSwitcher.py +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -30,7 +30,7 @@ class UserAgentSwitcher(Hook): def download_preparing(self, pyfile): connecttimeout = self.getConfig('connecttimeout') maxredirs = self.getConfig('maxredirs') - useragent = self.getConfig('useragent').encode("utf8", "replace") #@TODO: Remove `encode` in 0.4.10 + useragent = self.getConfig('useragent') if connecttimeout: pyfile.plugin.req.http.c.setopt(pycurl.CONNECTTIMEOUT, connecttimeout) diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 053817bef..f93273df4 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -123,7 +123,7 @@ class XMPPInterface(IRCInterface, JabberClient): subject = stanza.get_subject() body = stanza.get_body() t = stanza.get_type() - self.logDebug("Message from %s received." % unicode(stanza.get_from())) + self.logDebug("Message from %s received." % stanza.get_from()) self.logDebug("Body: %s Subject: %s Type: %s" % (body, subject, t)) if t == "headline": -- cgit v1.2.3 From 164512b6a74c94a731fcee7435dce1ccfa2f71e7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:29:50 +0200 Subject: Spare code cosmetics --- module/plugins/hooks/Checksum.py | 4 +-- module/plugins/hooks/ClickAndLoad.py | 6 ++-- module/plugins/hooks/DeleteFinished.py | 4 ++- module/plugins/hooks/ExternalScripts.py | 36 +++++++++++----------- module/plugins/hooks/ExtractArchive.py | 32 ++++++++++++-------- module/plugins/hooks/IRCInterface.py | 4 ++- module/plugins/hooks/MergeFiles.py | 4 +-- module/plugins/hooks/MultiHome.py | 4 +-- module/plugins/hooks/UnSkipOnFail.py | 2 +- module/plugins/hooks/UpdateManager.py | 19 +++++++----- module/plugins/hooks/XMPPInterface.py | 53 ++++++++++++++++++++++----------- 11 files changed, 102 insertions(+), 66 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 9287fda9c..912a1ba1f 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -104,7 +104,7 @@ class Checksum(Hook): self.checkFailed(pyfile, None, "No file downloaded") local_file = fs_encode(pyfile.plugin.lastDownload) - #download_folder = self.core.config['general']['download_folder'] + #download_folder = self.core.config.get("general", "download_folder") #local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name)) if not os.path.isfile(local_file): @@ -165,7 +165,7 @@ class Checksum(Hook): def package_finished(self, pypack): - download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder, "") + download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder, "") for link in pypack.getChildren().itervalues(): file_type = os.path.splitext(link['name'])[1][1:].lower() diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 81a446ef3..f7431ebac 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -49,11 +49,11 @@ class ClickAndLoad(Hook): def activate(self): - if not self.core.config['webinterface']['activated']: + if not self.core.config.get("webinterface", "activated"): return ip = "" if self.getConfig('extern') else "127.0.0.1" - webport = self.core.config['webinterface']['port'] + webport = self.core.config.get("webinterface", "port") cnlport = self.getConfig('port') self.proxy(ip, webport, cnlport) @@ -85,7 +85,7 @@ class ClickAndLoad(Hook): server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if self.core.config['webinterface']['https']: + if self.core.config.get("webinterface", "https"): try: server_socket = ssl.wrap_socket(server_socket) diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 38d2a7ed0..86532cdad 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -70,7 +70,9 @@ class DeleteFinished(Hook): ## event managing ## def addEvent(self, event, func): - """Adds an event listener for event name""" + """ + Adds an event listener for event name + """ if event in self.manager.events: if func in self.manager.events[event]: self.logDebug("Function already registered", func) diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 6b3d21d68..29b43929e 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -126,10 +126,10 @@ class ExternalScripts(Hook): def download_failed(self, pyfile): - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pyfile.package().folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pyfile.package().folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['download_failed']: file = fs_join(download_folder, pyfile.name) @@ -137,10 +137,10 @@ class ExternalScripts(Hook): def download_finished(self, pyfile): - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pyfile.package().folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pyfile.package().folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['download_finished']: file = fs_join(download_folder, pyfile.name) @@ -158,10 +158,10 @@ class ExternalScripts(Hook): def package_finished(self, pypack): - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_finished']: self.callScript(script, pypack.id, pypack.name, download_folder, pypack.password) @@ -170,30 +170,30 @@ class ExternalScripts(Hook): def packageDeleted(self, pid): pack = self.core.api.getPackageInfo(pid) - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pack.folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pack.folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_deleted']: self.callScript(script, pack.id, pack.name, download_folder, pack.password) def package_extract_failed(self, pypack): - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_extract_failed']: self.callScript(script, pypack.id, pypack.name, download_folder, pypack.password) def package_extracted(self, pypack): - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_extracted']: self.callScript(script, pypack.id, pypack.name, download_folder) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index c9f368e9f..ee41068eb 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -25,8 +25,10 @@ if sys.version_info < (2, 7) and os.name != "nt": # unsued timeout option for older python version def wait(self, timeout=0): - """Wait for child process to terminate. Returns returncode - attribute.""" + """ + Wait for child process to terminate. Returns returncode + attribute. + """ if self.returncode is None: try: pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0) @@ -209,7 +211,9 @@ class ExtractArchive(Hook): @Expose def extractPackage(self, *ids): - """ Extract packages with given id""" + """ + Extract packages with given id + """ for id in ids: self.queue.add(id) if not self.getConfig('waitall') and not self.extracting: @@ -261,7 +265,7 @@ class ExtractArchive(Hook): # reload from txt file self.reloadPasswords() - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") # iterate packages -> extractors -> targets for pid in ids: @@ -510,7 +514,9 @@ class ExtractArchive(Hook): @Expose def getPasswords(self, reload=True): - """ List of saved passwords """ + """ + List of saved passwords + """ if reload: self.reloadPasswords() @@ -535,7 +541,9 @@ class ExtractArchive(Hook): @Expose def addPassword(self, password): - """ Adds a password to saved list""" + """ + Adds a password to saved list + """ try: self.passwords = uniqify([password] + self.passwords) @@ -554,16 +562,16 @@ class ExtractArchive(Hook): continue try: - if self.core.config['permission']['change_file']: + if self.core.config.get("permission", "change_file"): if os.path.isfile(f): - os.chmod(f, int(self.core.config['permission']['file'], 8)) + os.chmod(f, int(self.core.config.get("permission", "file"), 8)) elif os.path.isdir(f): - os.chmod(f, int(self.core.config['permission']['folder'], 8)) + os.chmod(f, int(self.core.config.get("permission", "folder"), 8)) - if self.core.config['permission']['change_dl'] and os.name != "nt": - uid = getpwnam(self.core.config['permission']['user'])[2] - gid = getgrnam(self.core.config['permission']['group'])[2] + if self.core.config.get("permission", "change_dl") and os.name != "nt": + uid = getpwnam(self.core.config.get("permission", "user"))[2] + gid = getgrnam(self.core.config.get("permission", "group"))[2] os.chown(f, uid, gid) except Exception, e: diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 9176f2d2c..d50fd6107 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -392,7 +392,9 @@ class IRCInterface(Thread, Hook): def event_c(self, args): - """ captcha answer """ + """ + Captcha answer + """ if not args: return ["ERROR: Captcha ID missing."] diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 0b0f7e475..64ab50400 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -43,9 +43,9 @@ class MergeFiles(Hook): files[data['name'][:-4]].sort() fid_dict[data['name']] = fid - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") - if self.core.config['general']['folder_per_package']: + if self.core.config.get("general", "folder_per_package"): download_folder = fs_join(download_folder, pack.folder) for name, file_list in files.iteritems(): diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index fe7f39a12..790d5dab3 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -12,7 +12,7 @@ class MultiHome(Hook): __config__ = [("interfaces", "str", "Interfaces", "None")] - __description__ = """Ip address changer""" + __description__ = """IP address changer""" __license__ = "GPLv3" __authors__ = [("mkaay", "mkaay@mkaay.de")] @@ -28,7 +28,7 @@ class MultiHome(Hook): self.parseInterfaces(self.getConfig('interfaces').split(";")) if not self.interfaces: - self.parseInterfaces([self.core.config['download']['interface']]) + self.parseInterfaces([self.core.config.get("download", "interface")]) self.setConfig("interfaces", self.toConfig()) diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 234e1052b..9ba53a698 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -55,7 +55,7 @@ class UnSkipOnFail(Hook): def findDuplicate(self, pyfile): - """ Search all packages for duplicate links to "pyfile". + """Search all packages for duplicate links to "pyfile". Duplicates are links that would overwrite "pyfile". To test on duplicity the package-folder and link-name of twolinks are compared (link.name). diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 26b0cc448..0a89405e7 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -97,7 +97,9 @@ class UpdateManager(Hook): @Expose def autoreloadPlugins(self): - """ reload and reindex all modified plugins """ + """ + Reload and reindex all modified plugins + """ modules = filter( lambda m: m and (m.__name__.startswith("module.plugins.") or m.__name__.startswith("userplugins.")) and @@ -137,8 +139,9 @@ class UpdateManager(Hook): @Expose @threaded def update(self): - """ check for updates """ - + """ + Check for updates + """ if self._update() is 2 and self.getConfig('autorestart'): if not self.core.api.statusDownloads(): self.core.api.restart() @@ -179,8 +182,9 @@ class UpdateManager(Hook): def _updatePlugins(self, data): - """ check for plugin updates """ - + """ + Check for plugin updates + """ exitcode = 0 updated = [] @@ -290,8 +294,9 @@ class UpdateManager(Hook): @Expose def removePlugins(self, type_plugins): - """ delete plugins from disk """ - + """ + Delete plugins from disk + """ if not type_plugins: return diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index f93273df4..847fb26c3 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -92,9 +92,11 @@ class XMPPInterface(IRCInterface, JabberClient): def stream_state_changed(self, state, arg): - """This one is called when the state of stream connecting the component + """ + This one is called when the state of stream connecting the component to a server changes. This will usually be used to let the user - know what is going on.""" + know what is going on. + """ self.logDebug("*** State changed: %s %r ***" % (state, arg)) @@ -111,15 +113,19 @@ class XMPPInterface(IRCInterface, JabberClient): def get_message_handlers(self): - """Return list of (message_type, message_handler) tuples. + """ + Return list of (message_type, message_handler) tuples. The handlers returned will be called when matching message is received - in a client session.""" + in a client session. + """ return [("normal", self.message)] def message(self, stanza): - """Message handler for the component.""" + """ + Message handler for the component. + """ subject = stanza.get_subject() body = stanza.get_body() t = stanza.get_type() @@ -181,7 +187,9 @@ class XMPPInterface(IRCInterface, JabberClient): def announce(self, message): - """ send message to all owners""" + """ + Send message to all owners + """ for user in self.getConfig('owners').split(";"): self.logDebug("Send message to", user) @@ -209,42 +217,53 @@ class XMPPInterface(IRCInterface, JabberClient): class VersionHandler(object): - """Provides handler for a version query. + """ + Provides handler for a version query. This class will answer version query and announce 'jabber:iq:version' namespace - in the client's disco#info results.""" - + in the client's disco#info results. + """ implements(IIqHandlersProvider, IFeaturesProvider) def __init__(self, client): - """Just remember who created this.""" + """ + Just remember who created this. + """ self.client = client def get_features(self): - """Return namespace which should the client include in its reply to a - disco#info query.""" + """ + Return namespace which should the client include in its reply to a + disco#info query. + """ return ["jabber:iq:version"] def get_iq_get_handlers(self): - """Return list of tuples (element_name, namespace, handler) describing - handlers of stanzas""" + """ + Return list of tuples (element_name, namespace, handler) describing + handlers of stanzas + """ return [("query", "jabber:iq:version", self.get_version)] def get_iq_set_handlers(self): - """Return empty list, as this class provides no stanza handler.""" + """ + Return empty list, as this class provides no stanza handler. + """ return [] def get_version(self, iq): - """Handler for jabber:iq:version queries. + """ + Handler for jabber:iq:version queries. jabber:iq:version queries are not supported directly by PyXMPP, so the XML node is accessed directly through the libxml2 API. This should be - used very carefully!""" + used very carefully! + """ iq = iq.make_result_response() q = iq.new_query("jabber:iq:version") q.newTextChild(q.ns(), "name", "Echo component") -- cgit v1.2.3 From 20b6a2ec022202b0efb6cb69415239fb8f4d1445 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 18:59:20 +0200 Subject: Spare code cosmetics (2) --- module/plugins/hooks/AntiVirus.py | 3 +-- module/plugins/hooks/Checksum.py | 4 ++-- module/plugins/hooks/ClickAndLoad.py | 2 +- module/plugins/hooks/DeleteFinished.py | 14 +++++++------- module/plugins/hooks/DownloadScheduler.py | 2 +- module/plugins/hooks/ExtractArchive.py | 18 +++++++++--------- module/plugins/hooks/IRCInterface.py | 6 +++--- module/plugins/hooks/PremiumizeMeHook.py | 10 +++++----- module/plugins/hooks/RPNetBizHook.py | 6 +++--- module/plugins/hooks/RestartFailed.py | 22 +++++++++++----------- module/plugins/hooks/SkipRev.py | 5 ++--- module/plugins/hooks/UnSkipOnFail.py | 17 ++++++++--------- module/plugins/hooks/UpdateManager.py | 16 ++++++++-------- module/plugins/hooks/XFileSharingPro.py | 22 +++++++++++----------- module/plugins/hooks/XMPPInterface.py | 10 +++++----- 15 files changed, 77 insertions(+), 80 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 1faa6ebe3..02b1df67b 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -113,7 +113,6 @@ class AntiVirus(Hook): def download_failed(self, pyfile): - #: Check if pyfile is still "failed", - # maybe might has been restarted in meantime + #: Check if pyfile is still "failed", maybe might has been restarted in meantime if pyfile.status == 8 and self.getConfig('scanfailed'): return self.scan(pyfile) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 912a1ba1f..df81be384 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -110,7 +110,7 @@ class Checksum(Hook): if not os.path.isfile(local_file): self.checkFailed(pyfile, None, "File does not exist") - # validate file size + #: validate file size if "size" in data: api_size = int(data['size']) file_size = os.path.getsize(local_file) @@ -121,7 +121,7 @@ class Checksum(Hook): data.pop('size', None) - # validate checksum + #: validate checksum if data and self.getConfig('check_checksum'): if not 'md5' in data: diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index f7431ebac..b1009420a 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -22,7 +22,7 @@ def forward(source, destination): bufdata = source.recv(bufsize) finally: destination.shutdown(socket.SHUT_WR) - # destination.close() + #: destination.close() #@TODO: IPv6 support diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 86532cdad..a3e171a43 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -23,7 +23,7 @@ class DeleteFinished(Hook): ## overwritten methods ## def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - # self.event_list = ["pluginConfigChanged"] + #: self.event_list = ["pluginConfigChanged"] self.interval = self.MIN_CHECK_INTERVAL @@ -38,10 +38,10 @@ class DeleteFinished(Hook): self.addEvent('package_finished', self.wakeup) - # def pluginConfigChanged(self, plugin, name, value): - # if name == "interval" and value != self.interval: - # self.interval = value * 3600 - # self.init_periodical() + #: def pluginConfigChanged(self, plugin, name, value): + #: if name == "interval" and value != self.interval: + #: self.interval = value * 3600 + #: self.init_periodical() def deactivate(self): @@ -50,8 +50,8 @@ class DeleteFinished(Hook): def activate(self): self.info['sleep'] = True - # interval = self.getConfig('interval') - # self.pluginConfigChanged(self.__name__, 'interval', interval) + #: interval = self.getConfig('interval') + #: self.pluginConfigChanged(self.__name__, 'interval', interval) self.interval = max(self.MIN_CHECK_INTERVAL, self.getConfig('interval') * 60 * 60) self.addEvent('package_finished', self.wakeup) diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 773de7c4b..0ccc8a0ec 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -26,7 +26,7 @@ class DownloadScheduler(Hook): def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - self.cb = None # callback to scheduler job; will be by removed hookmanager when hook unloaded + self.cb = None #: callback to scheduler job; will be by removed hookmanager when hook unloaded def activate(self): diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index ee41068eb..925976bc6 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -23,7 +23,7 @@ if sys.version_info < (2, 7) and os.name != "nt": raise - # unsued timeout option for older python version + #: unsued timeout option for older python version def wait(self, timeout=0): """ Wait for child process to terminate. Returns returncode @@ -36,9 +36,9 @@ if sys.version_info < (2, 7) and os.name != "nt": except OSError, e: if e.errno != errno.ECHILD: raise - # This happens if SIGCLD is set to be ignored or waiting - # for child processes has otherwise been disabled for our - # process. This child is dead, we can't get the status. + #: This happens if SIGCLD is set to be ignored or waiting + #: for child processes has otherwise been disabled for our + #: process. This child is dead, we can't get the status. sts = 0 self._handle_exitstatus(sts) return self.returncode @@ -262,12 +262,12 @@ class ExtractArchive(Hook): if extensions: self.logDebug("Use for extensions: %s" % "|.".join(extensions)) - # reload from txt file + #: reload from txt file self.reloadPasswords() download_folder = self.core.config.get("general", "download_folder") - # iterate packages -> extractors -> targets + #: iterate packages -> extractors -> targets for pid in ids: pypack = self.core.files.getPackage(pid) @@ -277,7 +277,7 @@ class ExtractArchive(Hook): self.logInfo(_("Check package: %s") % pypack.name) - # determine output folder + #: determine output folder out = fs_join(download_folder, pypack.folder, destination, "") #: force trailing slash if subfolder: @@ -291,7 +291,7 @@ class ExtractArchive(Hook): files_ids = dict((pylink['name'],((fs_join(download_folder, pypack.folder, pylink['name'])), pylink['id'], out)) for pylink \ in sorted(pypack.getChildren().itervalues(), key=lambda k: k['name'])).values() #: remove duplicates - # check as long there are unseen files + #: check as long there are unseen files while files_ids: new_files_ids = [] @@ -341,7 +341,7 @@ class ExtractArchive(Hook): success = False continue - # remove processed file and related multiparts from list + #: remove processed file and related multiparts from list files_ids = [(fname, fid, fout) for fname, fid, fout in files_ids \ if fname not in archive.getDeleteFiles()] self.logDebug("Extracted files: %s" % new_files) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index d50fd6107..61922f657 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -84,7 +84,7 @@ class IRCInterface(Thread, Hook): def run(self): - # connect to IRC etc. + #: connect to IRC etc. self.sock = socket.socket() host = self.getConfig('host') self.sock.connect((host, self.getConfig('port'))) @@ -158,7 +158,7 @@ class IRCInterface(Thread, Hook): if msg['action'] != "PRIVMSG": return - # HANDLE CTCP ANTI FLOOD/BOT PROTECTION + #: HANDLE CTCP ANTI FLOOD/BOT PROTECTION if msg['text'] == "\x01VERSION\x01": self.logDebug("Sending CTCP VERSION") self.sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface")) @@ -344,7 +344,7 @@ class IRCInterface(Thread, Hook): return ["INFO: Added %d links to Package %s [#%d]" % (len(links), pack['name'], id)] except Exception: - # create new package + #: create new package id = self.core.api.addPackage(pack, links, 1) return ["INFO: Created new Package %s [#%d] with %d links." % (pack, id, len(links))] diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py index bc803b1f5..615c6c2d8 100644 --- a/module/plugins/hooks/PremiumizeMeHook.py +++ b/module/plugins/hooks/PremiumizeMeHook.py @@ -21,18 +21,18 @@ class PremiumizeMeHook(MultiHook): def getHosters(self): - # Get account data + #: Get account data user, data = self.account.selectAccount() - # Get supported hosters list from premiumize.me using the - # json API v1 (see https://secure.premiumize.me/?show=api) + #: Get supported hosters list from premiumize.me using the + #: json API v1 (see https://secure.premiumize.me/?show=api) answer = self.load("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10 get={'method': "hosterlist", 'params[login]': user, 'params[pass]': data['password']}) data = json_loads(answer) - # If account is not valid thera are no hosters available + #: If account is not valid thera are no hosters available if data['status'] != 200: return [] - # Extract hosters from json file + #: Extract hosters from json file return data['result']['hosterlist'] diff --git a/module/plugins/hooks/RPNetBizHook.py b/module/plugins/hooks/RPNetBizHook.py index 872eb7e08..8b3dd6ea1 100644 --- a/module/plugins/hooks/RPNetBizHook.py +++ b/module/plugins/hooks/RPNetBizHook.py @@ -21,16 +21,16 @@ class RPNetBizHook(MultiHook): def getHosters(self): - # Get account data + #: Get account data user, data = self.account.selectAccount() res = self.load("https://premium.rpnet.biz/client_api.php", get={'username': user, 'password': data['password'], 'action': "showHosterList"}) hoster_list = json_loads(res) - # If account is not valid thera are no hosters available + #: If account is not valid thera are no hosters available if 'error' in hoster_list: return [] - # Extract hosters from json file + #: Extract hosters from json file return hoster_list['hosters'] diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 153b4716c..0c74a544a 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -18,15 +18,15 @@ class RestartFailed(Hook): MIN_CHECK_INTERVAL = 15 * 60 #: 15 minutes - # def pluginConfigChanged(self, plugin, name, value): - # if name == "interval": - # interval = value * 60 - # if self.MIN_CHECK_INTERVAL <= interval != self.interval: - # self.core.scheduler.removeJob(self.cb) - # self.interval = interval - # self.init_periodical() - # else: - # self.logDebug("Invalid interval value, kept current") + #: def pluginConfigChanged(self, plugin, name, value): + #: if name == "interval": + #: interval = value * 60 + #: if self.MIN_CHECK_INTERVAL <= interval != self.interval: + #: self.core.scheduler.removeJob(self.cb) + #: self.interval = interval + #: self.init_periodical() + #: else: + #: self.logDebug("Invalid interval value, kept current") def periodical(self): @@ -36,10 +36,10 @@ class RestartFailed(Hook): def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - # self.event_list = ["pluginConfigChanged"] + #: self.event_list = ["pluginConfigChanged"] self.interval = self.MIN_CHECK_INTERVAL def activate(self): - # self.pluginConfigChanged(self.__name__, "interval", self.getConfig('interval')) + #: self.pluginConfigChanged(self.__name__, "interval", self.getConfig('interval')) self.interval = max(self.MIN_CHECK_INTERVAL, self.getConfig('interval') * 60) diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 32454d255..503833d53 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -79,14 +79,13 @@ class SkipRev(Hook): pyfile.setCustomStatus("SkipRev", "skipped") if not hasattr(pyfile.plugin, "_setup"): - # Work-around: inject status checker inside the preprocessing routine of the plugin + #: Work-around: inject status checker inside the preprocessing routine of the plugin pyfile.plugin._setup = pyfile.plugin.setup pyfile.plugin.setup = MethodType(self._setup, pyfile.plugin) def download_failed(self, pyfile): - #: Check if pyfile is still "failed", - # maybe might has been restarted in meantime + #: Check if pyfile is still "failed", maybe might has been restarted in meantime if pyfile.status != 8 or pyfile.name.rsplit('.', 1)[-1].strip() not in ("rar", "rev"): return diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 9ba53a698..cbfbff1b6 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -24,8 +24,7 @@ class UnSkipOnFail(Hook): def download_failed(self, pyfile): - #: Check if pyfile is still "failed", - # maybe might has been restarted in meantime + #: Check if pyfile is still "failed", maybe might has been restarted in meantime if pyfile.status != 8: return @@ -36,13 +35,13 @@ class UnSkipOnFail(Hook): if link: self.logInfo(_("Queue found duplicate: %s (pid:%s)") % (link.name, link.packageID)) - #: Change status of "link" to "new_status". - # "link" has to be a valid FileData object, - # "new_status" has to be a valid status name - # (i.e. "queued" for this Plugin) - # It creates a temporary PyFile object using - # "link" data, changes its status, and tells - # the core.files-manager to save its data. + # Change status of "link" to "new_status". + # "link" has to be a valid FileData object, + # "new_status" has to be a valid status name + # (i.e. "queued" for this Plugin) + # It creates a temporary PyFile object using + # "link" data, changes its status, and tells + # the core.files-manager to save its data. pylink = self._pyfile(link) pylink.setCustomStatus(_("unskipped"), "queued") diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 0a89405e7..a06ed97e9 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -174,10 +174,10 @@ class UpdateManager(Hook): exitcode = 3 # Exit codes: - # -1 = No plugin updated, new pyLoad version available - # 0 = No plugin updated - # 1 = Plugins updated - # 2 = Plugins updated, but restart required + # -1 = No plugin updated, new pyLoad version available + # 0 = No plugin updated + # 1 = Plugins updated + # 2 = Plugins updated, but restart required return exitcode @@ -206,7 +206,7 @@ class UpdateManager(Hook): if blacklist: type_plugins = [(plugin['type'], plugin['name'].rsplit('.', 1)[0]) for plugin in blacklist] - # Protect UpdateManager from self-removing + #: Protect UpdateManager from self-removing try: type_plugins.remove(("hook", "UpdateManager")) except ValueError: @@ -286,9 +286,9 @@ class UpdateManager(Hook): self.logInfo(_("No plugin updates available")) # Exit codes: - # 0 = No plugin updated - # 1 = Plugins updated - # 2 = Plugins updated, but restart required + # 0 = No plugin updated + # 1 = Plugins updated + # 2 = Plugins updated, but restart required return exitcode diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 8ef5941d1..0c103b56a 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -44,13 +44,13 @@ class XFileSharingPro(Hook): CRYPTER_BUILTIN = ["junocloud.me", "rapidfileshare.net"] - # def pluginConfigChanged(self, plugin, name, value): - # self.loadPattern() + #: def pluginConfigChanged(self, plugin, name, value): + #: self.loadPattern() def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - # self.event_list = ["pluginConfigChanged"] + #: self.event_list = ["pluginConfigChanged"] def activate(self): @@ -105,7 +105,7 @@ class XFileSharingPro(Hook): def deactivate(self): - # self.unloadHoster("BasePlugin") + #: self.unloadHoster("BasePlugin") for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): self._unload(type, plugin) @@ -126,10 +126,10 @@ class XFileSharingPro(Hook): return False - # def download_failed(self, pyfile): - # if pyfile.pluginname == "BasePlugin" \ - # and pyfile.hasStatus("failed") \ - # and not self.getConfig('use_hoster_list') \ - # and self.unloadHoster("BasePlugin"): - # self.logDebug("Unloaded XFileSharingPro from BasePlugin") - # pyfile.setStatus("queued") + #: def download_failed(self, pyfile): + #: if pyfile.pluginname == "BasePlugin" \ + #: and pyfile.hasStatus("failed") \ + #: and not self.getConfig('use_hoster_list') \ + #: and self.unloadHoster("BasePlugin"): + #: self.logDebug("Unloaded XFileSharingPro from BasePlugin") + #: pyfile.setStatus("queued") diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 847fb26c3..10a03603e 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -36,7 +36,7 @@ class XMPPInterface(IRCInterface, JabberClient): self.jid = JID(self.getConfig('jid')) password = self.getConfig('pw') - # if bare JID is provided add a resource -- it is required + #: if bare JID is provided add a resource -- it is required if not self.jid.resource: self.jid = JID(self.jid.node, self.jid.domain, "pyLoad") @@ -47,8 +47,8 @@ class XMPPInterface(IRCInterface, JabberClient): tls_settings = None auth = ("sasl:DIGEST-MD5", "digest") - # setup client with provided connection information - # and identity data + #: setup client with provided connection information + #: and identity data JabberClient.__init__(self, self.jid, password, disco_name="pyLoad XMPP Client", disco_type="bot", tls_settings=tls_settings, auth_methods=auth) @@ -83,7 +83,7 @@ class XMPPInterface(IRCInterface, JabberClient): def run(self): - # connect to IRC etc. + #: connect to IRC etc. self.connect() try: self.loop() @@ -133,7 +133,7 @@ class XMPPInterface(IRCInterface, JabberClient): self.logDebug("Body: %s Subject: %s Type: %s" % (body, subject, t)) if t == "headline": - # 'headline' messages should never be replied to + #: 'headline' messages should never be replied to return True if subject: subject = u"Re: " + subject -- cgit v1.2.3 From 9305859b64a2f0aef3f27fb7e5b75caa0cb836a6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Jun 2015 19:24:49 +0200 Subject: Spare code cosmetics (3) --- module/plugins/hooks/Captcha9Kw.py | 4 ++-- module/plugins/hooks/DeleteFinished.py | 2 +- module/plugins/hooks/NoPremiumPlHook.py | 2 +- module/plugins/hooks/RapideoPlHook.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index a67e5bfc3..7e9bd2071 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -139,7 +139,7 @@ class Captcha9Kw(Hook): self.logDebug("NewCaptchaID ticket: %s" % res, task.captchaFile) - task.data["ticket"] = res + task.data['ticket'] = res for _i in xrange(int(self.getConfig('timeout') / 5)): result = self.load(self.API_URL, @@ -232,7 +232,7 @@ class Captcha9Kw(Hook): 'correct': "1" if correct else "2", 'pyload' : "1", 'source' : "pyload", - 'id' : task.data["ticket"]}) + 'id' : task.data['ticket']}) self.logDebug("Request %s: %s" % (type, res)) diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index a3e171a43..a65e61547 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -30,7 +30,7 @@ class DeleteFinished(Hook): def periodical(self): if not self.info['sleep']: deloffline = self.getConfig('deloffline') - mode = '0,1,4' if deloffline else '0,4' + mode = "0,1,4" if deloffline else "0,4" msg = _('delete all finished packages in queue list (%s packages with offline links)') self.logInfo(msg % (_('including') if deloffline else _('excluding'))) self.deleteFinished(mode) diff --git a/module/plugins/hooks/NoPremiumPlHook.py b/module/plugins/hooks/NoPremiumPlHook.py index 264f3462a..d0527d297 100644 --- a/module/plugins/hooks/NoPremiumPlHook.py +++ b/module/plugins/hooks/NoPremiumPlHook.py @@ -22,7 +22,7 @@ class NoPremiumPlHook(MultiHook): def getHosters(self): hostings = json_loads(self.load("https://www.nopremium.pl/clipboard.php?json=3").strip()) - hostings_domains = [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] + hostings_domains = [domain for row in hostings for domain in row['domains'] if row['sdownload'] == "0"] self.logDebug(hostings_domains) diff --git a/module/plugins/hooks/RapideoPlHook.py b/module/plugins/hooks/RapideoPlHook.py index f498def2a..3509f043c 100644 --- a/module/plugins/hooks/RapideoPlHook.py +++ b/module/plugins/hooks/RapideoPlHook.py @@ -22,7 +22,7 @@ class RapideoPlHook(MultiHook): def getHosters(self): hostings = json_loads(self.load("https://www.rapideo.pl/clipboard.php?json=3").strip()) - hostings_domains = [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] + hostings_domains = [domain for row in hostings for domain in row['domains'] if row['sdownload'] == "0"] self.logDebug(hostings_domains) -- cgit v1.2.3 From e4fb45b22d36595839e8f638a3f0a4669dba3e8d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 21 Jun 2015 08:50:26 +0200 Subject: Spare code cosmetics (4) --- module/plugins/hooks/AlldebridComHook.py | 15 ++++++--------- module/plugins/hooks/BypassCaptcha.py | 6 +++--- module/plugins/hooks/Captcha9Kw.py | 9 +++------ module/plugins/hooks/CaptchaBrotherhood.py | 16 ++++++++-------- module/plugins/hooks/Checksum.py | 10 +++++----- module/plugins/hooks/DeathByCaptcha.py | 14 +++++++------- module/plugins/hooks/DebridItaliaComHook.py | 9 ++++----- module/plugins/hooks/DownloadScheduler.py | 5 ++--- module/plugins/hooks/EasybytezComHook.py | 9 ++++----- module/plugins/hooks/ExpertDecoders.py | 6 +++--- module/plugins/hooks/FastixRuHook.py | 9 ++++----- module/plugins/hooks/FreeWayMeHook.py | 9 ++++----- module/plugins/hooks/HighWayMeHook.py | 9 ++++----- module/plugins/hooks/IRCInterface.py | 20 ++++++++++---------- module/plugins/hooks/ImageTyperz.py | 18 +++++++++--------- module/plugins/hooks/LinksnappyComHook.py | 9 ++++----- module/plugins/hooks/MegaDebridEuHook.py | 9 ++++----- module/plugins/hooks/MultihostersComHook.py | 8 ++++---- module/plugins/hooks/MultishareCzHook.py | 9 ++++----- module/plugins/hooks/MyfastfileComHook.py | 9 ++++----- module/plugins/hooks/NoPremiumPlHook.py | 9 ++++----- module/plugins/hooks/OverLoadMeHook.py | 17 ++++++----------- module/plugins/hooks/PremiumToHook.py | 9 ++++----- module/plugins/hooks/PremiumizeMeHook.py | 9 ++++----- module/plugins/hooks/PutdriveComHook.py | 8 ++++---- module/plugins/hooks/RPNetBizHook.py | 9 ++++----- module/plugins/hooks/RapideoPlHook.py | 9 ++++----- module/plugins/hooks/RealdebridComHook.py | 14 +++++--------- module/plugins/hooks/RehostToHook.py | 9 ++++----- module/plugins/hooks/SimplyPremiumComHook.py | 9 ++++----- module/plugins/hooks/SimplydebridComHook.py | 9 ++++----- module/plugins/hooks/SmoozedComHook.py | 9 ++++----- module/plugins/hooks/XMPPInterface.py | 14 +++++++------- module/plugins/hooks/ZeveraComHook.py | 9 ++++----- 34 files changed, 158 insertions(+), 193 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridComHook.py b/module/plugins/hooks/AlldebridComHook.py index c55f013a4..de24b86ed 100644 --- a/module/plugins/hooks/AlldebridComHook.py +++ b/module/plugins/hooks/AlldebridComHook.py @@ -8,12 +8,10 @@ class AlldebridComHook(MultiHook): __type__ = "hook" __version__ = "0.16" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 ), - ("ssl" , "bool" , "Use HTTPS" , True )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Alldebrid.com hook plugin""" __license__ = "GPLv3" @@ -21,7 +19,6 @@ class AlldebridComHook(MultiHook): def getHosters(self): - https = "https" if self.getConfig('ssl') else "http" - html = self.load(https + "://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip() - + html = self.load("https://www.alldebrid.com/api.php", + get={'action': "get_host"}).replace("\"", "").strip() return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 1651ea067..4869288c9 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -30,8 +30,8 @@ class BypassCaptcha(Hook): __type__ = "hook" __version__ = "0.07" - __config__ = [("force", "bool", "Force BC even if client is connected", False), - ("passkey", "password", "Passkey", "")] + __config__ = [("passkey" , "password", "Access key" , "" ), + ("check_client", "bool" , "Don't use if client is connected", True)] __description__ = """Send captchas to BypassCaptcha.com""" __license__ = "GPLv3" @@ -105,7 +105,7 @@ class BypassCaptcha(Hook): if not self.getConfig('passkey'): return False - if self.core.isClientConnected() and not self.getConfig('force'): + if self.core.isClientConnected() and self.getConfig('check_client'): return False if self.getCredits() > 0: diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 7e9bd2071..aaea232f7 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -16,8 +16,7 @@ class Captcha9Kw(Hook): __type__ = "hook" __version__ = "0.29" - __config__ = [("ssl" , "bool" , "Use HTTPS" , True ), - ("force" , "bool" , "Force captcha resolving even if client is connected" , True ), + __config__ = [("check_client" , "bool" , "Don't use if client is connected" , True ), ("confirm" , "bool" , "Confirm Captcha (cost +6 credits)" , False ), ("captchaperhour", "int" , "Captcha per hour" , "9999" ), ("captchapermin" , "int" , "Captcha per minute" , "9999" ), @@ -36,13 +35,11 @@ class Captcha9Kw(Hook): interval = 0 #@TODO: Remove in 0.4.10 - API_URL = "http://www.9kw.eu/index.cgi" + API_URL = "https://www.9kw.eu/index.cgi" def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - if self.getConfig('ssl'): - self.API_URL = self.API_URL.replace("http://", "https://") def getCredits(self): @@ -170,7 +167,7 @@ class Captcha9Kw(Hook): if not self.getConfig('passkey'): return - if self.core.isClientConnected() and not self.getConfig('force'): + if self.core.isClientConnected() and self.getConfig('check_client'): return credits = self.getCredits() diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 3992c6ca7..070d92da8 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -39,9 +39,9 @@ class CaptchaBrotherhood(Hook): __type__ = "hook" __version__ = "0.09" - __config__ = [("username", "str", "Username", ""), - ("force", "bool", "Force CT even if client is connected", False), - ("passkey", "password", "Password", "")] + __config__ = [("username" , "str" , "Username" , "" ), + ("password" , "password", "Password" , "" ), + ("check_client", "bool" , "Don't use if client is connected", True)] __description__ = """Send captchas to CaptchaBrotherhood.com""" __license__ = "GPLv3" @@ -60,7 +60,7 @@ class CaptchaBrotherhood(Hook): def getCredits(self): res = self.load(self.API_URL + "askCredits.aspx", - get={"username": self.getConfig('username'), "password": self.getConfig('passkey')}) + get={"username": self.getConfig('username'), "password": self.getConfig('password')}) if not res.startswith("OK"): raise CaptchaBrotherhoodException(res) else: @@ -90,7 +90,7 @@ class CaptchaBrotherhood(Hook): url = "%ssendNewCaptcha.aspx?%s" % (self.API_URL, urllib.urlencode({'username' : self.getConfig('username'), - 'password' : self.getConfig('passkey'), + 'password' : self.getConfig('password'), 'captchaSource': "pyLoad", 'timeout' : "80"})) @@ -124,7 +124,7 @@ class CaptchaBrotherhood(Hook): def api_response(self, api, ticket): res = self.load("%s%s.aspx" % (self.API_URL, api), get={"username": self.getConfig('username'), - "password": self.getConfig('passkey'), + "password": self.getConfig('password'), "captchaID": ticket}) if not res.startswith("OK"): raise CaptchaBrotherhoodException("Unknown response: %s" % res) @@ -139,10 +139,10 @@ class CaptchaBrotherhood(Hook): if not task.isTextual(): return False - if not self.getConfig('username') or not self.getConfig('passkey'): + if not self.getConfig('username') or not self.getConfig('password'): return False - if self.core.isClientConnected() and not self.getConfig('force'): + if self.core.isClientConnected() and self.getConfig('check_client'): return False if self.getCredits() > 10: diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index df81be384..409387c39 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -40,11 +40,11 @@ class Checksum(Hook): __type__ = "hook" __version__ = "0.17" - __config__ = [("check_checksum", "bool", "Check checksum? (If False only size will be verified)", True), - ("check_action", "fail;retry;nothing", "What to do if check fails?", "retry"), - ("max_tries", "int", "Number of retries", 2), - ("retry_action", "fail;nothing", "What to do if all retries fail?", "fail"), - ("wait_time", "int", "Time to wait before each retry (seconds)", 1)] + __config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), + ("check_action" , "fail;retry;nothing", "What to do if check fails?" , "retry"), + ("max_tries" , "int" , "Number of retries" , 2 ), + ("retry_action" , "fail;nothing" , "What to do if all retries fail?" , "fail" ), + ("wait_time" , "int" , "Time to wait before each retry (seconds)" , 1 )] __description__ = """Verify downloaded file size and checksum""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 50331d512..e0b319e12 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -53,9 +53,9 @@ class DeathByCaptcha(Hook): __type__ = "hook" __version__ = "0.07" - __config__ = [("username", "str", "Username", ""), - ("passkey", "password", "Password", ""), - ("force", "bool", "Force DBC even if client is connected", False)] + __config__ = [("username" , "str" , "Username" , "" ), + ("password" , "password", "Password" , "" ), + ("check_client", "bool" , "Don't use if client is connected", True)] __description__ = """Send captchas to DeathByCaptcha.com""" __license__ = "GPLv3" @@ -80,7 +80,7 @@ class DeathByCaptcha(Hook): if not isinstance(post, dict): post = {} post.update({"username": self.getConfig('username'), - "password": self.getConfig('passkey')}) + "password": self.getConfig('password')}) res = None try: @@ -135,7 +135,7 @@ class DeathByCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): #@NOTE: Workaround multipart-post bug in HTTPRequest.py - if re.match("^\w*$", self.getConfig('passkey')): + if re.match("^\w*$", self.getConfig('password')): multipart = True data = (pycurl.FORM_FILE, captcha) else: @@ -171,10 +171,10 @@ class DeathByCaptcha(Hook): if not task.isTextual(): return False - if not self.getConfig('username') or not self.getConfig('passkey'): + if not self.getConfig('username') or not self.getConfig('password'): return False - if self.core.isClientConnected() and not self.getConfig('force'): + if self.core.isClientConnected() and self.getConfig('check_client'): return False try: diff --git a/module/plugins/hooks/DebridItaliaComHook.py b/module/plugins/hooks/DebridItaliaComHook.py index b9a5f1b60..b7cf78a5d 100644 --- a/module/plugins/hooks/DebridItaliaComHook.py +++ b/module/plugins/hooks/DebridItaliaComHook.py @@ -10,11 +10,10 @@ class DebridItaliaComHook(MultiHook): __type__ = "hook" __version__ = "0.12" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Debriditalia.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 0ccc8a0ec..aa0ccbbab 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -11,9 +11,8 @@ class DownloadScheduler(Hook): __type__ = "hook" __version__ = "0.23" - __config__ = [("timetable", "str", "List time periods as hh:mm full or number(kB/s)", - "0:00 full, 7:00 250, 10:00 0, 17:00 150"), - ("abort", "bool", "Abort active downloads when start period with speed 0", False)] + __config__ = [("timetable", "str" , "List time periods as hh:mm full or number(kB/s)" , "0:00 full, 7:00 250, 10:00 0, 17:00 150"), + ("abort" , "bool", "Abort active downloads when start period with speed 0", False )] __description__ = """Download Scheduler""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/EasybytezComHook.py b/module/plugins/hooks/EasybytezComHook.py index 951d95479..027081f25 100644 --- a/module/plugins/hooks/EasybytezComHook.py +++ b/module/plugins/hooks/EasybytezComHook.py @@ -10,11 +10,10 @@ class EasybytezComHook(MultiHook): __type__ = "hook" __version__ = "0.07" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """EasyBytez.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index af5f2cfcd..63cee2379 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -17,8 +17,8 @@ class ExpertDecoders(Hook): __type__ = "hook" __version__ = "0.05" - __config__ = [("force", "bool", "Force CT even if client is connected", False), - ("passkey", "password", "Access key", "")] + __config__ = [("passkey" , "password", "Access key" , "" ), + ("check_client", "bool" , "Don't use if client is connected", True)] __description__ = """Send captchas to expertdecoders.com""" __license__ = "GPLv3" @@ -80,7 +80,7 @@ class ExpertDecoders(Hook): if not self.getConfig('passkey'): return False - if self.core.isClientConnected() and not self.getConfig('force'): + if self.core.isClientConnected() and self.getConfig('check_client'): return False if self.getCredits() > 0: diff --git a/module/plugins/hooks/FastixRuHook.py b/module/plugins/hooks/FastixRuHook.py index 24b18cb9f..0cd060377 100644 --- a/module/plugins/hooks/FastixRuHook.py +++ b/module/plugins/hooks/FastixRuHook.py @@ -9,11 +9,10 @@ class FastixRuHook(MultiHook): __type__ = "hook" __version__ = "0.05" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Fastix.ru hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/FreeWayMeHook.py b/module/plugins/hooks/FreeWayMeHook.py index 473bd7d26..0d5087cc0 100644 --- a/module/plugins/hooks/FreeWayMeHook.py +++ b/module/plugins/hooks/FreeWayMeHook.py @@ -8,11 +8,10 @@ class FreeWayMeHook(MultiHook): __type__ = "hook" __version__ = "0.16" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """FreeWay.me hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/HighWayMeHook.py b/module/plugins/hooks/HighWayMeHook.py index c04fc969e..824e5c475 100644 --- a/module/plugins/hooks/HighWayMeHook.py +++ b/module/plugins/hooks/HighWayMeHook.py @@ -9,11 +9,10 @@ class HighWayMeHook(MultiHook): __type__ = "hook" __version__ = "0.03" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """High-Way.me hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 61922f657..7cdd7624f 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -20,16 +20,16 @@ class IRCInterface(Thread, Hook): __type__ = "hook" __version__ = "0.14" - __config__ = [("host", "str", "IRC-Server Address", "Enter your server here!"), - ("port", "int", "IRC-Server Port", 6667), - ("ident", "str", "Clients ident", "pyload-irc"), - ("realname", "str", "Realname", "pyload-irc"), - ("ssl", "bool", "Use SSL", False), - ("nick", "str", "Nickname the Client will take", "pyLoad-IRC"), - ("owner", "str", "Nickname the Client will accept commands from", "Enter your nick here!"), - ("info_file", "bool", "Inform about every file finished", False), - ("info_pack", "bool", "Inform about every package finished", True), - ("captcha", "bool", "Send captcha requests", True)] + __config__ = [("host" , "str" , "IRC-Server Address" , "Enter your server here!"), + ("port" , "int" , "IRC-Server Port" , 6667 ), + ("ident" , "str" , "Clients ident" , "pyload-irc" ), + ("realname" , "str" , "Realname" , "pyload-irc" ), + ("ssl" , "bool", "Use SSL" , False ), + ("nick" , "str" , "Nickname the Client will take" , "pyLoad-IRC" ), + ("owner" , "str" , "Nickname the Client will accept commands from", "Enter your nick here!" ), + ("info_file", "bool", "Inform about every file finished" , False ), + ("info_pack", "bool", "Inform about every package finished" , True ), + ("captcha" , "bool", "Send captcha requests" , True )] __description__ = """Connect to irc and let owner perform different tasks""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 15097fd5a..90849a20c 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -34,9 +34,9 @@ class ImageTyperz(Hook): __type__ = "hook" __version__ = "0.07" - __config__ = [("username", "str", "Username", ""), - ("passkey", "password", "Password", ""), - ("force", "bool", "Force IT even if client is connected", False)] + __config__ = [("username" , "str" , "Username" , "" ), + ("password" , "password", "Password" , "" ), + ("check_client", "bool" , "Don't use if client is connected", True)] __description__ = """Send captchas to ImageTyperz.com""" __license__ = "GPLv3" @@ -59,7 +59,7 @@ class ImageTyperz(Hook): res = self.load(self.GETCREDITS_URL, post={'action': "REQUESTBALANCE", 'username': self.getConfig('username'), - 'password': self.getConfig('passkey')}) + 'password': self.getConfig('password')}) if res.startswith('ERROR'): raise ImageTyperzException(res) @@ -80,7 +80,7 @@ class ImageTyperz(Hook): try: #@NOTE: Workaround multipart-post bug in HTTPRequest.py - if re.match("^\w*$", self.getConfig('passkey')): + if re.match("^\w*$", self.getConfig('password')): multipart = True data = (pycurl.FORM_FILE, captcha) else: @@ -92,7 +92,7 @@ class ImageTyperz(Hook): res = self.load(self.SUBMIT_URL, post={'action': "UPLOADCAPTCHA", 'username': self.getConfig('username'), - 'password': self.getConfig('passkey'), "file": data}, + 'password': self.getConfig('password'), "file": data}, multipart=multipart, req=req) finally: @@ -117,10 +117,10 @@ class ImageTyperz(Hook): if not task.isTextual(): return False - if not self.getConfig('username') or not self.getConfig('passkey'): + if not self.getConfig('username') or not self.getConfig('password'): return False - if self.core.isClientConnected() and not self.getConfig('force'): + if self.core.isClientConnected() and self.getConfig('check_client'): return False if self.getCredits() > 0: @@ -138,7 +138,7 @@ class ImageTyperz(Hook): res = self.load(self.RESPOND_URL, post={'action': "SETBADIMAGE", 'username': self.getConfig('username'), - 'password': self.getConfig('passkey'), + 'password': self.getConfig('password'), 'imageid': task.data['ticket']}) if res == "SUCCESS": diff --git a/module/plugins/hooks/LinksnappyComHook.py b/module/plugins/hooks/LinksnappyComHook.py index d1bd19f1e..4004a4fd6 100644 --- a/module/plugins/hooks/LinksnappyComHook.py +++ b/module/plugins/hooks/LinksnappyComHook.py @@ -9,11 +9,10 @@ class LinksnappyComHook(MultiHook): __type__ = "hook" __version__ = "0.04" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Linksnappy.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/MegaDebridEuHook.py b/module/plugins/hooks/MegaDebridEuHook.py index 0e18f6f9d..5d45c2332 100644 --- a/module/plugins/hooks/MegaDebridEuHook.py +++ b/module/plugins/hooks/MegaDebridEuHook.py @@ -9,11 +9,10 @@ class MegaDebridEuHook(MultiHook): __type__ = "hook" __version__ = "0.05" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Mega-debrid.eu hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/MultihostersComHook.py b/module/plugins/hooks/MultihostersComHook.py index 7b5e49c49..10b1c53ba 100644 --- a/module/plugins/hooks/MultihostersComHook.py +++ b/module/plugins/hooks/MultihostersComHook.py @@ -8,10 +8,10 @@ class MultihostersComHook(ZeveraComHook): __type__ = "hook" __version__ = "0.02" - __config__ = [("mode" , "all;listed;unlisted", "Use for plugins (if supported)" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed", "bool" , "Revert to standard download if download fails", False), - ("interval" , "int" , "Reload interval in hours (0 to disable)" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Multihosters.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/MultishareCzHook.py b/module/plugins/hooks/MultishareCzHook.py index c3e923d9b..866fea405 100644 --- a/module/plugins/hooks/MultishareCzHook.py +++ b/module/plugins/hooks/MultishareCzHook.py @@ -10,11 +10,10 @@ class MultishareCzHook(MultiHook): __type__ = "hook" __version__ = "0.07" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """MultiShare.cz hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/MyfastfileComHook.py b/module/plugins/hooks/MyfastfileComHook.py index 10d128a31..5ba44f89e 100644 --- a/module/plugins/hooks/MyfastfileComHook.py +++ b/module/plugins/hooks/MyfastfileComHook.py @@ -9,11 +9,10 @@ class MyfastfileComHook(MultiHook): __type__ = "hook" __version__ = "0.05" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Myfastfile.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/NoPremiumPlHook.py b/module/plugins/hooks/NoPremiumPlHook.py index d0527d297..3c7cc8d9d 100644 --- a/module/plugins/hooks/NoPremiumPlHook.py +++ b/module/plugins/hooks/NoPremiumPlHook.py @@ -9,11 +9,10 @@ class NoPremiumPlHook(MultiHook): __type__ = "hook" __version__ = "0.03" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """NoPremium.pl hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/OverLoadMeHook.py b/module/plugins/hooks/OverLoadMeHook.py index a618938a4..39401000d 100644 --- a/module/plugins/hooks/OverLoadMeHook.py +++ b/module/plugins/hooks/OverLoadMeHook.py @@ -8,12 +8,10 @@ class OverLoadMeHook(MultiHook): __type__ = "hook" __version__ = "0.04" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 ), - ("ssl" , "bool" , "Use HTTPS" , True )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Over-Load.me hook plugin""" __license__ = "GPLv3" @@ -21,9 +19,6 @@ class OverLoadMeHook(MultiHook): def getHosters(self): - https = "https" if self.getConfig('ssl') else "http" - html = self.load(https + "://api.over-load.me/hoster.php", - get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip() - self.logDebug("Hosterlist", html) - + html = self.load("https://api.over-load.me/hoster.php", + get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip() return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/PremiumToHook.py b/module/plugins/hooks/PremiumToHook.py index 63e3c72c8..1c15bf11a 100644 --- a/module/plugins/hooks/PremiumToHook.py +++ b/module/plugins/hooks/PremiumToHook.py @@ -8,11 +8,10 @@ class PremiumToHook(MultiHook): __type__ = "hook" __version__ = "0.09" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Premium.to hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py index 615c6c2d8..1f38d374e 100644 --- a/module/plugins/hooks/PremiumizeMeHook.py +++ b/module/plugins/hooks/PremiumizeMeHook.py @@ -9,11 +9,10 @@ class PremiumizeMeHook(MultiHook): __type__ = "hook" __version__ = "0.18" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Premiumize.me hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/PutdriveComHook.py b/module/plugins/hooks/PutdriveComHook.py index c3ebf4ff3..931e5f565 100644 --- a/module/plugins/hooks/PutdriveComHook.py +++ b/module/plugins/hooks/PutdriveComHook.py @@ -8,10 +8,10 @@ class PutdriveComHook(ZeveraComHook): __type__ = "hook" __version__ = "0.01" - __config__ = [("mode" , "all;listed;unlisted", "Use for plugins (if supported)" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed", "bool" , "Revert to standard download if download fails", False), - ("interval" , "int" , "Reload interval in hours (0 to disable)" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Putdrive.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/RPNetBizHook.py b/module/plugins/hooks/RPNetBizHook.py index 8b3dd6ea1..a19ed7228 100644 --- a/module/plugins/hooks/RPNetBizHook.py +++ b/module/plugins/hooks/RPNetBizHook.py @@ -9,11 +9,10 @@ class RPNetBizHook(MultiHook): __type__ = "hook" __version__ = "0.14" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """RPNet.biz hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/RapideoPlHook.py b/module/plugins/hooks/RapideoPlHook.py index 3509f043c..861f9e10d 100644 --- a/module/plugins/hooks/RapideoPlHook.py +++ b/module/plugins/hooks/RapideoPlHook.py @@ -9,11 +9,10 @@ class RapideoPlHook(MultiHook): __type__ = "hook" __version__ = "0.03" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Rapideo.pl hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/RealdebridComHook.py b/module/plugins/hooks/RealdebridComHook.py index d1a503136..a1783ce84 100644 --- a/module/plugins/hooks/RealdebridComHook.py +++ b/module/plugins/hooks/RealdebridComHook.py @@ -8,12 +8,10 @@ class RealdebridComHook(MultiHook): __type__ = "hook" __version__ = "0.46" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 ), - ("ssl" , "bool" , "Use HTTPS" , True )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Real-Debrid.com hook plugin""" __license__ = "GPLv3" @@ -21,7 +19,5 @@ class RealdebridComHook(MultiHook): def getHosters(self): - https = "https" if self.getConfig('ssl') else "http" - html = self.load(https + "://real-debrid.com/api/hosters.php").replace("\"", "").strip() - + html = self.load("https://real-debrid.com/api/hosters.php").replace("\"", "").strip() return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/RehostToHook.py b/module/plugins/hooks/RehostToHook.py index febad818a..7c51823ca 100644 --- a/module/plugins/hooks/RehostToHook.py +++ b/module/plugins/hooks/RehostToHook.py @@ -8,11 +8,10 @@ class RehostToHook(MultiHook): __type__ = "hook" __version__ = "0.50" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Rehost.to hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/SimplyPremiumComHook.py b/module/plugins/hooks/SimplyPremiumComHook.py index e211abd30..db331283d 100644 --- a/module/plugins/hooks/SimplyPremiumComHook.py +++ b/module/plugins/hooks/SimplyPremiumComHook.py @@ -9,11 +9,10 @@ class SimplyPremiumComHook(MultiHook): __type__ = "hook" __version__ = "0.05" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Simply-Premium.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/SimplydebridComHook.py b/module/plugins/hooks/SimplydebridComHook.py index b844aad49..9e29a0c9f 100644 --- a/module/plugins/hooks/SimplydebridComHook.py +++ b/module/plugins/hooks/SimplydebridComHook.py @@ -8,11 +8,10 @@ class SimplydebridComHook(MultiHook): __type__ = "hook" __version__ = "0.04" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Simply-Debrid.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/SmoozedComHook.py b/module/plugins/hooks/SmoozedComHook.py index 24b7c8df0..2f5e370ee 100644 --- a/module/plugins/hooks/SmoozedComHook.py +++ b/module/plugins/hooks/SmoozedComHook.py @@ -8,11 +8,10 @@ class SmoozedComHook(MultiHook): __type__ = "hook" __version__ = "0.03" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Smoozed.com hook plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 10a03603e..8a76257ad 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -14,13 +14,13 @@ class XMPPInterface(IRCInterface, JabberClient): __type__ = "hook" __version__ = "0.11" - __config__ = [("jid", "str", "Jabber ID", "user@exmaple-jabber-server.org"), - ("pw", "str", "Password", ""), - ("tls", "bool", "Use TLS", False), - ("owners", "str", "List of JIDs accepting commands from", "me@icq-gateway.org;some@msn-gateway.org"), - ("info_file", "bool", "Inform about every file finished", False), - ("info_pack", "bool", "Inform about every package finished", True), - ("captcha", "bool", "Send captcha requests", True)] + __config__ = [("jid" , "str" , "Jabber ID" , "user@exmaple-jabber-server.org" ), + ("pw" , "str" , "Password" , "" ), + ("tls" , "bool", "Use TLS" , False ), + ("owners" , "str" , "List of JIDs accepting commands from", "me@icq-gateway.org;some@msn-gateway.org"), + ("info_file", "bool", "Inform about every file finished" , False ), + ("info_pack", "bool", "Inform about every package finished" , True ), + ("captcha" , "bool", "Send captcha requests" , True )] __description__ = """Connect to jabber and let owner perform different tasks""" __license__ = "GPLv3" diff --git a/module/plugins/hooks/ZeveraComHook.py b/module/plugins/hooks/ZeveraComHook.py index 21c1741d2..611fc5d91 100644 --- a/module/plugins/hooks/ZeveraComHook.py +++ b/module/plugins/hooks/ZeveraComHook.py @@ -8,11 +8,10 @@ class ZeveraComHook(MultiHook): __type__ = "hook" __version__ = "0.05" - __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 )] + __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), + ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """Zevera.com hook plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From b1759bc440cd6013837697eb8de540914f693ffd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Jul 2015 01:23:55 +0200 Subject: No camelCase style anymore --- module/plugins/hooks/AlldebridComHook.py | 4 +- module/plugins/hooks/AndroidPhoneNotify.py | 25 ++-- module/plugins/hooks/AntiVirus.py | 36 +++--- module/plugins/hooks/BypassCaptcha.py | 30 ++--- module/plugins/hooks/Captcha9Kw.py | 72 +++++------ module/plugins/hooks/CaptchaBrotherhood.py | 32 ++--- module/plugins/hooks/Checksum.py | 52 ++++---- module/plugins/hooks/ClickAndLoad.py | 18 +-- module/plugins/hooks/DeathByCaptcha.py | 42 +++---- module/plugins/hooks/DebridItaliaComHook.py | 4 +- module/plugins/hooks/DeleteFinished.py | 34 +++--- module/plugins/hooks/DownloadScheduler.py | 28 ++--- module/plugins/hooks/EasybytezComHook.py | 4 +- module/plugins/hooks/ExpertDecoders.py | 34 +++--- module/plugins/hooks/ExternalScripts.py | 69 +++++------ module/plugins/hooks/ExtractArchive.py | 173 ++++++++++++++------------- module/plugins/hooks/FastixRuHook.py | 4 +- module/plugins/hooks/FreeWayMeHook.py | 4 +- module/plugins/hooks/HighWayMeHook.py | 4 +- module/plugins/hooks/HotFolder.py | 14 +-- module/plugins/hooks/IRCInterface.py | 40 +++---- module/plugins/hooks/ImageTyperz.py | 40 +++---- module/plugins/hooks/JustPremium.py | 14 +-- module/plugins/hooks/LinkdecrypterComHook.py | 4 +- module/plugins/hooks/LinksnappyComHook.py | 4 +- module/plugins/hooks/MegaDebridEuHook.py | 6 +- module/plugins/hooks/MegaRapidoNetHook.py | 4 +- module/plugins/hooks/MergeFiles.py | 10 +- module/plugins/hooks/MultiHome.py | 24 ++-- module/plugins/hooks/MultihostersComHook.py | 2 +- module/plugins/hooks/MultishareCzHook.py | 4 +- module/plugins/hooks/MyfastfileComHook.py | 6 +- module/plugins/hooks/NoPremiumPlHook.py | 6 +- module/plugins/hooks/OverLoadMeHook.py | 4 +- module/plugins/hooks/PremiumToHook.py | 4 +- module/plugins/hooks/PremiumizeMeHook.py | 4 +- module/plugins/hooks/PutdriveComHook.py | 2 +- module/plugins/hooks/RPNetBizHook.py | 4 +- module/plugins/hooks/RapideoPlHook.py | 6 +- module/plugins/hooks/RealdebridComHook.py | 4 +- module/plugins/hooks/RehostToHook.py | 4 +- module/plugins/hooks/RestartFailed.py | 28 ++--- module/plugins/hooks/SimplyPremiumComHook.py | 4 +- module/plugins/hooks/SimplydebridComHook.py | 4 +- module/plugins/hooks/SkipRev.py | 10 +- module/plugins/hooks/SmoozedComHook.py | 4 +- module/plugins/hooks/UnSkipOnFail.py | 12 +- module/plugins/hooks/UpdateManager.py | 60 +++++----- module/plugins/hooks/UserAgentSwitcher.py | 10 +- module/plugins/hooks/WindowsPhoneNotify.py | 29 ++--- module/plugins/hooks/XFileSharingPro.py | 48 ++++---- module/plugins/hooks/XMPPInterface.py | 36 +++--- module/plugins/hooks/ZeveraComHook.py | 4 +- 53 files changed, 566 insertions(+), 562 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridComHook.py b/module/plugins/hooks/AlldebridComHook.py index de24b86ed..9af1cf02f 100644 --- a/module/plugins/hooks/AlldebridComHook.py +++ b/module/plugins/hooks/AlldebridComHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class AlldebridComHook(MultiHook): __name__ = "AlldebridComHook" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -18,7 +18,7 @@ class AlldebridComHook(MultiHook): __authors__ = [("Andy Voigt", "spamsales@online.de")] - def getHosters(self): + def get_hosters(self): html = self.load("https://www.alldebrid.com/api.php", get={'action': "get_host"}).replace("\"", "").strip() return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index daf4c1a27..1cea0c994 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -8,7 +8,7 @@ from module.plugins.internal.Hook import Hook, Expose class AndroidPhoneNotify(Hook): __name__ = "AndroidPhoneNotify" __type__ = "hook" - __version__ = "0.09" + __version__ = "0.10" __config__ = [("apikey" , "str" , "API key" , "" ), ("notifycaptcha" , "bool", "Notify captcha request" , True ), @@ -32,25 +32,26 @@ class AndroidPhoneNotify(Hook): def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - self.event_list = ["allDownloadsProcessed", "plugin_updated"] + self.event_list = ["plugin_updated"] + self.event_map = {'allDownloadsProcessed': "all_downloads_processed"} self.last_notify = 0 self.notifications = 0 def plugin_updated(self, type_plugins): - if not self.getConfig('notifyupdate'): + if not self.get_config('notifyupdate'): return self.notify(_("Plugins updated"), str(type_plugins)) def activate(self): - self.key = self.getConfig('apikey') + self.key = self.get_config('apikey') def exit(self): - if not self.getConfig('notifyexit'): + if not self.get_config('notifyexit'): return if self.core.do_restart: @@ -60,19 +61,19 @@ class AndroidPhoneNotify(Hook): def captcha_task(self, task): - if not self.getConfig('notifycaptcha'): + if not self.get_config('notifycaptcha'): return self.notify(_("Captcha"), _("New request waiting user input")) def package_finished(self, pypack): - if self.getConfig('notifypackage'): + if self.get_config('notifypackage'): self.notify(_("Package finished"), pypack.name) - def allDownloadsProcessed(self): - if not self.getConfig('notifyprocessed'): + def all_downloads_processed(self): + if not self.get_config('notifyprocessed'): return if any(True for pdata in self.core.api.getQueue() if pdata.linksdone < pdata.linkstotal): @@ -91,18 +92,18 @@ class AndroidPhoneNotify(Hook): if not key: return - if self.core.isClientConnected() and not self.getConfig('ignoreclient'): + if self.core.isClientConnected() and not self.get_config('ignoreclient'): return elapsed_time = time.time() - self.last_notify - if elapsed_time < self.getConfig("sendtimewait"): + if elapsed_time < self.get_config("sendtimewait"): return if elapsed_time > 60: self.notifications = 0 - elif self.notifications >= self.getConfig("sendpermin"): + elif self.notifications >= self.get_config("sendpermin"): return self.load("http://www.notifymyandroid.com/publicapi/notify", diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 02b1df67b..cb9d5aaa6 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -16,7 +16,7 @@ from module.utils import fs_encode, save_join as fs_join class AntiVirus(Hook): __name__ = "AntiVirus" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.11" #@TODO: add trash option (use Send2Trash lib) __config__ = [("action" , "Antivirus default;Delete;Quarantine", "Manage infected files" , "Antivirus default"), @@ -44,8 +44,8 @@ class AntiVirus(Hook): def scan(self, pyfile, thread): file = fs_encode(pyfile.plugin.lastDownload) filename = os.path.basename(pyfile.plugin.lastDownload) - cmdfile = fs_encode(self.getConfig('cmdfile')) - cmdargs = fs_encode(self.getConfig('cmdargs').strip()) + cmdfile = fs_encode(self.get_config('cmdfile')) + cmdargs = fs_encode(self.get_config('cmdargs').strip()) if not os.path.isfile(file) or not os.path.isfile(cmdfile): return @@ -60,20 +60,20 @@ class AntiVirus(Hook): out, err = map(str.strip, p.communicate()) if out: - self.logInfo(filename, out) + self.log_info(filename, out) if err: - self.logWarning(filename, err) - if not self.getConfig('ignore-err'): - self.logDebug("Delete/Quarantine task is aborted") + self.log_warning(filename, err) + if not self.get_config('ignore-err'): + self.log_debug("Delete/Quarantine task is aborted") return if p.returncode: pyfile.error = _("infected file") - action = self.getConfig('action') + action = self.get_config('action') try: if action == "Delete": - if not self.getConfig('deltotrash'): + if not self.get_config('deltotrash'): os.remove(file) else: @@ -81,27 +81,27 @@ class AntiVirus(Hook): send2trash.send2trash(file) except NameError: - self.logWarning(_("Send2Trash lib not found, moving to quarantine instead")) + self.log_warning(_("Send2Trash lib not found, moving to quarantine instead")) pyfile.setCustomStatus(_("file moving")) - shutil.move(file, self.getConfig('quardir')) + shutil.move(file, self.get_config('quardir')) except Exception, e: - self.logWarning(_("Unable to move file to trash: %s, moving to quarantine instead") % e.message) + self.log_warning(_("Unable to move file to trash: %s, moving to quarantine instead") % e.message) pyfile.setCustomStatus(_("file moving")) - shutil.move(file, self.getConfig('quardir')) + shutil.move(file, self.get_config('quardir')) else: - self.logDebug("Successfully moved file to trash") + self.log_debug("Successfully moved file to trash") elif action == "Quarantine": pyfile.setCustomStatus(_("file moving")) - shutil.move(file, self.getConfig('quardir')) + shutil.move(file, self.get_config('quardir')) except (IOError, shutil.Error), e: - self.logError(filename, action + " action failed!", e) + self.log_error(filename, action + " action failed!", e) elif not out and not err: - self.logDebug(filename, "No infected file found") + self.log_debug(filename, "No infected file found") finally: pyfile.setProgress(100) @@ -114,5 +114,5 @@ class AntiVirus(Hook): def download_failed(self, pyfile): #: Check if pyfile is still "failed", maybe might has been restarted in meantime - if pyfile.status == 8 and self.getConfig('scanfailed'): + if pyfile.status == 8 and self.get_config('scanfailed'): return self.scan(pyfile) diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 4869288c9..cb91c06ce 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -13,7 +13,7 @@ class BypassCaptchaException(Exception): self.err = err - def getCode(self): + def get_code(self): return self.err @@ -28,7 +28,7 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __config__ = [("passkey" , "password", "Access key" , "" ), ("check_client", "bool" , "Don't use if client is connected", True)] @@ -53,8 +53,8 @@ class BypassCaptcha(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def getCredits(self): - res = self.load(self.GETCREDITS_URL, post={"key": self.getConfig('passkey')}) + def get_credits(self): + res = self.load(self.GETCREDITS_URL, post={"key": self.get_config('passkey')}) data = dict(x.split(' ', 1) for x in res.splitlines()) return int(data['Left']) @@ -63,13 +63,13 @@ class BypassCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): req = getRequest() - #raise timeout threshold + # raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: res = self.load(self.SUBMIT_URL, post={'vendor_key': self.PYLOAD_KEY, - 'key': self.getConfig('passkey'), + 'key': self.get_config('passkey'), 'gen_task_id': "1", 'file': (pycurl.FORM_FILE, captcha)}, req=req) @@ -82,17 +82,17 @@ class BypassCaptcha(Hook): result = data['Value'] ticket = data['TaskId'] - self.logDebug("Result %s : %s" % (ticket, result)) + self.log_debug("Result %s : %s" % (ticket, result)) return ticket, result def respond(self, ticket, success): try: - res = self.load(self.RESPOND_URL, post={"task_id": ticket, "key": self.getConfig('passkey'), + res = self.load(self.RESPOND_URL, post={"task_id": ticket, "key": self.get_config('passkey'), "cv": 1 if success else 0}) except BadHeader, e: - self.logError(_("Could not send response"), e) + self.log_error(_("Could not send response"), e) def captcha_task(self, task): @@ -102,20 +102,20 @@ class BypassCaptcha(Hook): if not task.isTextual(): return False - if not self.getConfig('passkey'): + if not self.get_config('passkey'): return False - if self.core.isClientConnected() and self.getConfig('check_client'): + if self.core.isClientConnected() and self.get_config('check_client'): return False - if self.getCredits() > 0: + if self.get_credits() > 0: task.handler.append(self) task.data['service'] = self.__name__ task.setWaiting(100) - self._processCaptcha(task) + self._process_captcha(task) else: - self.logInfo(_("Your %s account has not enough credits") % self.__name__) + self.log_info(_("Your %s account has not enough credits") % self.__name__) def captcha_correct(self, task): @@ -129,7 +129,7 @@ class BypassCaptcha(Hook): @threaded - def _processCaptcha(self, task): + def _process_captcha(self, task): c = task.captchaFile try: ticket, result = self.submit(c) diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index aaea232f7..0ef67e54d 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -14,7 +14,7 @@ from module.plugins.internal.Hook import Hook, threaded class Captcha9Kw(Hook): __name__ = "Captcha9Kw" __type__ = "hook" - __version__ = "0.29" + __version__ = "0.30" __config__ = [("check_client" , "bool" , "Don't use if client is connected" , True ), ("confirm" , "bool" , "Confirm Captcha (cost +6 credits)" , False ), @@ -42,30 +42,30 @@ class Captcha9Kw(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def getCredits(self): + def get_credits(self): res = self.load(self.API_URL, - get={'apikey': self.getConfig('passkey'), + get={'apikey': self.get_config('passkey'), 'pyload': "1", 'source': "pyload", 'action': "usercaptchaguthaben"}) if res.isdigit(): - self.logInfo(_("%s credits left") % res) + self.log_info(_("%s credits left") % res) credits = self.info['credits'] = int(res) return credits else: - self.logError(res) + self.log_error(res) return 0 @threaded - def _processCaptcha(self, task): + def _process_captcha(self, task): try: with open(task.captchaFile, 'rb') as f: data = f.read() except IOError, e: - self.logError(e) + self.log_error(e) return pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) @@ -75,14 +75,14 @@ class Captcha9Kw(Hook): 'numeric' : 0, 'case_sensitive': 0, 'math' : 0, - 'prio' : min(max(self.getConfig('prio'), 0), 10), - 'confirm' : self.getConfig('confirm'), - 'timeout' : min(max(self.getConfig('timeout'), 300), 3999), - 'selfsolve' : self.getConfig('selfsolve'), - 'cph' : self.getConfig('captchaperhour'), - 'cpm' : self.getConfig('captchapermin')} + 'prio' : min(max(self.get_config('prio'), 0), 10), + 'confirm' : self.get_config('confirm'), + 'timeout' : min(max(self.get_config('timeout'), 300), 3999), + 'selfsolve' : self.get_config('selfsolve'), + 'cph' : self.get_config('captchaperhour'), + 'cpm' : self.get_config('captchapermin')} - for opt in str(self.getConfig('hoster_options').split('|')): + for opt in str(self.get_config('hoster_options').split('|')): details = map(str.strip, opt.split(':')) @@ -101,7 +101,7 @@ class Captcha9Kw(Hook): break - post_data = {'apikey' : self.getConfig('passkey'), + post_data = {'apikey' : self.get_config('passkey'), 'prio' : option['prio'], 'confirm' : option['confirm'], 'maxtimeout' : option['timeout'], @@ -131,16 +131,16 @@ class Captcha9Kw(Hook): if res and res.isdigit(): break else: - self.logError(_("Bad upload: %s") % res) + self.log_error(_("Bad upload: %s") % res) return - self.logDebug("NewCaptchaID ticket: %s" % res, task.captchaFile) + self.log_debug("NewCaptchaID ticket: %s" % res, task.captchaFile) task.data['ticket'] = res - for _i in xrange(int(self.getConfig('timeout') / 5)): + for _i in xrange(int(self.get_config('timeout') / 5)): result = self.load(self.API_URL, - get={'apikey': self.getConfig('passkey'), + get={'apikey': self.get_config('passkey'), 'id' : res, 'pyload': "1", 'info' : "1", @@ -152,10 +152,10 @@ class Captcha9Kw(Hook): else: break else: - self.logDebug("Could not send request: %s" % res) + self.log_debug("Could not send request: %s" % res) result = None - self.logInfo(_("Captcha result for ticket %s: %s") % (res, result)) + self.log_info(_("Captcha result for ticket %s: %s") % (res, result)) task.setResult(result) @@ -164,20 +164,20 @@ class Captcha9Kw(Hook): if not task.isTextual() and not task.isPositional(): return - if not self.getConfig('passkey'): + if not self.get_config('passkey'): return - if self.core.isClientConnected() and self.getConfig('check_client'): + if self.core.isClientConnected() and self.get_config('check_client'): return - credits = self.getCredits() + credits = self.get_credits() if not credits: - self.logError(_("Your captcha 9kw.eu account has not enough credits")) + self.log_error(_("Your captcha 9kw.eu account has not enough credits")) return - queue = min(self.getConfig('queue'), 999) - timeout = min(max(self.getConfig('timeout'), 300), 3999) + queue = min(self.get_config('queue'), 999) + timeout = min(max(self.get_config('timeout'), 300), 3999) pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) for _i in xrange(5): @@ -189,7 +189,7 @@ class Captcha9Kw(Hook): else: self.fail(_("Too many captchas in queue")) - for opt in str(self.getConfig('hoster_options').split('|')): + for opt in str(self.get_config('hoster_options').split('|')): details = map(str.strip, opt.split(':')) if not details or details[0].lower() != pluginname.lower(): @@ -209,17 +209,17 @@ class Captcha9Kw(Hook): task.setWaiting(timeout) - self._processCaptcha(task) + self._process_captcha(task) - def _captchaResponse(self, task, correct): + def _captcha_response(self, task, correct): type = "correct" if correct else "refund" if 'ticket' not in task.data: - self.logDebug("No CaptchaID for %s request (task: %s)" % (type, task)) + self.log_debug("No CaptchaID for %s request (task: %s)" % (type, task)) return - passkey = self.getConfig('passkey') + passkey = self.get_config('passkey') for _i in xrange(3): res = self.load(self.API_URL, @@ -231,19 +231,19 @@ class Captcha9Kw(Hook): 'source' : "pyload", 'id' : task.data['ticket']}) - self.logDebug("Request %s: %s" % (type, res)) + self.log_debug("Request %s: %s" % (type, res)) if res == "OK": break time.sleep(5) else: - self.logDebug("Could not send %s request: %s" % (type, res)) + self.log_debug("Could not send %s request: %s" % (type, res)) def captcha_correct(self, task): - self._captchaResponse(task, True) + self._captcha_response(task, True) def captcha_invalid(self, task): - self._captchaResponse(task, False) + self._captcha_response(task, False) diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 070d92da8..b2f370f32 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -22,7 +22,7 @@ class CaptchaBrotherhoodException(Exception): self.err = err - def getCode(self): + def get_code(self): return self.err @@ -37,7 +37,7 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" __type__ = "hook" - __version__ = "0.09" + __version__ = "0.10" __config__ = [("username" , "str" , "Username" , "" ), ("password" , "password", "Password" , "" ), @@ -58,14 +58,14 @@ class CaptchaBrotherhood(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def getCredits(self): + def get_credits(self): res = self.load(self.API_URL + "askCredits.aspx", - get={"username": self.getConfig('username'), "password": self.getConfig('password')}) + get={"username": self.get_config('username'), "password": self.get_config('password')}) if not res.startswith("OK"): raise CaptchaBrotherhoodException(res) else: credits = int(res[3:]) - self.logInfo(_("%d credits left") % credits) + self.log_info(_("%d credits left") % credits) self.info['credits'] = credits return credits @@ -74,7 +74,7 @@ class CaptchaBrotherhood(Hook): try: img = Image.open(captcha) output = StringIO.StringIO() - self.logDebug("CAPTCHA IMAGE", img, img.format, img.mode) + self.log_debug("CAPTCHA IMAGE", img, img.format, img.mode) if img.format in ("GIF", "JPEG"): img.save(output, img.format) else: @@ -89,8 +89,8 @@ class CaptchaBrotherhood(Hook): req = getRequest() url = "%ssendNewCaptcha.aspx?%s" % (self.API_URL, - urllib.urlencode({'username' : self.getConfig('username'), - 'password' : self.getConfig('password'), + urllib.urlencode({'username' : self.get_config('username'), + 'password' : self.get_config('password'), 'captchaSource': "pyLoad", 'timeout' : "80"})) @@ -123,8 +123,8 @@ class CaptchaBrotherhood(Hook): def api_response(self, api, ticket): res = self.load("%s%s.aspx" % (self.API_URL, api), - get={"username": self.getConfig('username'), - "password": self.getConfig('password'), + get={"username": self.get_config('username'), + "password": self.get_config('password'), "captchaID": ticket}) if not res.startswith("OK"): raise CaptchaBrotherhoodException("Unknown response: %s" % res) @@ -139,19 +139,19 @@ class CaptchaBrotherhood(Hook): if not task.isTextual(): return False - if not self.getConfig('username') or not self.getConfig('password'): + if not self.get_config('username') or not self.get_config('password'): return False - if self.core.isClientConnected() and self.getConfig('check_client'): + if self.core.isClientConnected() and self.get_config('check_client'): return False - if self.getCredits() > 10: + if self.get_credits() > 10: task.handler.append(self) task.data['service'] = self.__name__ task.setWaiting(100) - self._processCaptcha(task) + self._process_captcha(task) else: - self.logInfo(_("Your CaptchaBrotherhood Account has not enough credits")) + self.log_info(_("Your CaptchaBrotherhood Account has not enough credits")) def captcha_invalid(self, task): @@ -160,7 +160,7 @@ class CaptchaBrotherhood(Hook): @threaded - def _processCaptcha(self, task): + def _process_captcha(self, task): c = task.captchaFile try: ticket, result = self.submit(c) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 409387c39..7f42347df 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -11,7 +11,7 @@ from module.plugins.internal.Hook import Hook from module.utils import save_join as fs_join, fs_encode -def computeChecksum(local_file, algorithm): +def compute_checksum(local_file, algorithm): if algorithm in getattr(hashlib, "algorithms", ("md5", "sha1", "sha224", "sha256", "sha384", "sha512")): h = getattr(hashlib, algorithm)() @@ -38,7 +38,7 @@ def computeChecksum(local_file, algorithm): class Checksum(Hook): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.17" + __version__ = "0.18" __config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), ("check_action" , "fail;retry;nothing", "What to do if check fails?" , "retry"), @@ -64,8 +64,8 @@ class Checksum(Hook): def activate(self): - if not self.getConfig('check_checksum'): - self.logInfo(_("Checksum validation is disabled in plugin configuration")) + if not self.get_config('check_checksum'): + self.log_info(_("Checksum validation is disabled in plugin configuration")) def setup(self): @@ -98,17 +98,17 @@ class Checksum(Hook): else: return - self.logDebug(data) + self.log_debug(data) if not pyfile.plugin.lastDownload: - self.checkFailed(pyfile, None, "No file downloaded") + self.check_failed(pyfile, None, "No file downloaded") local_file = fs_encode(pyfile.plugin.lastDownload) - #download_folder = self.core.config.get("general", "download_folder") - #local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name)) + # download_folder = self.core.config.get("general", "download_folder") + # local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name)) if not os.path.isfile(local_file): - self.checkFailed(pyfile, None, "File does not exist") + self.check_failed(pyfile, None, "File does not exist") #: validate file size if "size" in data: @@ -116,13 +116,13 @@ class Checksum(Hook): file_size = os.path.getsize(local_file) if api_size != file_size: - self.logWarning(_("File %s has incorrect size: %d B (%d expected)") % (pyfile.name, file_size, api_size)) - self.checkFailed(pyfile, local_file, "Incorrect file size") + self.log_warning(_("File %s has incorrect size: %d B (%d expected)") % (pyfile.name, file_size, api_size)) + self.check_failed(pyfile, local_file, "Incorrect file size") data.pop('size', None) #: validate checksum - if data and self.getConfig('check_checksum'): + if data and self.get_config('check_checksum'): if not 'md5' in data: for type in ("checksum", "hashsum", "hash"): @@ -135,28 +135,28 @@ class Checksum(Hook): checksum = computeChecksum(local_file, key.replace("-", "").lower()) if checksum: if checksum == data[key].lower(): - self.logInfo(_('File integrity of "%s" verified by %s checksum (%s)') % + self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') % (pyfile.name, key.upper(), checksum)) break else: - self.logWarning(_("%s checksum for file %s does not match (%s != %s)") % + self.log_warning(_("%s checksum for file %s does not match (%s != %s)") % (key.upper(), pyfile.name, checksum, data[key])) - self.checkFailed(pyfile, local_file, "Checksums do not match") + self.check_failed(pyfile, local_file, "Checksums do not match") else: - self.logWarning(_("Unsupported hashing algorithm"), key.upper()) + self.log_warning(_("Unsupported hashing algorithm"), key.upper()) else: - self.logWarning(_("Unable to validate checksum for file: ") + pyfile.name) + self.log_warning(_("Unable to validate checksum for file: ") + pyfile.name) - def checkFailed(self, pyfile, local_file, msg): - check_action = self.getConfig('check_action') + def check_failed(self, pyfile, local_file, msg): + check_action = self.get_config('check_action') if check_action == "retry": - max_tries = self.getConfig('max_tries') - retry_action = self.getConfig('retry_action') + max_tries = self.get_config('max_tries') + retry_action = self.get_config('retry_action') if pyfile.plugin.retries < max_tries: if local_file: os.remove(local_file) - pyfile.plugin.retry(max_tries, self.getConfig('wait_time'), msg) + pyfile.plugin.retry(max_tries, self.get_config('wait_time'), msg) elif retry_action == "nothing": return elif check_action == "nothing": @@ -175,7 +175,7 @@ class Checksum(Hook): hash_file = fs_encode(fs_join(download_folder, link['name'])) if not os.path.isfile(hash_file): - self.logWarning(_("File not found"), link['name']) + self.log_warning(_("File not found"), link['name']) continue with open(hash_file) as f: @@ -183,14 +183,14 @@ class Checksum(Hook): for m in re.finditer(self.regexps.get(file_type, self.regexps['default']), text): data = m.groupdict() - self.logDebug(link['name'], data) + self.log_debug(link['name'], data) local_file = fs_encode(fs_join(download_folder, data['NAME'])) algorithm = self.methods.get(file_type, file_type) checksum = computeChecksum(local_file, algorithm) if checksum == data['HASH']: - self.logInfo(_('File integrity of "%s" verified by %s checksum (%s)') % + self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') % (data['NAME'], algorithm, checksum)) else: - self.logWarning(_("%s checksum for file %s does not match (%s != %s)") % + self.log_warning(_("%s checksum for file %s does not match (%s != %s)") % (algorithm, data['NAME'], checksum, data['HASH'])) diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index b1009420a..109452105 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -29,7 +29,7 @@ def forward(source, destination): class ClickAndLoad(Hook): __name__ = "ClickAndLoad" __type__ = "hook" - __version__ = "0.44" + __version__ = "0.45" __config__ = [("activated", "bool", "Activated" , True), ("port" , "int" , "Port" , 9666), @@ -52,9 +52,9 @@ class ClickAndLoad(Hook): if not self.core.config.get("webinterface", "activated"): return - ip = "" if self.getConfig('extern') else "127.0.0.1" + ip = "" if self.get_config('extern') else "127.0.0.1" webport = self.core.config.get("webinterface", "port") - cnlport = self.getConfig('port') + cnlport = self.get_config('port') self.proxy(ip, webport, cnlport) @@ -63,7 +63,7 @@ class ClickAndLoad(Hook): def proxy(self, ip, webport, cnlport): time.sleep(10) #@TODO: Remove in 0.4.10 (implement addon delay on startup) - self.logInfo(_("Proxy listening on %s:%s") % (ip or "0.0.0.0", cnlport)) + self.log_info(_("Proxy listening on %s:%s") % (ip or "0.0.0.0", cnlport)) self._server(ip, webport, cnlport) @@ -81,7 +81,7 @@ class ClickAndLoad(Hook): while True: client_socket, client_addr = dock_socket.accept() - self.logDebug("Connection from %s:%s" % client_addr) + self.log_debug("Connection from %s:%s" % client_addr) server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -90,12 +90,12 @@ class ClickAndLoad(Hook): server_socket = ssl.wrap_socket(server_socket) except NameError: - self.logError(_("pyLoad's webinterface is configured to use HTTPS, Please install python's ssl lib or disable HTTPS")) + self.log_error(_("pyLoad's webinterface is configured to use HTTPS, Please install python's ssl lib or disable HTTPS")) client_socket.close() #: reset the connection. continue except Exception, e: - self.logError(_("SSL error: %s") % e.message) + self.log_error(_("SSL error: %s") % e.message) client_socket.close() #: reset the connection. continue @@ -105,10 +105,10 @@ class ClickAndLoad(Hook): self.manager.startThread(forward, server_socket, client_socket) except socket.timeout: - self.logDebug("Connection timed out, retrying...") + self.log_debug("Connection timed out, retrying...") return self._server(ip, webport, cnlport) except socket.error, e: - self.logError(e) + self.log_error(e) time.sleep(240) return self._server(ip, webport, cnlport) diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index e0b319e12..ec2554a8f 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -29,11 +29,11 @@ class DeathByCaptchaException(Exception): self.err = err - def getCode(self): + def get_code(self): return self.err - def getDesc(self): + def get_desc(self): if self.err in self.DBC_ERRORS.keys(): return self.DBC_ERRORS[self.err] else: @@ -51,7 +51,7 @@ class DeathByCaptchaException(Exception): class DeathByCaptcha(Hook): __name__ = "DeathByCaptcha" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __config__ = [("username" , "str" , "Username" , "" ), ("password" , "password", "Password" , "" ), @@ -79,8 +79,8 @@ class DeathByCaptcha(Hook): if post: if not isinstance(post, dict): post = {} - post.update({"username": self.getConfig('username'), - "password": self.getConfig('password')}) + post.update({"username": self.get_config('username'), + "password": self.get_config('password')}) res = None try: @@ -89,7 +89,7 @@ class DeathByCaptcha(Hook): multipart=multipart, req=req) - self.logDebug(json) + self.log_debug(json) res = json_loads(json) if "error" in res: @@ -115,7 +115,7 @@ class DeathByCaptcha(Hook): return res - def getCredits(self): + def get_credits(self): res = self.api_response("user", True) if 'is_banned' in res and res['is_banned']: @@ -126,7 +126,7 @@ class DeathByCaptcha(Hook): raise DeathByCaptchaException(res) - def getStatus(self): + def get_status(self): res = self.api_response("status", False) if 'is_service_overloaded' in res and res['is_service_overloaded']: @@ -135,7 +135,7 @@ class DeathByCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): #@NOTE: Workaround multipart-post bug in HTTPRequest.py - if re.match("^\w*$", self.getConfig('password')): + if re.match("^\w*$", self.get_config('password')): multipart = True data = (pycurl.FORM_FILE, captcha) else: @@ -159,7 +159,7 @@ class DeathByCaptcha(Hook): raise DeathByCaptchaException('timed-out') result = res['text'] - self.logDebug("Result %s : %s" % (ticket, result)) + self.log_debug("Result %s : %s" % (ticket, result)) return ticket, result @@ -171,21 +171,21 @@ class DeathByCaptcha(Hook): if not task.isTextual(): return False - if not self.getConfig('username') or not self.getConfig('password'): + if not self.get_config('username') or not self.get_config('password'): return False - if self.core.isClientConnected() and self.getConfig('check_client'): + if self.core.isClientConnected() and self.get_config('check_client'): return False try: - self.getStatus() - self.getCredits() + self.get_status() + self.get_credits() except DeathByCaptchaException, e: - self.logError(e.getDesc()) + self.log_error(e.getDesc()) return False balance, rate = self.info['balance'], self.info['rate'] - self.logInfo(_("Account balance"), + self.log_info(_("Account balance"), _("US$%.3f (%d captchas left at %.2f cents each)") % (balance / 100, balance // rate, rate)) @@ -193,7 +193,7 @@ class DeathByCaptcha(Hook): task.handler.append(self) task.data['service'] = self.__name__ task.setWaiting(180) - self._processCaptcha(task) + self._process_captcha(task) def captcha_invalid(self, task): @@ -202,20 +202,20 @@ class DeathByCaptcha(Hook): res = self.api_response("captcha/%d/report" % task.data['ticket'], True) except DeathByCaptchaException, e: - self.logError(e.getDesc()) + self.log_error(e.getDesc()) except Exception, e: - self.logError(e) + self.log_error(e) @threaded - def _processCaptcha(self, task): + def _process_captcha(self, task): c = task.captchaFile try: ticket, result = self.submit(c) except DeathByCaptchaException, e: task.error = e.getCode() - self.logError(e.getDesc()) + self.log_error(e.getDesc()) return task.data['ticket'] = ticket diff --git a/module/plugins/hooks/DebridItaliaComHook.py b/module/plugins/hooks/DebridItaliaComHook.py index b7cf78a5d..9f7499783 100644 --- a/module/plugins/hooks/DebridItaliaComHook.py +++ b/module/plugins/hooks/DebridItaliaComHook.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHook import MultiHook class DebridItaliaComHook(MultiHook): __name__ = "DebridItaliaComHook" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -21,5 +21,5 @@ class DebridItaliaComHook(MultiHook): ("Walter Purcaro", "vuolter@gmail.com" )] - def getHosters(self): + def get_hosters(self): return self.load("http://debriditalia.com/api.php", get={'hosts': ""}).replace('"', '').split(',') diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index a65e61547..ec708eb10 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -7,7 +7,7 @@ from module.plugins.internal.Hook import Hook class DeleteFinished(Hook): __name__ = "DeleteFinished" __type__ = "hook" - __version__ = "1.13" + __version__ = "1.14" __config__ = [("interval" , "int" , "Check interval in hours" , 72 ), ("deloffline", "bool", "Delete package with offline links", False)] @@ -23,25 +23,25 @@ class DeleteFinished(Hook): ## overwritten methods ## def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - #: self.event_list = ["pluginConfigChanged"] + # self.event_map = {'pluginConfigChanged': "plugin_config_changed"} self.interval = self.MIN_CHECK_INTERVAL def periodical(self): if not self.info['sleep']: - deloffline = self.getConfig('deloffline') + deloffline = self.get_config('deloffline') mode = "0,1,4" if deloffline else "0,4" msg = _('delete all finished packages in queue list (%s packages with offline links)') - self.logInfo(msg % (_('including') if deloffline else _('excluding'))) - self.deleteFinished(mode) + self.log_info(msg % (_('including') if deloffline else _('excluding'))) + self.delete_finished(mode) self.info['sleep'] = True - self.addEvent('package_finished', self.wakeup) + self.add_event('package_finished', self.wakeup) - #: def pluginConfigChanged(self, plugin, name, value): - #: if name == "interval" and value != self.interval: - #: self.interval = value * 3600 - #: self.init_periodical() + # def plugin_config_changed(self, plugin, name, value): + # if name == "interval" and value != self.interval: + # self.interval = value * 3600 + # self.init_periodical() def deactivate(self): @@ -50,15 +50,15 @@ class DeleteFinished(Hook): def activate(self): self.info['sleep'] = True - #: interval = self.getConfig('interval') - #: self.pluginConfigChanged(self.__name__, 'interval', interval) - self.interval = max(self.MIN_CHECK_INTERVAL, self.getConfig('interval') * 60 * 60) - self.addEvent('package_finished', self.wakeup) + #: interval = self.get_config('interval') + #: self.plugin_config_changed(self.__name__, 'interval', interval) + self.interval = max(self.MIN_CHECK_INTERVAL, self.get_config('interval') * 60 * 60) + self.add_event('package_finished', self.wakeup) ## own methods ## @style.queue - def deleteFinished(self, mode): + def delete_finished(self, mode): self.c.execute('DELETE FROM packages WHERE NOT EXISTS(SELECT 1 FROM links WHERE package=packages.id AND status NOT IN (%s))' % mode) self.c.execute('DELETE FROM links WHERE NOT EXISTS(SELECT 1 FROM packages WHERE id=links.package)') @@ -69,13 +69,13 @@ class DeleteFinished(Hook): ## event managing ## - def addEvent(self, event, func): + def add_event(self, event, func): """ Adds an event listener for event name """ if event in self.manager.events: if func in self.manager.events[event]: - self.logDebug("Function already registered", func) + self.log_debug("Function already registered", func) else: self.manager.events[event].append(func) else: diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index aa0ccbbab..e4b09f049 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -9,7 +9,7 @@ from module.plugins.internal.Hook import Hook class DownloadScheduler(Hook): __name__ = "DownloadScheduler" __type__ = "hook" - __version__ = "0.23" + __version__ = "0.24" __config__ = [("timetable", "str" , "List time periods as hh:mm full or number(kB/s)" , "0:00 full, 7:00 250, 10:00 0, 17:00 150"), ("abort" , "bool", "Abort active downloads when start period with speed 0", False )] @@ -29,41 +29,41 @@ class DownloadScheduler(Hook): def activate(self): - self.updateSchedule() + self.update_schedule() - def updateSchedule(self, schedule=None): + def update_schedule(self, schedule=None): if schedule is None: - schedule = self.getConfig('timetable') + schedule = self.get_config('timetable') schedule = re.findall("(\d{1,2}):(\d{2})[\s]*(-?\d+)", schedule.lower().replace("full", "-1").replace("none", "0")) if not schedule: - self.logError(_("Invalid schedule")) + self.log_error(_("Invalid schedule")) return t0 = time.localtime() now = (t0.tm_hour, t0.tm_min, t0.tm_sec, "X") schedule = sorted([(int(x[0]), int(x[1]), 0, int(x[2])) for x in schedule] + [now]) - self.logDebug("Schedule", schedule) + self.log_debug("Schedule", schedule) for i, v in enumerate(schedule): if v[3] == "X": last, next = schedule[i - 1], schedule[(i + 1) % len(schedule)] - self.logDebug("Now/Last/Next", now, last, next) + self.log_debug("Now/Last/Next", now, last, next) - self.setDownloadSpeed(last[3]) + self.set_download_speed(last[3]) next_time = (((24 + next[0] - now[0]) * 60 + next[1] - now[1]) * 60 + next[2] - now[2]) % 86400 self.core.scheduler.removeJob(self.cb) - self.cb = self.core.scheduler.addJob(next_time, self.updateSchedule, threaded=False) + self.cb = self.core.scheduler.addJob(next_time, self.update_schedule, threaded=False) - def setDownloadSpeed(self, speed): + def set_download_speed(self, speed): if speed == 0: - abort = self.getConfig('abort') - self.logInfo(_("Stopping download server. (Running downloads will %sbe aborted.)") % '' if abort else _('not ')) + abort = self.get_config('abort') + self.log_info(_("Stopping download server. (Running downloads will %sbe aborted.)") % '' if abort else _('not ')) self.core.api.pauseServer() if abort: self.core.api.stopAllDownloads() @@ -71,10 +71,10 @@ class DownloadScheduler(Hook): self.core.api.unpauseServer() if speed > 0: - self.logInfo(_("Setting download speed to %d kB/s") % speed) + self.log_info(_("Setting download speed to %d kB/s") % speed) self.core.api.setConfigValue("download", "limit_speed", 1) self.core.api.setConfigValue("download", "max_speed", speed) else: - self.logInfo(_("Setting download speed to FULL")) + self.log_info(_("Setting download speed to FULL")) self.core.api.setConfigValue("download", "limit_speed", 0) self.core.api.setConfigValue("download", "max_speed", -1) diff --git a/module/plugins/hooks/EasybytezComHook.py b/module/plugins/hooks/EasybytezComHook.py index 027081f25..e4374d37c 100644 --- a/module/plugins/hooks/EasybytezComHook.py +++ b/module/plugins/hooks/EasybytezComHook.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHook import MultiHook class EasybytezComHook(MultiHook): __name__ = "EasybytezComHook" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -20,7 +20,7 @@ class EasybytezComHook(MultiHook): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - def getHosters(self): + def get_hosters(self): user, data = self.account.selectAccount() req = self.account.getAccountRequest(user) diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 63cee2379..6ec1f8bf1 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -15,7 +15,7 @@ from module.plugins.internal.Hook import Hook, threaded class ExpertDecoders(Hook): __name__ = "ExpertDecoders" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __config__ = [("passkey" , "password", "Access key" , "" ), ("check_client", "bool" , "Don't use if client is connected", True)] @@ -35,20 +35,20 @@ class ExpertDecoders(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def getCredits(self): - res = self.load(self.API_URL, post={"key": self.getConfig('passkey'), "action": "balance"}) + def get_credits(self): + res = self.load(self.API_URL, post={"key": self.get_config('passkey'), "action": "balance"}) if res.isdigit(): - self.logInfo(_("%s credits left") % res) + self.log_info(_("%s credits left") % res) self.info['credits'] = credits = int(res) return credits else: - self.logError(res) + self.log_error(res) return 0 @threaded - def _processCaptcha(self, task): + def _process_captcha(self, task): task.data['ticket'] = ticket = uuid.uuid4() result = None @@ -56,20 +56,20 @@ class ExpertDecoders(Hook): data = f.read() req = getRequest() - #raise timeout threshold + # raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: result = self.load(self.API_URL, post={'action' : "upload", - 'key' : self.getConfig('passkey'), + 'key' : self.get_config('passkey'), 'file' : b64encode(data), 'gen_task_id': ticket}, req=req) finally: req.close() - self.logDebug("Result %s : %s" % (ticket, result)) + self.log_debug("Result %s : %s" % (ticket, result)) task.setResult(result) @@ -77,19 +77,19 @@ class ExpertDecoders(Hook): if not task.isTextual(): return False - if not self.getConfig('passkey'): + if not self.get_config('passkey'): return False - if self.core.isClientConnected() and self.getConfig('check_client'): + if self.core.isClientConnected() and self.get_config('check_client'): return False - if self.getCredits() > 0: + if self.get_credits() > 0: task.handler.append(self) task.setWaiting(100) - self._processCaptcha(task) + self._process_captcha(task) else: - self.logInfo(_("Your ExpertDecoders Account has not enough credits")) + self.log_info(_("Your ExpertDecoders Account has not enough credits")) def captcha_invalid(self, task): @@ -97,8 +97,8 @@ class ExpertDecoders(Hook): try: res = self.load(self.API_URL, - post={'action': "refund", 'key': self.getConfig('passkey'), 'gen_task_id': task.data['ticket']}) - self.logInfo(_("Request refund"), res) + post={'action': "refund", 'key': self.get_config('passkey'), 'gen_task_id': task.data['ticket']}) + self.log_info(_("Request refund"), res) except BadHeader, e: - self.logError(_("Could not send refund request"), e) + self.log_error(_("Could not send refund request"), e) diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 29b43929e..6bf3cf347 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -10,7 +10,7 @@ from module.utils import fs_encode, save_join as fs_join class ExternalScripts(Hook): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.42" + __version__ = "0.43" __config__ = [("activated", "bool", "Activated" , True ), ("waitend" , "bool", "Wait script ending", False)] @@ -32,9 +32,10 @@ class ExternalScripts(Hook): self.event_list = ["archive_extract_failed", "archive_extracted" , "package_extract_failed", "package_extracted" , - "all_archives_extracted", "all_archives_processed", - "allDownloadsFinished" , "allDownloadsProcessed" , - "packageDeleted"] + "all_archives_extracted", "all_archives_processed"] + self.event_map = {'allDownloadsFinished' : "all_downloads_finished" , + 'allDownloadsProcessed': "all_downloads_processed", + 'packageDeleted' : "package_deleted" } folders = ["pyload_start", "pyload_restart", "pyload_stop", "before_reconnect", "after_reconnect", @@ -47,22 +48,22 @@ class ExternalScripts(Hook): for folder in folders: self.scripts[folder] = [] for dir in (pypath, ''): - self.initPluginType(folder, os.path.join(dir, 'scripts', folder)) + self.init_plugin_type(folder, os.path.join(dir, 'scripts', folder)) for script_type, names in self.scripts.iteritems(): if names: - self.logInfo(_("Installed scripts for: ") + script_type, ", ".join(map(os.path.basename, names))) + self.log_info(_("Installed scripts for: ") + script_type, ", ".join(map(os.path.basename, names))) self.pyload_start() - def initPluginType(self, name, dir): + def init_plugin_type(self, name, dir): if not os.path.isdir(dir): try: os.makedirs(dir) except OSError, e: - self.logDebug(e) + self.log_debug(e) return for filename in os.listdir(dir): @@ -75,54 +76,54 @@ class ExternalScripts(Hook): continue if not os.access(file, os.X_OK): - self.logWarning(_("Script not executable:") + " %s/%s" % (name, filename)) + self.log_warning(_("Script not executable:") + " %s/%s" % (name, filename)) self.scripts[name].append(file) - def callScript(self, script, *args): + def call_script(self, script, *args): try: cmd_args = (fs_encode(x) if isinstande(x, basestring) else str(x) for x in args) #@NOTE: `fs_encode` -> `encode` in 0.4.10 - self.logDebug("Executing: %s" % os.path.abspath(script), "Args: " + ' '.join(cmd_args)) + self.log_debug("Executing: %s" % os.path.abspath(script), "Args: " + ' '.join(cmd_args)) cmd = (script,) + cmd_args p = subprocess.Popen(cmd, bufsize=-1) #@NOTE: output goes to pyload - if self.getConfig('waitend'): + if self.get_config('waitend'): p.communicate() except Exception, e: try: - self.logError(_("Runtime error: %s") % os.path.abspath(script), e) + self.log_error(_("Runtime error: %s") % os.path.abspath(script), e) except Exception: - self.logError(_("Runtime error: %s") % os.path.abspath(script), _("Unknown error")) + self.log_error(_("Runtime error: %s") % os.path.abspath(script), _("Unknown error")) def pyload_start(self): for script in self.scripts['pyload_start']: - self.callScript(script) + self.call_script(script) def exit(self): for script in self.scripts['pyload_restart' if self.core.do_restart else 'pyload_stop']: - self.callScript(script) + self.call_script(script) def before_reconnect(self, ip): for script in self.scripts['before_reconnect']: - self.callScript(script, ip) + self.call_script(script, ip) self.info['oldip'] = ip def after_reconnect(self, ip): for script in self.scripts['after_reconnect']: - self.callScript(script, ip, self.info['oldip']) #@TODO: Use built-in oldip in 0.4.10 + self.call_script(script, ip, self.info['oldip']) #@TODO: Use built-in oldip in 0.4.10 def download_preparing(self, pyfile): for script in self.scripts['download_preparing']: - self.callScript(script, pyfile.id, pyfile.name, None, pyfile.pluginname, pyfile.url) + self.call_script(script, pyfile.id, pyfile.name, None, pyfile.pluginname, pyfile.url) def download_failed(self, pyfile): @@ -133,7 +134,7 @@ class ExternalScripts(Hook): for script in self.scripts['download_failed']: file = fs_join(download_folder, pyfile.name) - self.callScript(script, pyfile.id, pyfile.name, file, pyfile.pluginname, pyfile.url) + self.call_script(script, pyfile.id, pyfile.name, file, pyfile.pluginname, pyfile.url) def download_finished(self, pyfile): @@ -144,17 +145,17 @@ class ExternalScripts(Hook): for script in self.scripts['download_finished']: file = fs_join(download_folder, pyfile.name) - self.callScript(script, pyfile.id, pyfile.name, file, pyfile.pluginname, pyfile.url) + self.call_script(script, pyfile.id, pyfile.name, file, pyfile.pluginname, pyfile.url) def archive_extract_failed(self, pyfile, archive): for script in self.scripts['archive_extract_failed']: - self.callScript(script, pyfile.id, pyfile.name, archive.filename, archive.out, archive.files) + self.call_script(script, pyfile.id, pyfile.name, archive.filename, archive.out, archive.files) def archive_extracted(self, pyfile, archive): for script in self.scripts['archive_extracted']: - self.callScript(script, pyfile.id, pyfile.name, archive.filename, archive.out, archive.files) + self.call_script(script, pyfile.id, pyfile.name, archive.filename, archive.out, archive.files) def package_finished(self, pypack): @@ -164,10 +165,10 @@ class ExternalScripts(Hook): download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_finished']: - self.callScript(script, pypack.id, pypack.name, download_folder, pypack.password) + self.call_script(script, pypack.id, pypack.name, download_folder, pypack.password) - def packageDeleted(self, pid): + def package_deleted(self, pid): pack = self.core.api.getPackageInfo(pid) if self.core.config.get("general", "folder_per_package"): @@ -176,7 +177,7 @@ class ExternalScripts(Hook): download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_deleted']: - self.callScript(script, pack.id, pack.name, download_folder, pack.password) + self.call_script(script, pack.id, pack.name, download_folder, pack.password) def package_extract_failed(self, pypack): @@ -186,7 +187,7 @@ class ExternalScripts(Hook): download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_extract_failed']: - self.callScript(script, pypack.id, pypack.name, download_folder, pypack.password) + self.call_script(script, pypack.id, pypack.name, download_folder, pypack.password) def package_extracted(self, pypack): @@ -196,24 +197,24 @@ class ExternalScripts(Hook): download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_extracted']: - self.callScript(script, pypack.id, pypack.name, download_folder) + self.call_script(script, pypack.id, pypack.name, download_folder) - def allDownloadsFinished(self): + def all_downloads_finished(self): for script in self.scripts['all_downloads_finished']: - self.callScript(script) + self.call_script(script) - def allDownloadsProcessed(self): + def all_downloads_processed(self): for script in self.scripts['all_downloads_processed']: - self.callScript(script) + self.call_script(script) def all_archives_extracted(self): for script in self.scripts['all_archives_extracted']: - self.callScript(script) + self.call_script(script) def all_archives_processed(self): for script in self.scripts['all_archives_processed']: - self.callScript(script) + self.call_script(script) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 925976bc6..73782ed95 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -70,7 +70,7 @@ class ArchiveQueue(object): def get(self): try: - return [int(pid) for pid in self.plugin.getStorage("ExtractArchive:%s" % self.storage, "").decode('base64').split()] + return [int(pid) for pid in self.plugin.retrieve("ExtractArchive:%s" % self.storage, "").decode('base64').split()] except Exception: return [] @@ -80,11 +80,11 @@ class ArchiveQueue(object): item = str(value)[1:-1].replace(' ', '').replace(',', ' ') else: item = str(value).strip() - return self.plugin.setStorage("ExtractArchive:%s" % self.storage, item.encode('base64')[:-1]) + return self.plugin.store("ExtractArchive:%s" % self.storage, item.encode('base64')[:-1]) def delete(self): - return self.plugin.delStorage("ExtractArchive:%s" % self.storage) + return self.plugin.delete("ExtractArchive:%s" % self.storage) def add(self, item): @@ -112,7 +112,7 @@ class ArchiveQueue(object): class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.45" + __version__ = "1.46" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract with full paths" , True ), @@ -143,14 +143,15 @@ class ExtractArchive(Hook): def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - self.event_list = ["allDownloadsProcessed","packageDeleted"] + self.event_map = {'allDownloadsProcessed': "all_downloads_processed", + 'packageDeleted' : "package_deleted" } self.queue = ArchiveQueue(self, "Queue") self.failed = ArchiveQueue(self, "Failed") self.interval = 60 self.extracting = False - self.lastPackage = False + self.last_package = False self.extractors = [] self.passwords = [] self.repair = False @@ -164,30 +165,30 @@ class ExtractArchive(Hook): if klass.isUsable(): self.extractors.append(klass) if klass.REPAIR: - self.repair = self.getConfig('repair') + self.repair = self.get_config('repair') except OSError, e: if e.errno == 2: - self.logWarning(_("No %s installed") % p) + self.log_warning(_("No %s installed") % p) else: - self.logWarning(_("Could not activate: %s") % p, e) + self.log_warning(_("Could not activate: %s") % p, e) if self.core.debug: traceback.print_exc() except Exception, e: - self.logWarning(_("Could not activate: %s") % p, e) + self.log_warning(_("Could not activate: %s") % p, e) if self.core.debug: traceback.print_exc() if self.extractors: - self.logDebug(*["Found %s %s" % (Extractor.__name__, Extractor.VERSION) for Extractor in self.extractors]) - self.extractQueued() #: Resume unfinished extractions + self.log_debug(*["Found %s %s" % (Extractor.__name__, Extractor.VERSION) for Extractor in self.extractors]) + self.extract_queued() #: Resume unfinished extractions else: - self.logInfo(_("No Extract plugins activated")) + self.log_info(_("No Extract plugins activated")) @threaded - def extractQueued(self, thread): + def extract_queued(self, thread): if self.extracting: #@NOTE: doing the check here for safty (called by coreReady) return @@ -195,8 +196,8 @@ class ExtractArchive(Hook): packages = self.queue.get() while packages: - if self.lastPackage: #: called from allDownloadsProcessed - self.lastPackage = False + if self.last_package: #: called from allDownloadsProcessed + self.last_package = False if self.extract(packages, thread): #@NOTE: check only if all gone fine, no failed reporting for now self.manager.dispatchEvent("all_archives_extracted") self.manager.dispatchEvent("all_archives_processed") @@ -210,30 +211,30 @@ class ExtractArchive(Hook): @Expose - def extractPackage(self, *ids): + def extract_package(self, *ids): """ Extract packages with given id """ for id in ids: self.queue.add(id) - if not self.getConfig('waitall') and not self.extracting: - self.extractQueued() + if not self.get_config('waitall') and not self.extracting: + self.extract_queued() - def packageDeleted(self, pid): + def package_deleted(self, pid): self.queue.remove(pid) def package_finished(self, pypack): self.queue.add(pypack.id) - if not self.getConfig('waitall') and not self.extracting: - self.extractQueued() + if not self.get_config('waitall') and not self.extracting: + self.extract_queued() - def allDownloadsProcessed(self): - self.lastPackage = True - if self.getConfig('waitall') and not self.extracting: - self.extractQueued() + def all_downloads_processed(self): + self.last_package = True + if self.get_config('waitall') and not self.extracting: + self.extract_queued() @Expose @@ -247,23 +248,23 @@ class ExtractArchive(Hook): toList = lambda string: string.replace(' ', '').replace(',', '|').replace(';', '|').split('|') - destination = self.getConfig('destination') - subfolder = self.getConfig('subfolder') - fullpath = self.getConfig('fullpath') - overwrite = self.getConfig('overwrite') - renice = self.getConfig('renice') - recursive = self.getConfig('recursive') - delete = self.getConfig('delete') - keepbroken = self.getConfig('keepbroken') + destination = self.get_config('destination') + subfolder = self.get_config('subfolder') + fullpath = self.get_config('fullpath') + overwrite = self.get_config('overwrite') + renice = self.get_config('renice') + recursive = self.get_config('recursive') + delete = self.get_config('delete') + keepbroken = self.get_config('keepbroken') - extensions = [x.lstrip('.').lower() for x in toList(self.getConfig('extensions'))] - excludefiles = toList(self.getConfig('excludefiles')) + extensions = [x.lstrip('.').lower() for x in toList(self.get_config('extensions'))] + excludefiles = toList(self.get_config('excludefiles')) if extensions: - self.logDebug("Use for extensions: %s" % "|.".join(extensions)) + self.log_debug("Use for extensions: %s" % "|.".join(extensions)) #: reload from txt file - self.reloadPasswords() + self.reload_passwords() download_folder = self.core.config.get("general", "download_folder") @@ -275,7 +276,7 @@ class ExtractArchive(Hook): self.queue.remove(pid) continue - self.logInfo(_("Check package: %s") % pypack.name) + self.log_info(_("Check package: %s") % pypack.name) #: determine output folder out = fs_join(download_folder, pypack.folder, destination, "") #: force trailing slash @@ -302,17 +303,17 @@ class ExtractArchive(Hook): for Extractor in self.extractors: targets = Extractor.getTargets(files_ids) if targets: - self.logDebug("Targets for %s: %s" % (Extractor.__name__, targets)) + self.log_debug("Targets for %s: %s" % (Extractor.__name__, targets)) matched = True for fname, fid, fout in targets: name = os.path.basename(fname) if not os.path.exists(fname): - self.logDebug(name, "File not found") + self.log_debug(name, "File not found") continue - self.logInfo(name, _("Extract to: %s") % fout) + self.log_info(name, _("Extract to: %s") % fout) try: pyfile = self.core.files.getFile(fid) archive = Extractor(self, @@ -337,20 +338,20 @@ class ExtractArchive(Hook): thread.finishFile(pyfile) except Exception, e: - self.logError(name, e) + self.log_error(name, e) success = False continue #: remove processed file and related multiparts from list files_ids = [(fname, fid, fout) for fname, fid, fout in files_ids \ if fname not in archive.getDeleteFiles()] - self.logDebug("Extracted files: %s" % new_files) - self.setPermissions(new_files) + self.log_debug("Extracted files: %s" % new_files) + self.set_permissions(new_files) for filename in new_files: file = fs_encode(fs_join(os.path.dirname(archive.filename), filename)) if not os.path.exists(file): - self.logDebug("New file %s does not exists" % filename) + self.log_debug("New file %s does not exists" % filename) continue if recursive and os.path.isfile(file): @@ -371,7 +372,7 @@ class ExtractArchive(Hook): self.failed.add(pid) else: - self.logInfo(_("No files found to extract")) + self.log_info(_("No files found to extract")) if not matched or not success and subfolder: try: @@ -392,44 +393,44 @@ class ExtractArchive(Hook): encrypted = False try: - self.logDebug("Password: %s" % (password or "None provided")) - passwords = uniqify([password] + self.getPasswords(False)) if self.getConfig('usepasswordfile') else [password] + self.log_debug("Password: %s" % (password or "None provided")) + passwords = uniqify([password] + self.get_passwords(False)) if self.get_config('usepasswordfile') else [password] for pw in passwords: try: - if self.getConfig('test') or self.repair: + if self.get_config('test') or self.repair: pyfile.setCustomStatus(_("archive testing")) if pw: - self.logDebug("Testing with password: %s" % pw) + self.log_debug("Testing with password: %s" % pw) pyfile.setProgress(0) archive.verify(pw) pyfile.setProgress(100) else: archive.check(pw) - self.addPassword(pw) + self.add_password(pw) break except PasswordError: if not encrypted: - self.logInfo(name, _("Password protected")) + self.log_info(name, _("Password protected")) encrypted = True except CRCError, e: - self.logDebug(name, e) - self.logInfo(name, _("CRC Error")) + self.log_debug(name, e) + self.log_info(name, _("CRC Error")) if self.repair: - self.logWarning(name, _("Repairing...")) + self.log_warning(name, _("Repairing...")) pyfile.setCustomStatus(_("archive repairing")) pyfile.setProgress(0) repaired = archive.repair() pyfile.setProgress(100) - if not repaired and not self.getConfig('keepbroken'): + if not repaired and not self.get_config('keepbroken'): raise CRCError("Archive damaged") - self.addPassword(pw) + self.add_password(pw) break raise CRCError("Archive damaged") @@ -440,20 +441,20 @@ class ExtractArchive(Hook): pyfile.setCustomStatus(_("extracting")) pyfile.setProgress(0) - if not encrypted or not self.getConfig('usepasswordfile'): - self.logDebug("Extracting using password: %s" % (password or "None")) + if not encrypted or not self.get_config('usepasswordfile'): + self.log_debug("Extracting using password: %s" % (password or "None")) archive.extract(password) else: - for pw in filter(None, uniqify([password] + self.getPasswords(False))): + for pw in filter(None, uniqify([password] + self.get_passwords(False))): try: - self.logDebug("Extracting using password: %s" % pw) + self.log_debug("Extracting using password: %s" % pw) archive.extract(pw) - self.addPassword(pw) + self.add_password(pw) break except PasswordError: - self.logDebug("Password was wrong") + self.log_debug("Password was wrong") else: raise PasswordError @@ -461,12 +462,12 @@ class ExtractArchive(Hook): pyfile.setStatus("processing") delfiles = archive.getDeleteFiles() - self.logDebug("Would delete: " + ", ".join(delfiles)) + self.log_debug("Would delete: " + ", ".join(delfiles)) - if self.getConfig('delete'): - self.logInfo(_("Deleting %s files") % len(delfiles)) + if self.get_config('delete'): + self.log_info(_("Deleting %s files") % len(delfiles)) - deltotrash = self.getConfig('deltotrash') + deltotrash = self.get_config('deltotrash') for f in delfiles: file = fs_encode(f) if not os.path.exists(file): @@ -480,30 +481,30 @@ class ExtractArchive(Hook): send2trash.send2trash(file) except NameError: - self.logWarning(_("Unable to move %s to trash: Send2Trash lib not found") % os.path.basename(f)) + self.log_warning(_("Unable to move %s to trash: Send2Trash lib not found") % os.path.basename(f)) except Exception, e: - self.logWarning(_("Unable to move %s to trash: %s") % (os.path.basename(f), e.message)) + self.log_warning(_("Unable to move %s to trash: %s") % (os.path.basename(f), e.message)) else: - self.logDebug("Successfully moved %s to trash" % os.path.basename(f)) + self.log_debug("Successfully moved %s to trash" % os.path.basename(f)) - self.logInfo(name, _("Extracting finished")) + self.log_info(name, _("Extracting finished")) extracted_files = archive.files or archive.list() return extracted_files except PasswordError: - self.logError(name, _("Wrong password" if password else "No password found")) + self.log_error(name, _("Wrong password" if password else "No password found")) except CRCError, e: - self.logError(name, _("CRC mismatch"), e) + self.log_error(name, _("CRC mismatch"), e) except ArchiveError, e: - self.logError(name, _("Archive error"), e) + self.log_error(name, _("Archive error"), e) except Exception, e: - self.logError(name, _("Unknown error"), e) + self.log_error(name, _("Unknown error"), e) if self.core.debug: traceback.print_exc() @@ -513,50 +514,50 @@ class ExtractArchive(Hook): @Expose - def getPasswords(self, reload=True): + def get_passwords(self, reload=True): """ List of saved passwords """ if reload: - self.reloadPasswords() + self.reload_passwords() return self.passwords - def reloadPasswords(self): + def reload_passwords(self): try: passwords = [] - file = fs_encode(self.getConfig('passwordfile')) + file = fs_encode(self.get_config('passwordfile')) with open(file) as f: for pw in f.read().splitlines(): passwords.append(pw) except IOError, e: - self.logError(e) + self.log_error(e) else: self.passwords = passwords @Expose - def addPassword(self, password): + def add_password(self, password): """ Adds a password to saved list """ try: self.passwords = uniqify([password] + self.passwords) - file = fs_encode(self.getConfig('passwordfile')) + file = fs_encode(self.get_config('passwordfile')) with open(file, "wb") as f: for pw in self.passwords: f.write(pw + '\n') except IOError, e: - self.logError(e) + self.log_error(e) - def setPermissions(self, files): + def set_permissions(self, files): for f in files: if not os.path.exists(f): continue @@ -575,4 +576,4 @@ class ExtractArchive(Hook): os.chown(f, uid, gid) except Exception, e: - self.logWarning(_("Setting User and Group failed"), e) + self.log_warning(_("Setting User and Group failed"), e) diff --git a/module/plugins/hooks/FastixRuHook.py b/module/plugins/hooks/FastixRuHook.py index 0cd060377..c14d6c380 100644 --- a/module/plugins/hooks/FastixRuHook.py +++ b/module/plugins/hooks/FastixRuHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class FastixRuHook(MultiHook): __name__ = "FastixRuHook" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -19,7 +19,7 @@ class FastixRuHook(MultiHook): __authors__ = [("Massimo Rosamilia", "max@spiritix.eu")] - def getHosters(self): + def get_hosters(self): html = self.load("http://fastix.ru/api_v2", get={'apikey': "5182964c3f8f9a7f0b00000a_kelmFB4n1IrnCDYuIFn2y", 'sub' : "allowed_sources"}) diff --git a/module/plugins/hooks/FreeWayMeHook.py b/module/plugins/hooks/FreeWayMeHook.py index 0d5087cc0..093dd82d3 100644 --- a/module/plugins/hooks/FreeWayMeHook.py +++ b/module/plugins/hooks/FreeWayMeHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class FreeWayMeHook(MultiHook): __name__ = "FreeWayMeHook" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -18,7 +18,7 @@ class FreeWayMeHook(MultiHook): __authors__ = [("Nicolas Giese", "james@free-way.me")] - def getHosters(self): + def get_hosters(self): user, data = self.account.selectAccount() hostis = self.load("http://www.free-way.bz/ajax/jd.php", get={"id": 3, "user": user, "pass": data['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10 return [x.strip() for x in hostis.split(",") if x.strip()] diff --git a/module/plugins/hooks/HighWayMeHook.py b/module/plugins/hooks/HighWayMeHook.py index 824e5c475..8e400a628 100644 --- a/module/plugins/hooks/HighWayMeHook.py +++ b/module/plugins/hooks/HighWayMeHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class HighWayMeHook(MultiHook): __name__ = "HighWayMeHook" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -19,7 +19,7 @@ class HighWayMeHook(MultiHook): __authors__ = [("EvolutionClip", "evolutionclip@live.de")] - def getHosters(self): + def get_hosters(self): json_data = json_loads(self.load("https://high-way.me/api.php", get={'hoster': 1})) return [element['name'] for element in json_data['hoster']] diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 8c922f47a..8e1d1c54f 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -14,7 +14,7 @@ from module.utils import fs_encode, save_join as fs_join class HotFolder(Hook): __name__ = "HotFolder" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __config__ = [("folder" , "str" , "Folder to observe" , "container"), ("watch_file", "bool", "Observe link file" , False ), @@ -32,14 +32,14 @@ class HotFolder(Hook): def periodical(self): - folder = fs_encode(self.getConfig('folder')) - file = fs_encode(self.getConfig('file')) + folder = fs_encode(self.get_config('folder')) + file = fs_encode(self.get_config('file')) try: if not os.path.isdir(os.path.join(folder, "finished")): os.makedirs(os.path.join(folder, "finished")) - if self.getConfig('watch_file'): + if self.get_config('watch_file'): with open(file, "a+") as f: f.seek(0) content = f.read().strip() @@ -61,11 +61,11 @@ class HotFolder(Hook): if not os.path.isfile(path) or f.endswith("~") or f.startswith("#") or f.startswith("."): continue - newpath = os.path.join(folder, "finished", f if self.getConfig('keep') else "tmp_" + f) + newpath = os.path.join(folder, "finished", f if self.get_config('keep') else "tmp_" + f) move(path, newpath) - self.logInfo(_("Added %s from HotFolder") % f) + self.log_info(_("Added %s from HotFolder") % f) self.core.api.addPackage(f, [newpath], 1) except (IOError, OSError), e: - self.logError(e) + self.log_error(e) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 7cdd7624f..32597aa42 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -18,7 +18,7 @@ from module.utils import formatSize class IRCInterface(Thread, Hook): __name__ = "IRCInterface" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("host" , "str" , "IRC-Server Address" , "Enter your server here!"), ("port" , "int" , "IRC-Server Port" , 6667 ), @@ -42,7 +42,7 @@ class IRCInterface(Thread, Hook): def __init__(self, core, manager): Thread.__init__(self) Hook.__init__(self, core, manager) - self.setDaemon(True) + self.set_daemon(True) def activate(self): @@ -55,7 +55,7 @@ class IRCInterface(Thread, Hook): def package_finished(self, pypack): try: - if self.getConfig('info_pack'): + if self.get_config('info_pack'): self.response(_("Package finished: %s") % pypack.name) except Exception: pass @@ -63,7 +63,7 @@ class IRCInterface(Thread, Hook): def download_finished(self, pyfile): try: - if self.getConfig('info_file'): + if self.get_config('info_file'): self.response( _("Download finished: %(name)s @ %(plugin)s ") % {"name": pyfile.name, "plugin": pyfile.pluginname}) except Exception: @@ -71,7 +71,7 @@ class IRCInterface(Thread, Hook): def captcha_task(self, task): - if self.getConfig('captcha') and task.isTextual(): + if self.get_config('captcha') and task.isTextual(): task.handler.append(self) task.setWaiting(60) @@ -86,20 +86,20 @@ class IRCInterface(Thread, Hook): def run(self): #: connect to IRC etc. self.sock = socket.socket() - host = self.getConfig('host') - self.sock.connect((host, self.getConfig('port'))) + host = self.get_config('host') + self.sock.connect((host, self.get_config('port'))) - if self.getConfig('ssl'): + if self.get_config('ssl'): self.sock = ssl.wrap_socket(self.sock, cert_reqs=ssl.CERT_NONE) #@TODO: support certificate - nick = self.getConfig('nick') + nick = self.get_config('nick') self.sock.send("NICK %s\r\n" % nick) self.sock.send("USER %s %s bla :%s\r\n" % (nick, host, nick)) - for t in self.getConfig('owner').split(): + for t in self.get_config('owner').split(): if t.strip().startswith("#"): self.sock.send("JOIN %s\r\n" % t.strip()) - self.logInfo(_("Connected to"), host) - self.logInfo(_("Switching to listening mode!")) + self.log_info(_("Connected to"), host) + self.log_info(_("Switching to listening mode!")) try: self.main_loop() @@ -149,10 +149,10 @@ class IRCInterface(Thread, Hook): def handle_events(self, msg): - if not msg['origin'].split("!", 1)[0] in self.getConfig('owner').split(): + if not msg['origin'].split("!", 1)[0] in self.get_config('owner').split(): return - if msg['target'].split("!", 1)[0] != self.getConfig('nick'): + if msg['target'].split("!", 1)[0] != self.get_config('nick'): return if msg['action'] != "PRIVMSG": @@ -160,15 +160,15 @@ class IRCInterface(Thread, Hook): #: HANDLE CTCP ANTI FLOOD/BOT PROTECTION if msg['text'] == "\x01VERSION\x01": - self.logDebug("Sending CTCP VERSION") + self.log_debug("Sending CTCP VERSION") self.sock.send("NOTICE %s :%s\r\n" % (msg['origin'], "pyLoad! IRC Interface")) return elif msg['text'] == "\x01TIME\x01": - self.logDebug("Sending CTCP TIME") + self.log_debug("Sending CTCP TIME") self.sock.send("NOTICE %s :%d\r\n" % (msg['origin'], time.time())) return elif msg['text'] == "\x01LAG\x01": - self.logDebug("Received CTCP LAG") #: don't know how to answer + self.log_debug("Received CTCP LAG") #: don't know how to answer return trigger = "pass" @@ -188,12 +188,12 @@ class IRCInterface(Thread, Hook): for line in res: self.response(line, msg['origin']) except Exception, e: - self.logError(e) + self.log_error(e) def response(self, msg, origin=""): if origin == "": - for t in self.getConfig('owner').split(): + for t in self.get_config('owner').split(): self.sock.send("PRIVMSG %s :%s\r\n" % (t.strip(), msg)) else: self.sock.send("PRIVMSG %s :%s\r\n" % (origin.split("!", 1)[0], msg)) @@ -339,7 +339,7 @@ class IRCInterface(Thread, Hook): if not pack: return ["ERROR: Package doesn't exists."] - #TODO add links + # TODO add links return ["INFO: Added %d links to Package %s [#%d]" % (len(links), pack['name'], id)] diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 90849a20c..c70518c17 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -17,7 +17,7 @@ class ImageTyperzException(Exception): self.err = err - def getCode(self): + def get_code(self): return self.err @@ -32,7 +32,7 @@ class ImageTyperzException(Exception): class ImageTyperz(Hook): __name__ = "ImageTyperz" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __config__ = [("username" , "str" , "Username" , "" ), ("password" , "password", "Password" , "" ), @@ -55,11 +55,11 @@ class ImageTyperz(Hook): self.info = {} #@TODO: Remove in 0.4.10 - def getCredits(self): + def get_credits(self): res = self.load(self.GETCREDITS_URL, post={'action': "REQUESTBALANCE", - 'username': self.getConfig('username'), - 'password': self.getConfig('password')}) + 'username': self.get_config('username'), + 'password': self.get_config('password')}) if res.startswith('ERROR'): raise ImageTyperzException(res) @@ -69,18 +69,18 @@ class ImageTyperz(Hook): except Exception: raise ImageTyperzException("Invalid response") - self.logInfo(_("Account balance: $%s left") % res) + self.log_info(_("Account balance: $%s left") % res) return balance def submit(self, captcha, captchaType="file", match=None): req = getRequest() - #raise timeout threshold + # raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: #@NOTE: Workaround multipart-post bug in HTTPRequest.py - if re.match("^\w*$", self.getConfig('password')): + if re.match("^\w*$", self.get_config('password')): multipart = True data = (pycurl.FORM_FILE, captcha) else: @@ -91,8 +91,8 @@ class ImageTyperz(Hook): res = self.load(self.SUBMIT_URL, post={'action': "UPLOADCAPTCHA", - 'username': self.getConfig('username'), - 'password': self.getConfig('password'), "file": data}, + 'username': self.get_config('username'), + 'password': self.get_config('password'), "file": data}, multipart=multipart, req=req) finally: @@ -117,38 +117,38 @@ class ImageTyperz(Hook): if not task.isTextual(): return False - if not self.getConfig('username') or not self.getConfig('password'): + if not self.get_config('username') or not self.get_config('password'): return False - if self.core.isClientConnected() and self.getConfig('check_client'): + if self.core.isClientConnected() and self.get_config('check_client'): return False - if self.getCredits() > 0: + if self.get_credits() > 0: task.handler.append(self) task.data['service'] = self.__name__ task.setWaiting(100) - self._processCaptcha(task) + self._process_captcha(task) else: - self.logInfo(_("Your %s account has not enough credits") % self.__name__) + self.log_info(_("Your %s account has not enough credits") % self.__name__) def captcha_invalid(self, task): if task.data['service'] == self.__name__ and "ticket" in task.data: res = self.load(self.RESPOND_URL, post={'action': "SETBADIMAGE", - 'username': self.getConfig('username'), - 'password': self.getConfig('password'), + 'username': self.get_config('username'), + 'password': self.get_config('password'), 'imageid': task.data['ticket']}) if res == "SUCCESS": - self.logInfo(_("Bad captcha solution received, requested refund")) + self.log_info(_("Bad captcha solution received, requested refund")) else: - self.logError(_("Bad captcha solution received, refund request failed"), res) + self.log_error(_("Bad captcha solution received, refund request failed"), res) @threaded - def _processCaptcha(self, task): + def _process_captcha(self, task): c = task.captchaFile try: ticket, result = self.submit(c) diff --git a/module/plugins/hooks/JustPremium.py b/module/plugins/hooks/JustPremium.py index 19a552e49..706de4d81 100644 --- a/module/plugins/hooks/JustPremium.py +++ b/module/plugins/hooks/JustPremium.py @@ -8,7 +8,7 @@ from module.plugins.internal.Hook import Hook class JustPremium(Hook): __name__ = "JustPremium" __type__ = "hook" - __version__ = "0.23" + __version__ = "0.24" __config__ = [("excluded", "str", "Exclude hosters (comma separated)", ""), ("included", "str", "Include hosters (comma separated)", "")] @@ -25,10 +25,10 @@ class JustPremium(Hook): def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - self.event_list = ["linksAdded"] + self.event_map = {'linksAdded': "links_added"} - def linksAdded(self, links, pid): + def links_added(self, links, pid): hosterdict = self.core.pluginManager.hosterPlugins linkdict = self.core.api.checkURLs(links) @@ -39,9 +39,9 @@ class JustPremium(Hook): and hosterdict[hoster]['new_name'] in premiumplugins) excluded = map(lambda domain: "".join(part.capitalize() for part in re.split(r'(\.|\d+)', domain) if part != '.'), - self.getConfig('excluded').replace(' ', '').replace(',', '|').replace(';', '|').split('|')) + self.get_config('excluded').replace(' ', '').replace(',', '|').replace(';', '|').split('|')) included = map(lambda domain: "".join(part.capitalize() for part in re.split(r'(\.|\d+)', domain) if part != '.'), - self.getConfig('included').replace(' ', '').replace(',', '|').replace(';', '|').split('|')) + self.get_config('included').replace(' ', '').replace(',', '|').replace(';', '|').split('|')) hosterlist = (premiumplugins | multihosters).union(excluded).difference(included) @@ -50,7 +50,7 @@ class JustPremium(Hook): return for pluginname in set(linkdict.keys()) - hosterlist: - self.logInfo(_("Remove links of plugin: %s") % pluginname) + self.log_info(_("Remove links of plugin: %s") % pluginname) for link in linkdict[pluginname]: - self.logDebug("Remove link: %s" % link) + self.log_debug("Remove link: %s" % link) links.remove(link) diff --git a/module/plugins/hooks/LinkdecrypterComHook.py b/module/plugins/hooks/LinkdecrypterComHook.py index 76167524b..1fe7497b3 100644 --- a/module/plugins/hooks/LinkdecrypterComHook.py +++ b/module/plugins/hooks/LinkdecrypterComHook.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHook import MultiHook class LinkdecrypterComHook(MultiHook): __name__ = "LinkdecrypterComHook" __type__ = "hook" - __version__ = "1.06" + __version__ = "1.07" __config__ = [("activated" , "bool" , "Activated" , True ), ("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), @@ -21,7 +21,7 @@ class LinkdecrypterComHook(MultiHook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - def getHosters(self): + def get_hosters(self): list = re.search(r'>Supported\(\d+\): (.[\w.\-, ]+)', self.load("http://linkdecrypter.com/").replace("(g)", "")).group(1).split(', ') try: diff --git a/module/plugins/hooks/LinksnappyComHook.py b/module/plugins/hooks/LinksnappyComHook.py index 4004a4fd6..9501ba4a2 100644 --- a/module/plugins/hooks/LinksnappyComHook.py +++ b/module/plugins/hooks/LinksnappyComHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class LinksnappyComHook(MultiHook): __name__ = "LinksnappyComHook" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -19,7 +19,7 @@ class LinksnappyComHook(MultiHook): __authors__ = [("stickell", "l.stickell@yahoo.it")] - def getHosters(self): + def get_hosters(self): json_data = self.load("http://gen.linksnappy.com/lseAPI.php", get={'act': "FILEHOSTS"}) json_data = json_loads(json_data) diff --git a/module/plugins/hooks/MegaDebridEuHook.py b/module/plugins/hooks/MegaDebridEuHook.py index 5d45c2332..36aa807ae 100644 --- a/module/plugins/hooks/MegaDebridEuHook.py +++ b/module/plugins/hooks/MegaDebridEuHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class MegaDebridEuHook(MultiHook): __name__ = "MegaDebridEuHook" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -19,14 +19,14 @@ class MegaDebridEuHook(MultiHook): __authors__ = [("D.Ducatel", "dducatel@je-geek.fr")] - def getHosters(self): + def get_hosters(self): reponse = self.load("http://www.mega-debrid.eu/api.php", get={'action': "getHosters"}) json_data = json_loads(reponse) if json_data['response_code'] == "ok": host_list = [element[0] for element in json_data['hosters']] else: - self.logError(_("Unable to retrieve hoster list")) + self.log_error(_("Unable to retrieve hoster list")) host_list = list() return host_list diff --git a/module/plugins/hooks/MegaRapidoNetHook.py b/module/plugins/hooks/MegaRapidoNetHook.py index e113b305e..278daa11d 100644 --- a/module/plugins/hooks/MegaRapidoNetHook.py +++ b/module/plugins/hooks/MegaRapidoNetHook.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHook import MultiHook class MegaRapidoNetHook(MultiHook): __name__ = "MegaRapidoNetHook" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -20,7 +20,7 @@ class MegaRapidoNetHook(MultiHook): __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] - def getHosters(self): + def get_hosters(self): hosters = {'1fichier' : [],#leave it there are so many possible addresses? '1st-files' : ['1st-files.com'], '2shared' : ['2shared.com'], diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 64ab50400..9aa70aa71 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -13,7 +13,7 @@ from module.utils import save_join as fs_join class MergeFiles(Hook): __name__ = "MergeFiles" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __config__ = [("activated", "bool", "Activated", True)] @@ -49,11 +49,11 @@ class MergeFiles(Hook): download_folder = fs_join(download_folder, pack.folder) for name, file_list in files.iteritems(): - self.logInfo(_("Starting merging of"), name) + self.log_info(_("Starting merging of"), name) with open(fs_join(download_folder, name), "wb") as final_file: for splitted_file in file_list: - self.logDebug("Merging part", splitted_file) + self.log_debug("Merging part", splitted_file) pyfile = self.core.files.getFile(fid_dict[splitted_file]) @@ -71,7 +71,7 @@ class MergeFiles(Hook): pyfile.setProgress((size_written * 100) / s_file_size) else: break - self.logDebug("Finished merging part", splitted_file) + self.log_debug("Finished merging part", splitted_file) except Exception, e: traceback.print_exc() @@ -81,4 +81,4 @@ class MergeFiles(Hook): pyfile.setStatus("finished") pyfile.release() - self.logInfo(_("Finished merging of"), name) + self.log_info(_("Finished merging of"), name) diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 790d5dab3..12a65c601 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -8,7 +8,7 @@ from module.plugins.internal.Hook import Hook class MultiHome(Hook): __name__ = "MultiHome" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" __config__ = [("interfaces", "str", "Interfaces", "None")] @@ -25,18 +25,18 @@ class MultiHome(Hook): self.register = {} self.interfaces = [] - self.parseInterfaces(self.getConfig('interfaces').split(";")) + self.parse_interfaces(self.get_config('interfaces').split(";")) if not self.interfaces: - self.parseInterfaces([self.core.config.get("download", "interface")]) - self.setConfig("interfaces", self.toConfig()) + self.parse_interfaces([self.core.config.get("download", "interface")]) + self.set_config("interfaces", self.to_config()) - def toConfig(self): + def to_config(self): return ";".join(i.adress for i in self.interfaces) - def parseInterfaces(self, interfaces): + def parse_interfaces(self, interfaces): for interface in interfaces: if not interface or str(interface).lower() == "none": continue @@ -48,18 +48,18 @@ class MultiHome(Hook): oldGetRequest = requestFactory.getRequest - def getRequest(pluginName, account=None): - iface = self.bestInterface(pluginName, account) + def get_request(pluginName, account=None): + iface = self.best_interface(pluginName, account) if iface: iface.useFor(pluginName, account) requestFactory.iface = lambda: iface.adress - self.logDebug("Using address", iface.adress) + self.log_debug("Using address", iface.adress) return oldGetRequest(pluginName, account) requestFactory.getRequest = getRequest - def bestInterface(self, pluginName, account): + def best_interface(self, pluginName, account): best = None for interface in self.interfaces: if not best or interface.lastPluginAccess(pluginName, account) < best.lastPluginAccess(pluginName, account): @@ -74,13 +74,13 @@ class Interface(object): self.history = {} - def lastPluginAccess(self, pluginName, account): + def last_plugin_access(self, pluginName, account): if (pluginName, account) in self.history: return self.history[(pluginName, account)] return 0 - def useFor(self, pluginName, account): + def use_for(self, pluginName, account): self.history[(pluginName, account)] = time.time() diff --git a/module/plugins/hooks/MultihostersComHook.py b/module/plugins/hooks/MultihostersComHook.py index 10b1c53ba..caa9d5bea 100644 --- a/module/plugins/hooks/MultihostersComHook.py +++ b/module/plugins/hooks/MultihostersComHook.py @@ -6,7 +6,7 @@ from module.plugins.hooks.ZeveraComHook import ZeveraComHook class MultihostersComHook(ZeveraComHook): __name__ = "MultihostersComHook" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/MultishareCzHook.py b/module/plugins/hooks/MultishareCzHook.py index 866fea405..8ddcf74d2 100644 --- a/module/plugins/hooks/MultishareCzHook.py +++ b/module/plugins/hooks/MultishareCzHook.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHook import MultiHook class MultishareCzHook(MultiHook): __name__ = "MultishareCzHook" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -23,6 +23,6 @@ class MultishareCzHook(MultiHook): HOSTER_PATTERN = r']*?alt="(.+?)">\s*[^>]*?alt="OK"' - def getHosters(self): + def get_hosters(self): html = self.load("http://www.multishare.cz/monitoring/") return re.findall(self.HOSTER_PATTERN, html) diff --git a/module/plugins/hooks/MyfastfileComHook.py b/module/plugins/hooks/MyfastfileComHook.py index 5ba44f89e..f1e5d669d 100644 --- a/module/plugins/hooks/MyfastfileComHook.py +++ b/module/plugins/hooks/MyfastfileComHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class MyfastfileComHook(MultiHook): __name__ = "MyfastfileComHook" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -19,9 +19,9 @@ class MyfastfileComHook(MultiHook): __authors__ = [("stickell", "l.stickell@yahoo.it")] - def getHosters(self): + def get_hosters(self): json_data = self.load("http://myfastfile.com/api.php", get={'hosts': ""}) - self.logDebug("JSON data", json_data) + self.log_debug("JSON data", json_data) json_data = json_loads(json_data) return json_data['hosts'] diff --git a/module/plugins/hooks/NoPremiumPlHook.py b/module/plugins/hooks/NoPremiumPlHook.py index 3c7cc8d9d..1b011e6f8 100644 --- a/module/plugins/hooks/NoPremiumPlHook.py +++ b/module/plugins/hooks/NoPremiumPlHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class NoPremiumPlHook(MultiHook): __name__ = "NoPremiumPlHook" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -19,10 +19,10 @@ class NoPremiumPlHook(MultiHook): __authors__ = [("goddie", "dev@nopremium.pl")] - def getHosters(self): + def get_hosters(self): hostings = json_loads(self.load("https://www.nopremium.pl/clipboard.php?json=3").strip()) hostings_domains = [domain for row in hostings for domain in row['domains'] if row['sdownload'] == "0"] - self.logDebug(hostings_domains) + self.log_debug(hostings_domains) return hostings_domains diff --git a/module/plugins/hooks/OverLoadMeHook.py b/module/plugins/hooks/OverLoadMeHook.py index 39401000d..611285818 100644 --- a/module/plugins/hooks/OverLoadMeHook.py +++ b/module/plugins/hooks/OverLoadMeHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class OverLoadMeHook(MultiHook): __name__ = "OverLoadMeHook" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -18,7 +18,7 @@ class OverLoadMeHook(MultiHook): __authors__ = [("marley", "marley@over-load.me")] - def getHosters(self): + def get_hosters(self): html = self.load("https://api.over-load.me/hoster.php", get={'auth': "0001-cb1f24dadb3aa487bda5afd3b76298935329be7700cd7-5329be77-00cf-1ca0135f"}).replace("\"", "").strip() return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/PremiumToHook.py b/module/plugins/hooks/PremiumToHook.py index 1c15bf11a..dd85cb903 100644 --- a/module/plugins/hooks/PremiumToHook.py +++ b/module/plugins/hooks/PremiumToHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class PremiumToHook(MultiHook): __name__ = "PremiumToHook" __type__ = "hook" - __version__ = "0.09" + __version__ = "0.10" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -20,7 +20,7 @@ class PremiumToHook(MultiHook): ("stickell", "l.stickell@yahoo.it")] - def getHosters(self): + def get_hosters(self): user, data = self.account.selectAccount() html = self.load("http://premium.to/api/hosters.php", get={'username': user, 'password': data['password']}) diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py index 1f38d374e..24d091454 100644 --- a/module/plugins/hooks/PremiumizeMeHook.py +++ b/module/plugins/hooks/PremiumizeMeHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class PremiumizeMeHook(MultiHook): __name__ = "PremiumizeMeHook" __type__ = "hook" - __version__ = "0.18" + __version__ = "0.19" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -19,7 +19,7 @@ class PremiumizeMeHook(MultiHook): __authors__ = [("Florian Franzen", "FlorianFranzen@gmail.com")] - def getHosters(self): + def get_hosters(self): #: Get account data user, data = self.account.selectAccount() diff --git a/module/plugins/hooks/PutdriveComHook.py b/module/plugins/hooks/PutdriveComHook.py index 931e5f565..2c5310dbf 100644 --- a/module/plugins/hooks/PutdriveComHook.py +++ b/module/plugins/hooks/PutdriveComHook.py @@ -6,7 +6,7 @@ from module.plugins.hooks.ZeveraComHook import ZeveraComHook class PutdriveComHook(ZeveraComHook): __name__ = "PutdriveComHook" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/RPNetBizHook.py b/module/plugins/hooks/RPNetBizHook.py index a19ed7228..be472af26 100644 --- a/module/plugins/hooks/RPNetBizHook.py +++ b/module/plugins/hooks/RPNetBizHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class RPNetBizHook(MultiHook): __name__ = "RPNetBizHook" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -19,7 +19,7 @@ class RPNetBizHook(MultiHook): __authors__ = [("Dman", "dmanugm@gmail.com")] - def getHosters(self): + def get_hosters(self): #: Get account data user, data = self.account.selectAccount() diff --git a/module/plugins/hooks/RapideoPlHook.py b/module/plugins/hooks/RapideoPlHook.py index 861f9e10d..adbe55f12 100644 --- a/module/plugins/hooks/RapideoPlHook.py +++ b/module/plugins/hooks/RapideoPlHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class RapideoPlHook(MultiHook): __name__ = "RapideoPlHook" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -19,10 +19,10 @@ class RapideoPlHook(MultiHook): __authors__ = [("goddie", "dev@rapideo.pl")] - def getHosters(self): + def get_hosters(self): hostings = json_loads(self.load("https://www.rapideo.pl/clipboard.php?json=3").strip()) hostings_domains = [domain for row in hostings for domain in row['domains'] if row['sdownload'] == "0"] - self.logDebug(hostings_domains) + self.log_debug(hostings_domains) return hostings_domains diff --git a/module/plugins/hooks/RealdebridComHook.py b/module/plugins/hooks/RealdebridComHook.py index a1783ce84..da66249b6 100644 --- a/module/plugins/hooks/RealdebridComHook.py +++ b/module/plugins/hooks/RealdebridComHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class RealdebridComHook(MultiHook): __name__ = "RealdebridComHook" __type__ = "hook" - __version__ = "0.46" + __version__ = "0.47" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -18,6 +18,6 @@ class RealdebridComHook(MultiHook): __authors__ = [("Devirex Hazzard", "naibaf_11@yahoo.de")] - def getHosters(self): + def get_hosters(self): html = self.load("https://real-debrid.com/api/hosters.php").replace("\"", "").strip() return [x.strip() for x in html.split(",") if x.strip()] diff --git a/module/plugins/hooks/RehostToHook.py b/module/plugins/hooks/RehostToHook.py index 7c51823ca..016377e15 100644 --- a/module/plugins/hooks/RehostToHook.py +++ b/module/plugins/hooks/RehostToHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class RehostToHook(MultiHook): __name__ = "RehostToHook" __type__ = "hook" - __version__ = "0.50" + __version__ = "0.51" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -18,7 +18,7 @@ class RehostToHook(MultiHook): __authors__ = [("RaNaN", "RaNaN@pyload.org")] - def getHosters(self): + def get_hosters(self): user, data = self.account.selectAccount() html = self.load("http://rehost.to/api.php", get={'cmd' : "get_supported_och_dl", diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 0c74a544a..e19705d31 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -6,7 +6,7 @@ from module.plugins.internal.Hook import Hook class RestartFailed(Hook): __name__ = "RestartFailed" __type__ = "hook" - __version__ = "1.59" + __version__ = "1.60" __config__ = [("interval", "int", "Check interval in minutes", 90)] @@ -18,28 +18,28 @@ class RestartFailed(Hook): MIN_CHECK_INTERVAL = 15 * 60 #: 15 minutes - #: def pluginConfigChanged(self, plugin, name, value): - #: if name == "interval": - #: interval = value * 60 - #: if self.MIN_CHECK_INTERVAL <= interval != self.interval: - #: self.core.scheduler.removeJob(self.cb) - #: self.interval = interval - #: self.init_periodical() - #: else: - #: self.logDebug("Invalid interval value, kept current") + # def plugin_config_changed(self, plugin, name, value): + # if name == "interval": + # interval = value * 60 + # if self.MIN_CHECK_INTERVAL <= interval != self.interval: + # self.core.scheduler.removeJob(self.cb) + # self.interval = interval + # self.init_periodical() + # else: + # self.log_debug("Invalid interval value, kept current") def periodical(self): - self.logDebug("Restart failed downloads") + self.log_debug("Restart failed downloads") self.core.api.restartFailed() def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - #: self.event_list = ["pluginConfigChanged"] + # self.event_map = {'pluginConfigChanged': "plugin_config_changed"} self.interval = self.MIN_CHECK_INTERVAL def activate(self): - #: self.pluginConfigChanged(self.__name__, "interval", self.getConfig('interval')) - self.interval = max(self.MIN_CHECK_INTERVAL, self.getConfig('interval') * 60) + #: self.plugin_config_changed(self.__name__, "interval", self.get_config('interval')) + self.interval = max(self.MIN_CHECK_INTERVAL, self.get_config('interval') * 60) diff --git a/module/plugins/hooks/SimplyPremiumComHook.py b/module/plugins/hooks/SimplyPremiumComHook.py index db331283d..e522df8b5 100644 --- a/module/plugins/hooks/SimplyPremiumComHook.py +++ b/module/plugins/hooks/SimplyPremiumComHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class SimplyPremiumComHook(MultiHook): __name__ = "SimplyPremiumComHook" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -19,7 +19,7 @@ class SimplyPremiumComHook(MultiHook): __authors__ = [("EvolutionClip", "evolutionclip@live.de")] - def getHosters(self): + def get_hosters(self): json_data = self.load("http://www.simply-premium.com/api/hosts.php", get={'format': "json", 'online': 1}) json_data = json_loads(json_data) diff --git a/module/plugins/hooks/SimplydebridComHook.py b/module/plugins/hooks/SimplydebridComHook.py index 9e29a0c9f..228df2af4 100644 --- a/module/plugins/hooks/SimplydebridComHook.py +++ b/module/plugins/hooks/SimplydebridComHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class SimplydebridComHook(MultiHook): __name__ = "SimplydebridComHook" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -18,6 +18,6 @@ class SimplydebridComHook(MultiHook): __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] - def getHosters(self): + def get_hosters(self): html = self.load("http://simply-debrid.com/api.php", get={'list': 1}) return [x.strip() for x in html.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 503833d53..8fd49889c 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -13,7 +13,7 @@ from module.plugins.internal.Hook import Hook class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.31" + __version__ = "0.32" __config__ = [("mode" , "Auto;Manual", "Choose recovery archives to skip" , "Auto"), ("revtokeep", "int" , "Number of recovery archives to keep for package", 0 )] @@ -39,9 +39,9 @@ class SkipRev(Hook): def _name(self, pyfile): if hasattr(pyfile.pluginmodule, "getInfo"): #@NOTE: getInfo is deprecated in 0.4.10 - return pyfile.pluginmodule.getInfo([pyfile.url]).next()[0] + return pyfile.pluginmodule.get_info([pyfile.url]).next()[0] else: - self.logWarning("Unable to grab file name") + self.log_warning("Unable to grab file name") return urlparse.urlparse(urllib.unquote(pyfile.url)).path.split('/')[-1] @@ -64,7 +64,7 @@ class SkipRev(Hook): if pyfile.statusname is _("unskipped") or not name.endswith(".rev") or not ".part" in name: return - revtokeep = -1 if self.getConfig('mode') == "Auto" else self.getConfig('revtokeep') + revtokeep = -1 if self.get_config('mode') == "Auto" else self.get_config('revtokeep') if revtokeep: status_list = (1, 4, 8, 9, 14) if revtokeep < 0 else (1, 3, 4, 8, 9, 14) @@ -89,7 +89,7 @@ class SkipRev(Hook): if pyfile.status != 8 or pyfile.name.rsplit('.', 1)[-1].strip() not in ("rar", "rev"): return - revtokeep = -1 if self.getConfig('mode') == "Auto" else self.getConfig('revtokeep') + revtokeep = -1 if self.get_config('mode') == "Auto" else self.get_config('revtokeep') if not revtokeep: return diff --git a/module/plugins/hooks/SmoozedComHook.py b/module/plugins/hooks/SmoozedComHook.py index 2f5e370ee..d1cbd8126 100644 --- a/module/plugins/hooks/SmoozedComHook.py +++ b/module/plugins/hooks/SmoozedComHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class SmoozedComHook(MultiHook): __name__ = "SmoozedComHook" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -18,6 +18,6 @@ class SmoozedComHook(MultiHook): __authors__ = [("", "")] - def getHosters(self): + def get_hosters(self): user, data = self.account.selectAccount() return self.account.getAccountInfo(user)["hosters"] diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index cbfbff1b6..4e1e60f61 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -7,7 +7,7 @@ from module.plugins.internal.Hook import Hook class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" __config__ = [("activated", "bool", "Activated", True)] @@ -29,11 +29,11 @@ class UnSkipOnFail(Hook): return msg = _("Looking for skipped duplicates of: %s (pid:%s)") - self.logInfo(msg % (pyfile.name, pyfile.package().id)) + self.log_info(msg % (pyfile.name, pyfile.package().id)) - link = self.findDuplicate(pyfile) + link = self.find_duplicate(pyfile) if link: - self.logInfo(_("Queue found duplicate: %s (pid:%s)") % (link.name, link.packageID)) + self.log_info(_("Queue found duplicate: %s (pid:%s)") % (link.name, link.packageID)) # Change status of "link" to "new_status". # "link" has to be a valid FileData object, @@ -50,10 +50,10 @@ class UnSkipOnFail(Hook): pylink.release() else: - self.logInfo(_("No duplicates found")) + self.log_info(_("No duplicates found")) - def findDuplicate(self, pyfile): + def find_duplicate(self, pyfile): """Search all packages for duplicate links to "pyfile". Duplicates are links that would overwrite "pyfile". To test on duplicity the package-folder and link-name diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index a06ed97e9..488b300b8 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -28,7 +28,7 @@ def exists(path): class UpdateManager(Hook): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.53" + __version__ = "0.54" __config__ = [("activated" , "bool", "Activated" , True ), ("checkinterval", "int" , "Check interval in hours" , 8 ), @@ -63,11 +63,11 @@ class UpdateManager(Hook): self.info = {'pyload': False, 'version': None, 'plugins': False, 'last_check': time.time()} self.mtimes = {} #: store modification time for each plugin - self.event_list = ["allDownloadsProcessed"] + self.event_map = {'allDownloadsProcessed': "all_downloads_processed"} self.interval = 10 - if self.getConfig('checkonstart'): + if self.get_config('checkonstart'): self.core.api.pauseServer() self.checkonstart = True else: @@ -76,27 +76,27 @@ class UpdateManager(Hook): self.do_restart = False - def allDownloadsProcessed(self): + def all_downloads_processed(self): if self.do_restart is True: - self.logWarning(_("Downloads are done, restarting pyLoad to reload the updated plugins")) + self.log_warning(_("Downloads are done, restarting pyLoad to reload the updated plugins")) self.core.api.restart() def periodical(self): if self.core.debug: - if self.getConfig('reloadplugins'): - self.autoreloadPlugins() + if self.get_config('reloadplugins'): + self.autoreload_plugins() - if self.getConfig('nodebugupdate'): + if self.get_config('nodebugupdate'): return - if self.getConfig('checkperiod') \ - and time.time() - max(self.MIN_CHECK_INTERVAL, self.getConfig('checkinterval') * 60 * 60) > self.info['last_check']: + if self.get_config('checkperiod') \ + and time.time() - max(self.MIN_CHECK_INTERVAL, self.get_config('checkinterval') * 60 * 60) > self.info['last_check']: self.update() @Expose - def autoreloadPlugins(self): + def autoreload_plugins(self): """ Reload and reindex all modified plugins """ @@ -133,7 +133,7 @@ class UpdateManager(Hook): get={'v': self.core.api.getServerVersion()}).splitlines() except Exception: - self.logWarning(_("Unable to retrieve server to get updates")) + self.log_warning(_("Unable to retrieve server to get updates")) @Expose @@ -142,12 +142,12 @@ class UpdateManager(Hook): """ Check for updates """ - if self._update() is 2 and self.getConfig('autorestart'): + if self._update() is 2 and self.get_config('autorestart'): if not self.core.api.statusDownloads(): self.core.api.restart() else: self.do_restart = True - self.logWarning(_("Downloads are active, will restart once the download is done")) + self.log_warning(_("Downloads are active, will restart once the download is done")) self.core.api.pauseServer() @@ -160,15 +160,15 @@ class UpdateManager(Hook): exitcode = 0 elif data[0] == "None": - self.logInfo(_("No new pyLoad version available")) - exitcode = self._updatePlugins(data[1:]) + self.log_info(_("No new pyLoad version available")) + exitcode = self._update_plugins(data[1:]) elif onlyplugin: exitcode = 0 else: - self.logInfo(_("*** New pyLoad Version %s available ***") % data[0]) - self.logInfo(_("*** Get it here: https://github.com/pyload/pyload/releases ***")) + self.log_info(_("*** New pyLoad Version %s available ***") % data[0]) + self.log_info(_("*** Get it here: https://github.com/pyload/pyload/releases ***")) self.info['pyload'] = True self.info['version'] = data[0] exitcode = 3 @@ -181,7 +181,7 @@ class UpdateManager(Hook): return exitcode - def _updatePlugins(self, data): + def _update_plugins(self, data): """ Check for plugin updates """ @@ -218,8 +218,8 @@ class UpdateManager(Hook): updatelist.pop(idx) break - for t, n in self.removePlugins(sorted(type_plugins)): - self.logInfo(_("Removed blacklisted plugin: [%(type)s] %(name)s") % { + for t, n in self.remove_plugins(sorted(type_plugins)): + self.log_info(_("Removed blacklisted plugin: [%(type)s] %(name)s") % { 'type': t, 'name': n, }) @@ -252,7 +252,7 @@ class UpdateManager(Hook): else: continue - self.logInfo(_(msg) % {'type' : type, + self.log_info(_(msg) % {'type' : type, 'name' : name, 'oldver': oldver, 'newver': newver}) @@ -269,21 +269,21 @@ class UpdateManager(Hook): raise Exception, _("Version mismatch") except Exception, e: - self.logError(_("Error updating plugin: %s") % filename, e) + self.log_error(_("Error updating plugin: %s") % filename, e) if updated: - self.logInfo(_("*** Plugins updated ***")) + self.log_info(_("*** Plugins updated ***")) if self.core.pluginManager.reloadPlugins(updated): exitcode = 1 else: - self.logWarning(_("pyLoad restart required to reload the updated plugins")) + self.log_warning(_("pyLoad restart required to reload the updated plugins")) self.info['plugins'] = True exitcode = 2 self.manager.dispatchEvent("plugin_updated", updated) else: - self.logInfo(_("No plugin updates available")) + self.log_info(_("No plugin updates available")) # Exit codes: # 0 = No plugin updated @@ -293,7 +293,7 @@ class UpdateManager(Hook): @Expose - def removePlugins(self, type_plugins): + def remove_plugins(self, type_plugins): """ Delete plugins from disk """ @@ -302,7 +302,7 @@ class UpdateManager(Hook): removed = set() - self.logDebug("Requested deletion of plugins: %s" % type_plugins) + self.log_debug("Requested deletion of plugins: %s" % type_plugins) for type, name in type_plugins: rootplugins = os.path.join(pypath, "module", "plugins") @@ -316,7 +316,7 @@ class UpdateManager(Hook): self.manager.deactivateHook(name) except Exception, e: - self.logDebug(e) + self.log_debug(e) for filename in (py_filename, pyc_filename): if not exists(filename): @@ -326,7 +326,7 @@ class UpdateManager(Hook): os.remove(filename) except OSError, e: - self.logError(_("Error removing: %s") % filename, e) + self.log_error(_("Error removing: %s") % filename, e) else: id = (type, name) diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py index ea2d84a43..fdfe4b673 100644 --- a/module/plugins/hooks/UserAgentSwitcher.py +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -8,7 +8,7 @@ from module.plugins.internal.Hook import Hook class UserAgentSwitcher(Hook): __name__ = "UserAgentSwitcher" __type__ = "hook" - __version__ = "0.09" + __version__ = "0.10" __config__ = [("activated" , "bool", "Activated" , True ), ("connecttimeout", "int" , "Connection timeout in seconds" , 60 ), @@ -28,9 +28,9 @@ class UserAgentSwitcher(Hook): def download_preparing(self, pyfile): - connecttimeout = self.getConfig('connecttimeout') - maxredirs = self.getConfig('maxredirs') - useragent = self.getConfig('useragent') + connecttimeout = self.get_config('connecttimeout') + maxredirs = self.get_config('maxredirs') + useragent = self.get_config('useragent') if connecttimeout: pyfile.plugin.req.http.c.setopt(pycurl.CONNECTTIMEOUT, connecttimeout) @@ -39,5 +39,5 @@ class UserAgentSwitcher(Hook): pyfile.plugin.req.http.c.setopt(pycurl.MAXREDIRS, maxredirs) if useragent: - self.logDebug("Use custom user-agent string: " + useragent) + self.log_debug("Use custom user-agent string: " + useragent) pyfile.plugin.req.http.c.setopt(pycurl.USERAGENT, useragent) diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 713499322..511b4b568 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -9,7 +9,7 @@ from module.plugins.internal.Hook import Hook, Expose class WindowsPhoneNotify(Hook): __name__ = "WindowsPhoneNotify" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("push-id" , "str" , "Push ID" , "" ), ("push-url" , "str" , "Push url" , "" ), @@ -34,25 +34,26 @@ class WindowsPhoneNotify(Hook): def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - self.event_list = ["allDownloadsProcessed", "plugin_updated"] + self.event_list = ["plugin_updated"] + self.event_map = {'allDownloadsProcessed': "all_downloads_processed"} self.last_notify = 0 self.notifications = 0 def plugin_updated(self, type_plugins): - if not self.getConfig('notifyupdate'): + if not self.get_config('notifyupdate'): return self.notify(_("Plugins updated"), str(type_plugins)) def activate(self): - self.key = (self.getConfig('push-id'), self.getConfig('push-url')) + self.key = (self.get_config('push-id'), self.get_config('push-url')) def exit(self): - if not self.getConfig('notifyexit'): + if not self.get_config('notifyexit'): return if self.core.do_restart: @@ -62,19 +63,19 @@ class WindowsPhoneNotify(Hook): def captcha_task(self, task): - if not self.getConfig('notifycaptcha'): + if not self.get_config('notifycaptcha'): return self.notify(_("Captcha"), _("New request waiting user input")) def package_finished(self, pypack): - if self.getConfig('notifypackage'): + if self.get_config('notifypackage'): self.notify(_("Package finished"), pypack.name) - def allDownloadsProcessed(self): - if not self.getConfig('notifyprocessed'): + def all_downloads_processed(self): + if not self.get_config('notifyprocessed'): return if any(True for pdata in self.core.api.getQueue() if pdata.linksdone < pdata.linkstotal): @@ -83,7 +84,7 @@ class WindowsPhoneNotify(Hook): self.notify(_("All packages finished")) - def getXmlData(self, msg): + def get_xml_data(self, msg): return (" " " pyLoad %s " " " % msg) @@ -99,21 +100,21 @@ class WindowsPhoneNotify(Hook): if not id or not url: return - if self.core.isClientConnected() and not self.getConfig('ignoreclient'): + if self.core.isClientConnected() and not self.get_config('ignoreclient'): return elapsed_time = time.time() - self.last_notify - if elapsed_time < self.getConfig("sendtimewait"): + if elapsed_time < self.get_config("sendtimewait"): return if elapsed_time > 60: self.notifications = 0 - elif self.notifications >= self.getConfig("sendpermin"): + elif self.notifications >= self.get_config("sendpermin"): return - request = self.getXmlData("%s: %s" % (event, msg) if msg else event) + request = self.get_xml_data("%s: %s" % (event, msg) if msg else event) webservice = httplib.HTTP(url) webservice.putrequest("POST", id) diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 0c103b56a..9c42d1c0a 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.39" + __version__ = "0.40" __config__ = [("activated" , "bool", "Activated" , True ), ("use_hoster_list" , "bool", "Load listed hosters only" , False), @@ -34,41 +34,41 @@ class XFileSharingPro(Hook): "junkyvideo.com", "linestorage.com", "ravishare.com", "ryushare.com", "salefiles.com", "sendmyway.com", "sharebeast.com", "sharesix.com", "thefile.me", "verzend.be", "worldbytez.com", "xvidstage.com", - #NOT TESTED: + # NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", "vidbull.com", "zalaa.com", "zomgupload.com", - #NOT WORKING: + # NOT WORKING: "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] CRYPTER_BUILTIN = ["junocloud.me", "rapidfileshare.net"] - #: def pluginConfigChanged(self, plugin, name, value): - #: self.loadPattern() + # def plugin_config_changed(self, plugin, name, value): + # self.load_pattern() def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - #: self.event_list = ["pluginConfigChanged"] + # self.event_map = {'pluginConfigChanged': "plugin_config_changed"} def activate(self): - self.loadPattern() + self.load_pattern() - def loadPattern(self): - use_builtin_list = self.getConfig('use_builtin_list') + def load_pattern(self): + use_builtin_list = self.get_config('use_builtin_list') for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): - every_plugin = not self.getConfig("use_%s_list" % type) + every_plugin = not self.get_config("use_%s_list" % type) if every_plugin: - self.logInfo(_("Handling any %s I can!") % type) + self.log_info(_("Handling any %s I can!") % type) pattern = self.regexp[type][0] else: - plugins = self.getConfig('%s_list' % type) + plugins = self.get_config('%s_list' % type) plugin_set = set(plugins.replace(' ', '').replace('\\', '').replace('|', ',').replace(';', ',').lower().split(',')) if use_builtin_list: @@ -77,14 +77,14 @@ class XFileSharingPro(Hook): plugin_set -= set(('', u'')) if not plugin_set: - self.logInfo(_("No %s to handle") % type) + self.log_info(_("No %s to handle") % type) self._unload(type, plugin) return match_list = '|'.join(sorted(plugin_set)) len_match_list = len(plugin_set) - self.logInfo(_("Handling %d %s%s: %s") % (len_match_list, + self.log_info(_("Handling %d %s%s: %s") % (len_match_list, type, "" if len_match_list == 1 else "s", match_list.replace('|', ', '))) @@ -95,7 +95,7 @@ class XFileSharingPro(Hook): dict['pattern'] = pattern dict['re'] = re.compile(pattern) - self.logDebug("Loaded %s pattern: %s" % (type, pattern)) + self.log_debug("Loaded %s pattern: %s" % (type, pattern)) def _unload(self, type, plugin): @@ -105,13 +105,13 @@ class XFileSharingPro(Hook): def deactivate(self): - #: self.unloadHoster("BasePlugin") + #: self.unload_hoster("BasePlugin") for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): self._unload(type, plugin) - def unloadHoster(self, hoster): + def unload_hoster(self, hoster): hdict = self.core.pluginManager.hosterPlugins[hoster] if "new_name" in hdict and hdict['new_name'] == "XFileSharingPro": if "module" in hdict: @@ -126,10 +126,10 @@ class XFileSharingPro(Hook): return False - #: def download_failed(self, pyfile): - #: if pyfile.pluginname == "BasePlugin" \ - #: and pyfile.hasStatus("failed") \ - #: and not self.getConfig('use_hoster_list') \ - #: and self.unloadHoster("BasePlugin"): - #: self.logDebug("Unloaded XFileSharingPro from BasePlugin") - #: pyfile.setStatus("queued") + # def download_failed(self, pyfile): + # if pyfile.pluginname == "BasePlugin" \ + # and pyfile.hasStatus("failed") \ + # and not self.get_config('use_hoster_list') \ + # and self.unload_hoster("BasePlugin"): + # self.log_debug("Unloaded XFileSharingPro from BasePlugin") + # pyfile.setStatus("queued") diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 8a76257ad..a2c32166f 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -12,7 +12,7 @@ from module.plugins.hooks.IRCInterface import IRCInterface class XMPPInterface(IRCInterface, JabberClient): __name__ = "XMPPInterface" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("jid" , "str" , "Jabber ID" , "user@exmaple-jabber-server.org" ), ("pw" , "str" , "Password" , "" ), @@ -33,14 +33,14 @@ class XMPPInterface(IRCInterface, JabberClient): def __init__(self, core, manager): IRCInterface.__init__(self, core, manager) - self.jid = JID(self.getConfig('jid')) - password = self.getConfig('pw') + self.jid = JID(self.get_config('jid')) + password = self.get_config('pw') #: if bare JID is provided add a resource -- it is required if not self.jid.resource: self.jid = JID(self.jid.node, self.jid.domain, "pyLoad") - if self.getConfig('tls'): + if self.get_config('tls'): tls_settings = streamtls.TLSSettings(require=True, verify_peer=False) auth = ("sasl:PLAIN", "sasl:DIGEST-MD5") else: @@ -67,7 +67,7 @@ class XMPPInterface(IRCInterface, JabberClient): def package_finished(self, pypack): try: - if self.getConfig('info_pack'): + if self.get_config('info_pack'): self.announce(_("Package finished: %s") % pypack.name) except Exception: pass @@ -75,7 +75,7 @@ class XMPPInterface(IRCInterface, JabberClient): def download_finished(self, pyfile): try: - if self.getConfig('info_file'): + if self.get_config('info_file'): self.announce( _("Download finished: %(name)s @ %(plugin)s") % {"name": pyfile.name, "plugin": pyfile.pluginname}) except Exception: @@ -88,7 +88,7 @@ class XMPPInterface(IRCInterface, JabberClient): try: self.loop() except Exception, ex: - self.logError(ex) + self.log_error(ex) def stream_state_changed(self, state, arg): @@ -97,19 +97,19 @@ class XMPPInterface(IRCInterface, JabberClient): to a server changes. This will usually be used to let the user know what is going on. """ - self.logDebug("*** State changed: %s %r ***" % (state, arg)) + self.log_debug("*** State changed: %s %r ***" % (state, arg)) def disconnected(self): - self.logDebug("Client was disconnected") + self.log_debug("Client was disconnected") def stream_closed(self, stream): - self.logDebug("Stream was closed", stream) + self.log_debug("Stream was closed", stream) def stream_error(self, err): - self.logDebug("Stream Error", err) + self.log_debug("Stream Error", err) def get_message_handlers(self): @@ -129,8 +129,8 @@ class XMPPInterface(IRCInterface, JabberClient): subject = stanza.get_subject() body = stanza.get_body() t = stanza.get_type() - self.logDebug("Message from %s received." % stanza.get_from()) - self.logDebug("Body: %s Subject: %s Type: %s" % (body, subject, t)) + self.log_debug("Message from %s received." % stanza.get_from()) + self.log_debug("Body: %s Subject: %s Type: %s" % (body, subject, t)) if t == "headline": #: 'headline' messages should never be replied to @@ -141,11 +141,11 @@ class XMPPInterface(IRCInterface, JabberClient): to_jid = stanza.get_from() from_jid = stanza.get_to() - #j = JID() + # j = JID() to_name = to_jid.as_utf8() from_name = from_jid.as_utf8() - names = self.getConfig('owners').split(";") + names = self.get_config('owners').split(";") if to_name in names or to_jid.node + "@" + to_jid.domain in names: messages = [] @@ -174,7 +174,7 @@ class XMPPInterface(IRCInterface, JabberClient): messages.append(m) except Exception, e: - self.logError(e) + self.log_error(e) return messages @@ -190,8 +190,8 @@ class XMPPInterface(IRCInterface, JabberClient): """ Send message to all owners """ - for user in self.getConfig('owners').split(";"): - self.logDebug("Send message to", user) + for user in self.get_config('owners').split(";"): + self.log_debug("Send message to", user) to_jid = JID(user) diff --git a/module/plugins/hooks/ZeveraComHook.py b/module/plugins/hooks/ZeveraComHook.py index 611fc5d91..c0109eb38 100644 --- a/module/plugins/hooks/ZeveraComHook.py +++ b/module/plugins/hooks/ZeveraComHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class ZeveraComHook(MultiHook): __name__ = "ZeveraComHook" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), @@ -19,6 +19,6 @@ class ZeveraComHook(MultiHook): ("Walter Purcaro", "vuolter@gmail.com" )] - def getHosters(self): + def get_hosters(self): html = self.account.api_response(pyreq.getHTTPRequest(timeout=120), cmd="gethosters") return [x.strip() for x in html.split(",")] -- cgit v1.2.3 From d2e2b127651a5a44b56337eb6d9ca246c97a208a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 03:03:26 +0200 Subject: Spare fixes and code cosmetics --- module/plugins/hooks/DownloadScheduler.py | 8 ++++---- module/plugins/hooks/EasybytezComHook.py | 4 ++-- module/plugins/hooks/ExtractArchive.py | 31 +++++++++++++++++++++++++++++-- module/plugins/hooks/FreeWayMeHook.py | 2 +- module/plugins/hooks/PremiumToHook.py | 2 +- module/plugins/hooks/PremiumizeMeHook.py | 2 +- module/plugins/hooks/RPNetBizHook.py | 2 +- module/plugins/hooks/RehostToHook.py | 4 ++-- module/plugins/hooks/SmoozedComHook.py | 4 ++-- module/plugins/hooks/UpdateManager.py | 18 ++++++++++++++++++ 10 files changed, 61 insertions(+), 16 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index e4b09f049..ed43683fa 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -72,9 +72,9 @@ class DownloadScheduler(Hook): if speed > 0: self.log_info(_("Setting download speed to %d kB/s") % speed) - self.core.api.setConfigValue("download", "limit_speed", 1) - self.core.api.setConfigValue("download", "max_speed", speed) + self.core.config.set("download", "limit_speed", 1) + self.core.config.set("download", "max_speed", speed) else: self.log_info(_("Setting download speed to FULL")) - self.core.api.setConfigValue("download", "limit_speed", 0) - self.core.api.setConfigValue("download", "max_speed", -1) + self.core.config.set("download", "limit_speed", 0) + self.core.config.set("download", "max_speed", -1) diff --git a/module/plugins/hooks/EasybytezComHook.py b/module/plugins/hooks/EasybytezComHook.py index e4374d37c..69f3a2a34 100644 --- a/module/plugins/hooks/EasybytezComHook.py +++ b/module/plugins/hooks/EasybytezComHook.py @@ -21,9 +21,9 @@ class EasybytezComHook(MultiHook): def get_hosters(self): - user, data = self.account.selectAccount() + user, data = self.account.select_account() - req = self.account.getAccountRequest(user) + req = self.account.get_account_request(user) html = self.load("http://www.easybytez.com", req=req) return re.search(r'\s*Supported sites:(.*)', html).group(1).split(',') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 73782ed95..9ca7bf854 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -162,7 +162,7 @@ class ExtractArchive(Hook): try: module = self.core.pluginManager.loadModule("internal", p) klass = getattr(module, p) - if klass.isUsable(): + if klass.is_usable(): self.extractors.append(klass) if klass.REPAIR: self.repair = self.get_config('repair') @@ -210,6 +210,15 @@ class ExtractArchive(Hook): self.extracting = False + #: Deprecated method, use `extract_package` instead + @Expose + def extractPackage(self, *args, **kwargs): + """ + See `extract_package` + """ + return self.extract_package(*args, **kwargs) + + @Expose def extract_package(self, *ids): """ @@ -301,7 +310,7 @@ class ExtractArchive(Hook): if filter(lambda ext: fname.lower().endswith(ext), extensions)] for Extractor in self.extractors: - targets = Extractor.getTargets(files_ids) + targets = Extractor.get_targets(files_ids) if targets: self.log_debug("Targets for %s: %s" % (Extractor.__name__, targets)) matched = True @@ -513,6 +522,15 @@ class ExtractArchive(Hook): raise Exception(_("Extract failed")) + #: Deprecated method, use `get_passwords` instead + @Expose + def getPasswords(self, *args, **kwargs): + """ + See `get_passwords` + """ + return self.get_passwords(*args, **kwargs) + + @Expose def get_passwords(self, reload=True): """ @@ -540,6 +558,15 @@ class ExtractArchive(Hook): self.passwords = passwords + #: Deprecated method, use `add_password` instead + @Expose + def addPassword(self, *args, **kwargs): + """ + See `add_password` + """ + return self.add_password(*args, **kwargs) + + @Expose def add_password(self, password): """ diff --git a/module/plugins/hooks/FreeWayMeHook.py b/module/plugins/hooks/FreeWayMeHook.py index 093dd82d3..48af011d4 100644 --- a/module/plugins/hooks/FreeWayMeHook.py +++ b/module/plugins/hooks/FreeWayMeHook.py @@ -19,6 +19,6 @@ class FreeWayMeHook(MultiHook): def get_hosters(self): - user, data = self.account.selectAccount() + user, data = self.account.select_account() hostis = self.load("http://www.free-way.bz/ajax/jd.php", get={"id": 3, "user": user, "pass": data['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10 return [x.strip() for x in hostis.split(",") if x.strip()] diff --git a/module/plugins/hooks/PremiumToHook.py b/module/plugins/hooks/PremiumToHook.py index dd85cb903..937064087 100644 --- a/module/plugins/hooks/PremiumToHook.py +++ b/module/plugins/hooks/PremiumToHook.py @@ -21,7 +21,7 @@ class PremiumToHook(MultiHook): def get_hosters(self): - user, data = self.account.selectAccount() + user, data = self.account.select_account() html = self.load("http://premium.to/api/hosters.php", get={'username': user, 'password': data['password']}) return [x.strip() for x in html.replace("\"", "").split(";")] diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py index 24d091454..94fc1d59c 100644 --- a/module/plugins/hooks/PremiumizeMeHook.py +++ b/module/plugins/hooks/PremiumizeMeHook.py @@ -21,7 +21,7 @@ class PremiumizeMeHook(MultiHook): def get_hosters(self): #: Get account data - user, data = self.account.selectAccount() + user, data = self.account.select_account() #: Get supported hosters list from premiumize.me using the #: json API v1 (see https://secure.premiumize.me/?show=api) diff --git a/module/plugins/hooks/RPNetBizHook.py b/module/plugins/hooks/RPNetBizHook.py index be472af26..19975a0cd 100644 --- a/module/plugins/hooks/RPNetBizHook.py +++ b/module/plugins/hooks/RPNetBizHook.py @@ -21,7 +21,7 @@ class RPNetBizHook(MultiHook): def get_hosters(self): #: Get account data - user, data = self.account.selectAccount() + user, data = self.account.select_account() res = self.load("https://premium.rpnet.biz/client_api.php", get={'username': user, 'password': data['password'], 'action': "showHosterList"}) diff --git a/module/plugins/hooks/RehostToHook.py b/module/plugins/hooks/RehostToHook.py index 016377e15..67f3a6e8a 100644 --- a/module/plugins/hooks/RehostToHook.py +++ b/module/plugins/hooks/RehostToHook.py @@ -19,8 +19,8 @@ class RehostToHook(MultiHook): def get_hosters(self): - user, data = self.account.selectAccount() + user, data = self.account.select_account() html = self.load("http://rehost.to/api.php", get={'cmd' : "get_supported_och_dl", - 'long_ses': self.account.getAccountInfo(user)['session']}) + 'long_ses': self.account.get_account_info(user)['session']}) return [x.strip() for x in html.replace("\"", "").split(",")] diff --git a/module/plugins/hooks/SmoozedComHook.py b/module/plugins/hooks/SmoozedComHook.py index d1cbd8126..2d4fb564e 100644 --- a/module/plugins/hooks/SmoozedComHook.py +++ b/module/plugins/hooks/SmoozedComHook.py @@ -19,5 +19,5 @@ class SmoozedComHook(MultiHook): def get_hosters(self): - user, data = self.account.selectAccount() - return self.account.getAccountInfo(user)["hosters"] + user, data = self.account.select_account() + return self.account.get_account_info(user)["hosters"] diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 488b300b8..50e818c66 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -95,6 +95,15 @@ class UpdateManager(Hook): self.update() + #: Deprecated method, use `autoreload_plugins` instead + @Expose + def autoreloadPlugins(self, *args, **kwargs): + """ + See `autoreload_plugins` + """ + return self.autoreload_plugins(*args, **kwargs) + + @Expose def autoreload_plugins(self): """ @@ -292,6 +301,15 @@ class UpdateManager(Hook): return exitcode + #: Deprecated method, use `remove_plugins` instead + @Expose + def removePlugins(self, *args, **kwargs): + """ + See `remove_plugins` + """ + return self.remove_plugins(*args, **kwargs) + + @Expose def remove_plugins(self, type_plugins): """ -- cgit v1.2.3 From 1f5a55ae2133a782bdcca334ecbcdbde50dbcf99 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Jul 2015 15:29:48 +0200 Subject: No more need to use the req argument when call load method --- module/plugins/hooks/EasybytezComHook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/EasybytezComHook.py b/module/plugins/hooks/EasybytezComHook.py index 69f3a2a34..084c01eb7 100644 --- a/module/plugins/hooks/EasybytezComHook.py +++ b/module/plugins/hooks/EasybytezComHook.py @@ -23,7 +23,7 @@ class EasybytezComHook(MultiHook): def get_hosters(self): user, data = self.account.select_account() - req = self.account.get_account_request(user) - html = self.load("http://www.easybytez.com", req=req) + html = self.load("http://www.easybytez.com", + req=self.account.get_account_request(user)) return re.search(r'\s*Supported sites:(.*)', html).group(1).split(',') -- cgit v1.2.3 From 9e5d813d7721e351ac02ba72bdc473a7d77ba6b7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Jul 2015 20:04:36 +0200 Subject: Code cosmetics --- module/plugins/hooks/BypassCaptcha.py | 4 ++-- module/plugins/hooks/CaptchaBrotherhood.py | 5 +++-- module/plugins/hooks/DeathByCaptcha.py | 4 ++-- module/plugins/hooks/ExpertDecoders.py | 4 ++-- module/plugins/hooks/ImageTyperz.py | 4 ++-- module/plugins/hooks/MultiHome.py | 2 +- module/plugins/hooks/SkipRev.py | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index cb91c06ce..ab08c68c1 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -3,7 +3,7 @@ import pycurl from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getRequest +from module.network.RequestFactory import getRequest as get_request from module.plugins.internal.Hook import Hook, threaded @@ -61,7 +61,7 @@ class BypassCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): - req = getRequest() + req = get_request() # raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index b2f370f32..d35bc720d 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -9,10 +9,11 @@ import urllib try: from PIL import Image + except ImportError: import Image -from module.network.RequestFactory import getRequest +from module.network.RequestFactory import getRequest as get_request from module.plugins.internal.Hook import Hook, threaded @@ -86,7 +87,7 @@ class CaptchaBrotherhood(Hook): except Exception, e: raise CaptchaBrotherhoodException("Reading or converting captcha image failed: %s" % e) - req = getRequest() + req = get_request() url = "%ssendNewCaptcha.aspx?%s" % (self.API_URL, urllib.urlencode({'username' : self.get_config('username'), diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index ec2554a8f..43bad2d0b 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -10,7 +10,7 @@ from base64 import b64encode from module.common.json_layer import json_loads from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getRequest +from module.network.RequestFactory import getRequest as get_request from module.plugins.internal.Hook import Hook, threaded @@ -73,7 +73,7 @@ class DeathByCaptcha(Hook): def api_response(self, api="captcha", post=False, multipart=False): - req = getRequest() + req = get_request() req.c.setopt(pycurl.HTTPHEADER, ["Accept: application/json", "User-Agent: pyLoad %s" % self.core.version]) if post: diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 6ec1f8bf1..919445db8 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -8,7 +8,7 @@ import uuid from base64 import b64encode from module.network.HTTPRequest import BadHeader -from module.network.RequestFactory import getRequest +from module.network.RequestFactory import getRequest as get_request from module.plugins.internal.Hook import Hook, threaded @@ -55,7 +55,7 @@ class ExpertDecoders(Hook): with open(task.captchaFile, 'rb') as f: data = f.read() - req = getRequest() + req = get_request() # raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index c70518c17..5e2f21c8b 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -7,7 +7,7 @@ import re from base64 import b64encode -from module.network.RequestFactory import getRequest +from module.network.RequestFactory import getRequest as get_request from module.plugins.internal.Hook import Hook, threaded @@ -74,7 +74,7 @@ class ImageTyperz(Hook): def submit(self, captcha, captchaType="file", match=None): - req = getRequest() + req = get_request() # raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 12a65c601..7e4b5e583 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -56,7 +56,7 @@ class MultiHome(Hook): self.log_debug("Using address", iface.adress) return oldGetRequest(pluginName, account) - requestFactory.getRequest = getRequest + requestFactory.getRequest = get_request def best_interface(self, pluginName, account): diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 8fd49889c..9f5f4f231 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -41,7 +41,7 @@ class SkipRev(Hook): if hasattr(pyfile.pluginmodule, "getInfo"): #@NOTE: getInfo is deprecated in 0.4.10 return pyfile.pluginmodule.get_info([pyfile.url]).next()[0] else: - self.log_warning("Unable to grab file name") + self.log_warning(_("Unable to grab file name")) return urlparse.urlparse(urllib.unquote(pyfile.url)).path.split('/')[-1] -- cgit v1.2.3 From dad722ac7255640e7e0541c4094a4d2e4de79cd3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 00:05:58 +0200 Subject: Code cosmetics (2) --- module/plugins/hooks/BypassCaptcha.py | 2 +- module/plugins/hooks/Checksum.py | 4 ++-- module/plugins/hooks/ClickAndLoad.py | 4 ++-- module/plugins/hooks/DeleteFinished.py | 4 ++-- module/plugins/hooks/DownloadScheduler.py | 2 +- module/plugins/hooks/ExpertDecoders.py | 2 +- module/plugins/hooks/ExtractArchive.py | 28 ++++++++++++++-------------- module/plugins/hooks/IRCInterface.py | 6 +++--- module/plugins/hooks/ImageTyperz.py | 2 +- module/plugins/hooks/RestartFailed.py | 2 +- module/plugins/hooks/SkipRev.py | 2 +- module/plugins/hooks/UnSkipOnFail.py | 26 +++++++++++++------------- module/plugins/hooks/UpdateManager.py | 22 +++++++++++----------- module/plugins/hooks/XFileSharingPro.py | 6 +++--- module/plugins/hooks/XMPPInterface.py | 8 ++++---- 15 files changed, 60 insertions(+), 60 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index ab08c68c1..42c30ba25 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -63,7 +63,7 @@ class BypassCaptcha(Hook): def submit(self, captcha, captchaType="file", match=None): req = get_request() - # raise timeout threshold + #: Raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 7f42347df..4d2dbf576 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -110,7 +110,7 @@ class Checksum(Hook): if not os.path.isfile(local_file): self.check_failed(pyfile, None, "File does not exist") - #: validate file size + #: Validate file size if "size" in data: api_size = int(data['size']) file_size = os.path.getsize(local_file) @@ -121,7 +121,7 @@ class Checksum(Hook): data.pop('size', None) - #: validate checksum + #: Validate checksum if data and self.get_config('check_checksum'): if not 'md5' in data: diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 109452105..c361d51b2 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -91,12 +91,12 @@ class ClickAndLoad(Hook): except NameError: self.log_error(_("pyLoad's webinterface is configured to use HTTPS, Please install python's ssl lib or disable HTTPS")) - client_socket.close() #: reset the connection. + client_socket.close() #: Reset the connection. continue except Exception, e: self.log_error(_("SSL error: %s") % e.message) - client_socket.close() #: reset the connection. + client_socket.close() #: Reset the connection. continue server_socket.connect(("127.0.0.1", webport)) diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index ec708eb10..5c613f5c6 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -50,8 +50,8 @@ class DeleteFinished(Hook): def activate(self): self.info['sleep'] = True - #: interval = self.get_config('interval') - #: self.plugin_config_changed(self.__name__, 'interval', interval) + # interval = self.get_config('interval') + # self.plugin_config_changed(self.__name__, 'interval', interval) self.interval = max(self.MIN_CHECK_INTERVAL, self.get_config('interval') * 60 * 60) self.add_event('package_finished', self.wakeup) diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index ed43683fa..e1114d615 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -25,7 +25,7 @@ class DownloadScheduler(Hook): def setup(self): self.info = {} #@TODO: Remove in 0.4.10 - self.cb = None #: callback to scheduler job; will be by removed hookmanager when hook unloaded + self.cb = None #: Callback to scheduler job; will be by removed hookmanager when hook unloaded def activate(self): diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 919445db8..17890f691 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -56,7 +56,7 @@ class ExpertDecoders(Hook): data = f.read() req = get_request() - # raise timeout threshold + #: Raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 9ca7bf854..ad9f67a1a 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -23,7 +23,7 @@ if sys.version_info < (2, 7) and os.name != "nt": raise - #: unsued timeout option for older python version + #: Unsued timeout option for older python version def wait(self, timeout=0): """ Wait for child process to terminate. Returns returncode @@ -36,8 +36,8 @@ if sys.version_info < (2, 7) and os.name != "nt": except OSError, e: if e.errno != errno.ECHILD: raise - #: This happens if SIGCLD is set to be ignored or waiting - #: for child processes has otherwise been disabled for our + #: This happens if SIGCLD is set to be ignored or waiting + #: For child processes has otherwise been disabled for our #: process. This child is dead, we can't get the status. sts = 0 self._handle_exitstatus(sts) @@ -196,7 +196,7 @@ class ExtractArchive(Hook): packages = self.queue.get() while packages: - if self.last_package: #: called from allDownloadsProcessed + if self.last_package: #: Called from allDownloadsProcessed self.last_package = False if self.extract(packages, thread): #@NOTE: check only if all gone fine, no failed reporting for now self.manager.dispatchEvent("all_archives_extracted") @@ -205,7 +205,7 @@ class ExtractArchive(Hook): if self.extract(packages, thread): #@NOTE: check only if all gone fine, no failed reporting for now pass - packages = self.queue.get() #: check for packages added during extraction + packages = self.queue.get() #: Check for packages added during extraction self.extracting = False @@ -272,12 +272,12 @@ class ExtractArchive(Hook): if extensions: self.log_debug("Use for extensions: %s" % "|.".join(extensions)) - #: reload from txt file + #: Reload from txt file self.reload_passwords() download_folder = self.core.config.get("general", "download_folder") - #: iterate packages -> extractors -> targets + #: Iterate packages -> extractors -> targets for pid in ids: pypack = self.core.files.getPackage(pid) @@ -287,8 +287,8 @@ class ExtractArchive(Hook): self.log_info(_("Check package: %s") % pypack.name) - #: determine output folder - out = fs_join(download_folder, pypack.folder, destination, "") #: force trailing slash + #: Determine output folder + out = fs_join(download_folder, pypack.folder, destination, "") #: Force trailing slash if subfolder: out = fs_join(out, pypack.folder) @@ -299,9 +299,9 @@ class ExtractArchive(Hook): matched = False success = True files_ids = dict((pylink['name'],((fs_join(download_folder, pypack.folder, pylink['name'])), pylink['id'], out)) for pylink \ - in sorted(pypack.getChildren().itervalues(), key=lambda k: k['name'])).values() #: remove duplicates + in sorted(pypack.getChildren().itervalues(), key=lambda k: k['name'])).values() #: Remove duplicates - #: check as long there are unseen files + #: Check as long there are unseen files while files_ids: new_files_ids = [] @@ -351,7 +351,7 @@ class ExtractArchive(Hook): success = False continue - #: remove processed file and related multiparts from list + #: Remove processed file and related multiparts from list files_ids = [(fname, fid, fout) for fname, fid, fout in files_ids \ if fname not in archive.getDeleteFiles()] self.log_debug("Extracted files: %s" % new_files) @@ -364,11 +364,11 @@ class ExtractArchive(Hook): continue if recursive and os.path.isfile(file): - new_files_ids.append((filename, fid, os.path.dirname(filename))) #: append as new target + new_files_ids.append((filename, fid, os.path.dirname(filename))) #: Append as new target self.manager.dispatchEvent("archive_extracted", pyfile, archive) - files_ids = new_files_ids #: also check extracted files + files_ids = new_files_ids #: Also check extracted files if matched: if success: diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 32597aa42..5d8376b4e 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -84,7 +84,7 @@ class IRCInterface(Thread, Hook): def run(self): - #: connect to IRC etc. + #: Connect to IRC etc. self.sock = socket.socket() host = self.get_config('host') self.sock.connect((host, self.get_config('port'))) @@ -339,12 +339,12 @@ class IRCInterface(Thread, Hook): if not pack: return ["ERROR: Package doesn't exists."] - # TODO add links + #@TODO: add links return ["INFO: Added %d links to Package %s [#%d]" % (len(links), pack['name'], id)] except Exception: - #: create new package + #: Create new package id = self.core.api.addPackage(pack, links, 1) return ["INFO: Created new Package %s [#%d] with %d links." % (pack, id, len(links))] diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 5e2f21c8b..b46728a0d 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -75,7 +75,7 @@ class ImageTyperz(Hook): def submit(self, captcha, captchaType="file", match=None): req = get_request() - # raise timeout threshold + #: Raise timeout threshold req.c.setopt(pycurl.LOW_SPEED_TIME, 80) try: diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index e19705d31..52752861f 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -41,5 +41,5 @@ class RestartFailed(Hook): def activate(self): - #: self.plugin_config_changed(self.__name__, "interval", self.get_config('interval')) + # self.plugin_config_changed(self.__name__, "interval", self.get_config('interval')) self.interval = max(self.MIN_CHECK_INTERVAL, self.get_config('interval') * 60) diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 9f5f4f231..5ec6290ac 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -73,7 +73,7 @@ class SkipRev(Hook): queued = [True for link in self.core.api.getPackageData(pyfile.package().id).links \ if link.status not in status_list and pyname.match(link.name)].count(True) - if not queued or queued < revtokeep: #: keep one rev at least in auto mode + if not queued or queued < revtokeep: #: Keep one rev at least in auto mode return pyfile.setCustomStatus("SkipRev", "skipped") diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 4e1e60f61..5507cd20f 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -35,13 +35,13 @@ class UnSkipOnFail(Hook): if link: self.log_info(_("Queue found duplicate: %s (pid:%s)") % (link.name, link.packageID)) - # Change status of "link" to "new_status". - # "link" has to be a valid FileData object, - # "new_status" has to be a valid status name - # (i.e. "queued" for this Plugin) - # It creates a temporary PyFile object using - # "link" data, changes its status, and tells - # the core.files-manager to save its data. + #: Change status of "link" to "new_status". + #: "link" has to be a valid FileData object, + #: "new_status" has to be a valid status name + #: (i.e. "queued" for this Plugin) + #: It creates a temporary PyFile object using + #: "link" data, changes its status, and tells + #: The core.files-manager to save its data. pylink = self._pyfile(link) pylink.setCustomStatus(_("unskipped"), "queued") @@ -63,22 +63,22 @@ class UnSkipOnFail(Hook): the data for "pyfile" iotselöf. It does MOT check the link's status. """ - queue = self.core.api.getQueue() #: get packages (w/o files, as most file data is useless here) + queue = self.core.api.getQueue() #: Get packages (w/o files, as most file data is useless here) for package in queue: - #: check if package-folder equals pyfile's package folder + #: Check if package-folder equals pyfile's package folder if package.folder != pyfile.package().folder: continue - #: now get packaged data w/ files/links + #: Now get packaged data w/ files/links pdata = self.core.api.getPackageData(package.pid) for link in pdata.links: - #: check if link is "skipped" + #: Check if link is "skipped" if link.status != 4: continue - #: check if link name collides with pdata's name - #: AND at last check if it is not pyfile itself + #: Check if link name collides with pdata's name + #: and at last check if it is not pyfile itself if link.name == pyfile.name and link.fid != pyfile.id: return link diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 50e818c66..6f6ad9838 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -61,7 +61,7 @@ class UpdateManager(Hook): def setup(self): self.info = {'pyload': False, 'version': None, 'plugins': False, 'last_check': time.time()} - self.mtimes = {} #: store modification time for each plugin + self.mtimes = {} #: Store modification time for each plugin self.event_map = {'allDownloadsProcessed': "all_downloads_processed"} @@ -182,11 +182,11 @@ class UpdateManager(Hook): self.info['version'] = data[0] exitcode = 3 - # Exit codes: - # -1 = No plugin updated, new pyLoad version available - # 0 = No plugin updated - # 1 = Plugins updated - # 2 = Plugins updated, but restart required + #: Exit codes: + #: -1 = No plugin updated, new pyLoad version available + #: 0 = No plugin updated + #: 1 = Plugins updated + #: 2 = Plugins updated, but restart required return exitcode @@ -294,10 +294,10 @@ class UpdateManager(Hook): else: self.log_info(_("No plugin updates available")) - # Exit codes: - # 0 = No plugin updated - # 1 = Plugins updated - # 2 = Plugins updated, but restart required + #: Exit codes: + #: 0 = No plugin updated + #: 1 = Plugins updated + #: 2 = Plugins updated, but restart required return exitcode @@ -350,4 +350,4 @@ class UpdateManager(Hook): id = (type, name) removed.add(id) - return list(removed) #: return a list of the plugins successfully removed + return list(removed) #: Return a list of the plugins successfully removed diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 9c42d1c0a..45acc9976 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -34,12 +34,12 @@ class XFileSharingPro(Hook): "junkyvideo.com", "linestorage.com", "ravishare.com", "ryushare.com", "salefiles.com", "sendmyway.com", "sharebeast.com", "sharesix.com", "thefile.me", "verzend.be", "worldbytez.com", "xvidstage.com", - # NOT TESTED: + #: NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", "vidbull.com", "zalaa.com", "zomgupload.com", - # NOT WORKING: + #: NOT WORKING: "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] CRYPTER_BUILTIN = ["junocloud.me", "rapidfileshare.net"] @@ -105,7 +105,7 @@ class XFileSharingPro(Hook): def deactivate(self): - #: self.unload_hoster("BasePlugin") + # self.unload_hoster("BasePlugin") for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): self._unload(type, plugin) diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index a2c32166f..4262d3034 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -36,7 +36,7 @@ class XMPPInterface(IRCInterface, JabberClient): self.jid = JID(self.get_config('jid')) password = self.get_config('pw') - #: if bare JID is provided add a resource -- it is required + #: If bare JID is provided add a resource -- it is required if not self.jid.resource: self.jid = JID(self.jid.node, self.jid.domain, "pyLoad") @@ -47,8 +47,8 @@ class XMPPInterface(IRCInterface, JabberClient): tls_settings = None auth = ("sasl:DIGEST-MD5", "digest") - #: setup client with provided connection information - #: and identity data + #: Setup client with provided connection information + #: And identity data JabberClient.__init__(self, self.jid, password, disco_name="pyLoad XMPP Client", disco_type="bot", tls_settings=tls_settings, auth_methods=auth) @@ -83,7 +83,7 @@ class XMPPInterface(IRCInterface, JabberClient): def run(self): - #: connect to IRC etc. + #: Connect to IRC etc. self.connect() try: self.loop() -- cgit v1.2.3 From 502517f37c7540b0bddb092e69386d9d6f08800c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 09:42:34 +0200 Subject: Fix addons --- module/plugins/hooks/AndroidPhoneNotify.py | 11 +++-------- module/plugins/hooks/AntiVirus.py | 11 ++--------- module/plugins/hooks/BypassCaptcha.py | 6 ------ module/plugins/hooks/Captcha9Kw.py | 6 ------ module/plugins/hooks/CaptchaBrotherhood.py | 6 ------ module/plugins/hooks/Checksum.py | 8 +++----- module/plugins/hooks/ClickAndLoad.py | 11 ++--------- module/plugins/hooks/DeathByCaptcha.py | 6 ------ module/plugins/hooks/DeleteFinished.py | 7 +++---- module/plugins/hooks/DownloadScheduler.py | 12 ++---------- module/plugins/hooks/ExpertDecoders.py | 6 ------ module/plugins/hooks/ExternalScripts.py | 11 ++++------- module/plugins/hooks/ExtractArchive.py | 7 +++---- module/plugins/hooks/HotFolder.py | 7 +++---- module/plugins/hooks/IRCInterface.py | 9 +++------ module/plugins/hooks/ImageTyperz.py | 6 ------ module/plugins/hooks/JustPremium.py | 10 +++------- module/plugins/hooks/MergeFiles.py | 10 ++-------- module/plugins/hooks/MultiHome.py | 10 +++------- module/plugins/hooks/RestartFailed.py | 7 +++---- module/plugins/hooks/SkipRev.py | 29 +++++++++-------------------- module/plugins/hooks/UnSkipOnFail.py | 11 ++--------- module/plugins/hooks/UpdateManager.py | 6 +++--- module/plugins/hooks/UserAgentSwitcher.py | 11 ++--------- module/plugins/hooks/WindowsPhoneNotify.py | 11 +++-------- module/plugins/hooks/XFileSharingPro.py | 4 +--- 26 files changed, 59 insertions(+), 180 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index 1cea0c994..e6ddac546 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -2,10 +2,10 @@ import time -from module.plugins.internal.Hook import Hook, Expose +from module.plugins.internal.Addon import Addon, Expose -class AndroidPhoneNotify(Hook): +class AndroidPhoneNotify(Addon): __name__ = "AndroidPhoneNotify" __type__ = "hook" __version__ = "0.10" @@ -26,12 +26,7 @@ class AndroidPhoneNotify(Hook): ("Walter Purcaro", "vuolter@gmail.com" )] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - + def init(self): self.event_list = ["plugin_updated"] self.event_map = {'allDownloadsProcessed': "all_downloads_processed"} diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index cb9d5aaa6..8b19af84c 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -9,11 +9,11 @@ try: except ImportError: pass -from module.plugins.internal.Hook import Hook, Expose, threaded +from module.plugins.internal.Addon import Addon, Expose, threaded from module.utils import fs_encode, save_join as fs_join -class AntiVirus(Hook): +class AntiVirus(Addon): __name__ = "AntiVirus" __type__ = "hook" __version__ = "0.11" @@ -32,13 +32,6 @@ class AntiVirus(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - @Expose @threaded def scan(self, pyfile, thread): diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 42c30ba25..2607ac5ad 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -40,8 +40,6 @@ class BypassCaptcha(Hook): ("zoidberg" , "zoidberg@mujmail.cz" )] - interval = 0 #@TODO: Remove in 0.4.10 - PYLOAD_KEY = "4f771155b640970d5607f919a615bdefc67e7d32" SUBMIT_URL = "http://bypasscaptcha.com/upload.php" @@ -49,10 +47,6 @@ class BypassCaptcha(Hook): GETCREDITS_URL = "http://bypasscaptcha.com/ex_left.php" - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def get_credits(self): res = self.load(self.GETCREDITS_URL, post={"key": self.get_config('passkey')}) diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 0ef67e54d..ec989ae51 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -33,15 +33,9 @@ class Captcha9Kw(Hook): ("Walter Purcaro", "vuolter@gmail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - API_URL = "https://www.9kw.eu/index.cgi" - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def get_credits(self): res = self.load(self.API_URL, get={'apikey': self.get_config('passkey'), diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index d35bc720d..1265fc0ae 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -50,15 +50,9 @@ class CaptchaBrotherhood(Hook): ("zoidberg", "zoidberg@mujmail.cz")] - interval = 0 #@TODO: Remove in 0.4.10 - API_URL = "http://www.captchabrotherhood.com/" - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def get_credits(self): res = self.load(self.API_URL + "askCredits.aspx", get={"username": self.get_config('username'), "password": self.get_config('password')}) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 4d2dbf576..681816a0f 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -7,7 +7,7 @@ import os import re import zlib -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon from module.utils import save_join as fs_join, fs_encode @@ -35,7 +35,7 @@ def compute_checksum(local_file, algorithm): return None -class Checksum(Hook): +class Checksum(Addon): __name__ = "Checksum" __type__ = "hook" __version__ = "0.18" @@ -53,7 +53,6 @@ class Checksum(Hook): ("stickell" , "l.stickell@yahoo.it")] - interval = 0 #@TODO: Remove in 0.4.10 methods = {'sfv' : 'crc32', 'crc' : 'crc32', 'hash': 'md5'} @@ -68,8 +67,7 @@ class Checksum(Hook): self.log_info(_("Checksum validation is disabled in plugin configuration")) - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 + def init(self): self.algorithms = sorted( getattr(hashlib, "algorithms", ("md5", "sha1", "sha224", "sha256", "sha384", "sha512")), reverse=True) diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index c361d51b2..61e28f469 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -10,7 +10,7 @@ except ImportError: from threading import Lock -from module.plugins.internal.Hook import Hook, threaded +from module.plugins.internal.Addon import Addon, threaded def forward(source, destination): @@ -26,7 +26,7 @@ def forward(source, destination): #@TODO: IPv6 support -class ClickAndLoad(Hook): +class ClickAndLoad(Addon): __name__ = "ClickAndLoad" __type__ = "hook" __version__ = "0.45" @@ -41,13 +41,6 @@ class ClickAndLoad(Hook): ("Walter Purcaro", "vuolter@gmail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def activate(self): if not self.core.config.get("webinterface", "activated"): return diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 43bad2d0b..6727107ca 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -63,15 +63,9 @@ class DeathByCaptcha(Hook): ("zoidberg", "zoidberg@mujmail.cz")] - interval = 0 #@TODO: Remove in 0.4.10 - API_URL = "http://api.dbcapi.me/api/" - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def api_response(self, api="captcha", post=False, multipart=False): req = get_request() req.c.setopt(pycurl.HTTPHEADER, ["Accept: application/json", "User-Agent: pyLoad %s" % self.core.version]) diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 5c613f5c6..2143fe19a 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- from module.database import style -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon -class DeleteFinished(Hook): +class DeleteFinished(Addon): __name__ = "DeleteFinished" __type__ = "hook" __version__ = "1.14" @@ -21,8 +21,7 @@ class DeleteFinished(Hook): ## overwritten methods ## - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 + def init(self): # self.event_map = {'pluginConfigChanged': "plugin_config_changed"} self.interval = self.MIN_CHECK_INTERVAL diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index e1114d615..bd67dec67 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -3,10 +3,10 @@ import re import time -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon -class DownloadScheduler(Hook): +class DownloadScheduler(Addon): __name__ = "DownloadScheduler" __type__ = "hook" __version__ = "0.24" @@ -20,14 +20,6 @@ class DownloadScheduler(Hook): ("stickell", "l.stickell@yahoo.it")] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - self.cb = None #: Callback to scheduler job; will be by removed hookmanager when hook unloaded - - def activate(self): self.update_schedule() diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 17890f691..baf880644 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -26,15 +26,9 @@ class ExpertDecoders(Hook): ("zoidberg", "zoidberg@mujmail.cz")] - interval = 0 #@TODO: Remove in 0.4.10 - API_URL = "http://www.fasttypers.org/imagepost.ashx" - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def get_credits(self): res = self.load(self.API_URL, post={"key": self.get_config('passkey'), "action": "balance"}) diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 6bf3cf347..2a96d9e59 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -3,11 +3,11 @@ import os import subprocess -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon from module.utils import fs_encode, save_join as fs_join -class ExternalScripts(Hook): +class ExternalScripts(Addon): __name__ = "ExternalScripts" __type__ = "hook" __version__ = "0.43" @@ -23,11 +23,8 @@ class ExternalScripts(Hook): ("Walter Purcaro", "vuolter@gmail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {'oldip': None} + def init(self): + self.info['oldip'] = None self.scripts = {} self.event_list = ["archive_extract_failed", "archive_extracted" , diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index ad9f67a1a..cead3595c 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -55,7 +55,7 @@ if os.name != "nt": from grp import getgrnam from pwd import getpwnam -from module.plugins.internal.Hook import Hook, Expose, threaded +from module.plugins.internal.Addon import Addon, Expose, threaded from module.plugins.internal.Plugin import replace_patterns from module.plugins.internal.Extractor import ArchiveError, CRCError, PasswordError from module.utils import fs_encode, save_join as fs_join, uniqify @@ -109,7 +109,7 @@ class ArchiveQueue(object): return self.set(queue) -class ExtractArchive(Hook): +class ExtractArchive(Addon): __name__ = "ExtractArchive" __type__ = "hook" __version__ = "1.46" @@ -141,8 +141,7 @@ class ExtractArchive(Hook): NAME_REPLACEMENTS = [(r'\.part\d+\.rar$', ".part.rar")] - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 + def init(self): self.event_map = {'allDownloadsProcessed': "all_downloads_processed", 'packageDeleted' : "package_deleted" } diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 8e1d1c54f..b98f325fa 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -7,11 +7,11 @@ import time from shutil import move -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon from module.utils import fs_encode, save_join as fs_join -class HotFolder(Hook): +class HotFolder(Addon): __name__ = "HotFolder" __type__ = "hook" __version__ = "0.16" @@ -26,8 +26,7 @@ class HotFolder(Hook): __authors__ = [("RaNaN", "RaNaN@pyload.de")] - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 + def init(self): self.interval = 30 diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 5d8376b4e..e31435e96 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -11,11 +11,11 @@ from select import select from threading import Thread from module.Api import PackageDoesNotExists, FileDoesNotExists -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon from module.utils import formatSize -class IRCInterface(Thread, Hook): +class IRCInterface(Thread, Addon): __name__ = "IRCInterface" __type__ = "hook" __version__ = "0.15" @@ -36,12 +36,9 @@ class IRCInterface(Thread, Hook): __authors__ = [("Jeix", "Jeix@hasnomail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - - def __init__(self, core, manager): Thread.__init__(self) - Hook.__init__(self, core, manager) + Addon.__init__(self, core, manager) self.set_daemon(True) diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index b46728a0d..2e4cae903 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -44,17 +44,11 @@ class ImageTyperz(Hook): ("zoidberg", "zoidberg@mujmail.cz")] - interval = 0 #@TODO: Remove in 0.4.10 - SUBMIT_URL = "http://captchatypers.com/Forms/UploadFileAndGetTextNEW.ashx" RESPOND_URL = "http://captchatypers.com/Forms/SetBadImage.ashx" GETCREDITS_URL = "http://captchatypers.com/Forms/RequestBalance.ashx" - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def get_credits(self): res = self.load(self.GETCREDITS_URL, post={'action': "REQUESTBALANCE", diff --git a/module/plugins/hooks/JustPremium.py b/module/plugins/hooks/JustPremium.py index 706de4d81..b30625e9a 100644 --- a/module/plugins/hooks/JustPremium.py +++ b/module/plugins/hooks/JustPremium.py @@ -2,10 +2,10 @@ import re -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon -class JustPremium(Hook): +class JustPremium(Addon): __name__ = "JustPremium" __type__ = "hook" __version__ = "0.24" @@ -20,11 +20,7 @@ class JustPremium(Hook): ("immenz" , "immenz@gmx.net" )] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 + def init(self): self.event_map = {'linksAdded': "links_added"} diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 9aa70aa71..b5245cc14 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -6,11 +6,11 @@ import os import re import traceback -from module.plugins.internal.Hook import Hook, threaded +from module.plugins.internal.Addon import Addon, threaded from module.utils import save_join as fs_join -class MergeFiles(Hook): +class MergeFiles(Addon): __name__ = "MergeFiles" __type__ = "hook" __version__ = "0.16" @@ -22,15 +22,9 @@ class MergeFiles(Hook): __authors__ = [("and9000", "me@has-no-mail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - BUFFER_SIZE = 4096 - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - @threaded def package_finished(self, pack): files = {} diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 7e4b5e583..bfb420aea 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -2,10 +2,10 @@ import time -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon -class MultiHome(Hook): +class MultiHome(Addon): __name__ = "MultiHome" __type__ = "hook" __version__ = "0.14" @@ -17,11 +17,7 @@ class MultiHome(Hook): __authors__ = [("mkaay", "mkaay@mkaay.de")] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 + def init(self): self.register = {} self.interfaces = [] diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 52752861f..8740ccd7d 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon -class RestartFailed(Hook): +class RestartFailed(Addon): __name__ = "RestartFailed" __type__ = "hook" __version__ = "1.60" @@ -34,8 +34,7 @@ class RestartFailed(Hook): self.core.api.restartFailed() - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 + def init(self): # self.event_map = {'pluginConfigChanged': "plugin_config_changed"} self.interval = self.MIN_CHECK_INTERVAL diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 5ec6290ac..2123a6543 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -7,13 +7,13 @@ import urlparse from types import MethodType from module.PyFile import PyFile -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon -class SkipRev(Hook): +class SkipRev(Addon): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.32" + __version__ = "0.33" __config__ = [("mode" , "Auto;Manual", "Choose recovery archives to skip" , "Auto"), ("revtokeep", "int" , "Number of recovery archives to keep for package", 0 )] @@ -23,26 +23,15 @@ class SkipRev(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - @staticmethod - def _setup(self): - self.pyfile.plugin._setup() + def _init(self): + self.pyfile.plugin._init() if self.pyfile.hasStatus("skipped"): self.skip(self.pyfile.statusname or self.pyfile.pluginname) def _name(self, pyfile): - if hasattr(pyfile.pluginmodule, "getInfo"): #@NOTE: getInfo is deprecated in 0.4.10 - return pyfile.pluginmodule.get_info([pyfile.url]).next()[0] - else: - self.log_warning(_("Unable to grab file name")) - return urlparse.urlparse(urllib.unquote(pyfile.url)).path.split('/')[-1] + return pyfile.pluginclass.get_info(pyfile.url)['name'] def _pyfile(self, link): @@ -78,10 +67,10 @@ class SkipRev(Hook): pyfile.setCustomStatus("SkipRev", "skipped") - if not hasattr(pyfile.plugin, "_setup"): + if not hasattr(pyfile.plugin, "_init"): #: Work-around: inject status checker inside the preprocessing routine of the plugin - pyfile.plugin._setup = pyfile.plugin.setup - pyfile.plugin.setup = MethodType(self._setup, pyfile.plugin) + pyfile.plugin._init = pyfile.plugin.init + pyfile.plugin.init = MethodType(self._init, pyfile.plugin) def download_failed(self, pyfile): diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 5507cd20f..c8e58294c 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- from module.PyFile import PyFile -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon -class UnSkipOnFail(Hook): +class UnSkipOnFail(Addon): __name__ = "UnSkipOnFail" __type__ = "hook" __version__ = "0.09" @@ -16,13 +16,6 @@ class UnSkipOnFail(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def download_failed(self, pyfile): #: Check if pyfile is still "failed", maybe might has been restarted in meantime if pyfile.status != 8: diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 6f6ad9838..4ec981ac0 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -9,7 +9,7 @@ import time from operator import itemgetter -from module.plugins.internal.Hook import Expose, Hook, threaded +from module.plugins.internal.Addon import Expose, Addon, threaded from module.utils import save_join as fs_join @@ -25,7 +25,7 @@ def exists(path): return False -class UpdateManager(Hook): +class UpdateManager(Addon): __name__ = "UpdateManager" __type__ = "hook" __version__ = "0.54" @@ -59,7 +59,7 @@ class UpdateManager(Hook): self.init_periodical() - def setup(self): + def init(self): self.info = {'pyload': False, 'version': None, 'plugins': False, 'last_check': time.time()} self.mtimes = {} #: Store modification time for each plugin diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py index fdfe4b673..637f6c3ad 100644 --- a/module/plugins/hooks/UserAgentSwitcher.py +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -2,10 +2,10 @@ import pycurl -from module.plugins.internal.Hook import Hook +from module.plugins.internal.Addon import Addon -class UserAgentSwitcher(Hook): +class UserAgentSwitcher(Addon): __name__ = "UserAgentSwitcher" __type__ = "hook" __version__ = "0.10" @@ -20,13 +20,6 @@ class UserAgentSwitcher(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - - def download_preparing(self, pyfile): connecttimeout = self.get_config('connecttimeout') maxredirs = self.get_config('maxredirs') diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index 511b4b568..b4b4d2658 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -3,10 +3,10 @@ import httplib import time -from module.plugins.internal.Hook import Hook, Expose +from module.plugins.internal.Addon import Addon, Expose -class WindowsPhoneNotify(Hook): +class WindowsPhoneNotify(Addon): __name__ = "WindowsPhoneNotify" __type__ = "hook" __version__ = "0.12" @@ -28,12 +28,7 @@ class WindowsPhoneNotify(Hook): ("Walter Purcaro", "vuolter@gmail.com" )] - interval = 0 #@TODO: Remove in 0.4.10 - - - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 - + def init(self): self.event_list = ["plugin_updated"] self.event_map = {'allDownloadsProcessed': "all_downloads_processed"} diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 45acc9976..5829378d8 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -22,7 +22,6 @@ class XFileSharingPro(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - interval = 0 #@TODO: Remove in 0.4.10 regexp = {'hoster' : (r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', r'https?://(?:[^/]+\.)?(?P%s)/(?:embed-)?\w+'), 'crypter': (r'https?://(?:www\.)?(?:\w+\.)*?(?P(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+', @@ -48,8 +47,7 @@ class XFileSharingPro(Hook): # self.load_pattern() - def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 + def init(self): # self.event_map = {'pluginConfigChanged': "plugin_config_changed"} -- cgit v1.2.3 From ff9383bfe06d14d23bc0ed6af79aa8967965d078 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 10:59:52 +0200 Subject: Code cosmetics (3) --- module/plugins/hooks/BypassCaptcha.py | 6 +++--- module/plugins/hooks/CaptchaBrotherhood.py | 8 ++++---- module/plugins/hooks/Checksum.py | 4 ++-- module/plugins/hooks/DeathByCaptcha.py | 6 +++--- module/plugins/hooks/ExpertDecoders.py | 2 +- module/plugins/hooks/FreeWayMeHook.py | 2 +- module/plugins/hooks/IRCInterface.py | 12 ++++++------ module/plugins/hooks/ImageTyperz.py | 2 +- module/plugins/hooks/SmoozedComHook.py | 2 +- module/plugins/hooks/XMPPInterface.py | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 2607ac5ad..8a47da5bd 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -48,7 +48,7 @@ class BypassCaptcha(Hook): def get_credits(self): - res = self.load(self.GETCREDITS_URL, post={"key": self.get_config('passkey')}) + res = self.load(self.GETCREDITS_URL, post={'key': self.get_config('passkey')}) data = dict(x.split(' ', 1) for x in res.splitlines()) return int(data['Left']) @@ -83,8 +83,8 @@ class BypassCaptcha(Hook): def respond(self, ticket, success): try: - res = self.load(self.RESPOND_URL, post={"task_id": ticket, "key": self.get_config('passkey'), - "cv": 1 if success else 0}) + res = self.load(self.RESPOND_URL, post={'task_id': ticket, 'key': self.get_config('passkey'), + 'cv': 1 if success else 0}) except BadHeader, e: self.log_error(_("Could not send response"), e) diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 1265fc0ae..1660e2059 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -55,7 +55,7 @@ class CaptchaBrotherhood(Hook): def get_credits(self): res = self.load(self.API_URL + "askCredits.aspx", - get={"username": self.get_config('username'), "password": self.get_config('password')}) + get={'username': self.get_config('username'), 'password': self.get_config('password')}) if not res.startswith("OK"): raise CaptchaBrotherhoodException(res) else: @@ -118,9 +118,9 @@ class CaptchaBrotherhood(Hook): def api_response(self, api, ticket): res = self.load("%s%s.aspx" % (self.API_URL, api), - get={"username": self.get_config('username'), - "password": self.get_config('password'), - "captchaID": ticket}) + get={'username': self.get_config('username'), + 'password': self.get_config('password'), + 'captchaID': ticket}) if not res.startswith("OK"): raise CaptchaBrotherhoodException("Unknown response: %s" % res) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 681816a0f..29263a180 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -80,8 +80,8 @@ class Checksum(Addon): """ Compute checksum for the downloaded file and compare it with the hash provided by the hoster. pyfile.plugin.check_data should be a dictionary which can contain: - a) if known, the exact filesize in bytes (e.g. "size": 123456789) - b) hexadecimal hash string with algorithm name as key (e.g. "md5": "d76505d0869f9f928a17d42d66326307") + a) if known, the exact filesize in bytes (e.g. 'size': 123456789) + b) hexadecimal hash string with algorithm name as key (e.g. 'md5': "d76505d0869f9f928a17d42d66326307") """ if hasattr(pyfile.plugin, "check_data") and isinstance(pyfile.plugin.check_data, dict): data = pyfile.plugin.check_data.copy() diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 6727107ca..699243ddc 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -73,8 +73,8 @@ class DeathByCaptcha(Hook): if post: if not isinstance(post, dict): post = {} - post.update({"username": self.get_config('username'), - "password": self.get_config('password')}) + post.update({'username': self.get_config('username'), + 'password': self.get_config('password')}) res = None try: @@ -138,7 +138,7 @@ class DeathByCaptcha(Hook): data = f.read() data = "base64:" + b64encode(data) - res = self.api_response("captcha", {"captchafile": data}, multipart) + res = self.api_response("captcha", {'captchafile': data}, multipart) if "captcha" not in res: raise DeathByCaptchaException(res) diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index baf880644..ac1b223df 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -30,7 +30,7 @@ class ExpertDecoders(Hook): def get_credits(self): - res = self.load(self.API_URL, post={"key": self.get_config('passkey'), "action": "balance"}) + res = self.load(self.API_URL, post={'key': self.get_config('passkey'), 'action': "balance"}) if res.isdigit(): self.log_info(_("%s credits left") % res) diff --git a/module/plugins/hooks/FreeWayMeHook.py b/module/plugins/hooks/FreeWayMeHook.py index 48af011d4..a55b6bb93 100644 --- a/module/plugins/hooks/FreeWayMeHook.py +++ b/module/plugins/hooks/FreeWayMeHook.py @@ -20,5 +20,5 @@ class FreeWayMeHook(MultiHook): def get_hosters(self): user, data = self.account.select_account() - hostis = self.load("http://www.free-way.bz/ajax/jd.php", get={"id": 3, "user": user, "pass": data['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10 + hostis = self.load("http://www.free-way.bz/ajax/jd.php", get={'id': 3, 'user': user, 'pass': data['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10 return [x.strip() for x in hostis.split(",") if x.strip()] diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index e31435e96..732340e3e 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -62,7 +62,7 @@ class IRCInterface(Thread, Addon): try: if self.get_config('info_file'): self.response( - _("Download finished: %(name)s @ %(plugin)s ") % {"name": pyfile.name, "plugin": pyfile.pluginname}) + _("Download finished: %(name)s @ %(plugin)s ") % {'name': pyfile.name, 'plugin': pyfile.pluginname}) except Exception: pass @@ -73,7 +73,7 @@ class IRCInterface(Thread, Addon): task.setWaiting(60) html = self.load("http://www.freeimagehosting.net/upload.php", - post={"attached": (pycurl.FORM_FILE, task.captchaFile)}) + post={'attached': (pycurl.FORM_FILE, task.captchaFile)}) url = re.search(r"\[img\]([^\[]+)\[/img\]\[/url\]", html).group(1) self.response(_("New Captcha Request: %s") % url) @@ -136,10 +136,10 @@ class IRCInterface(Thread, Addon): continue msg = { - "origin": msg[0][1:], - "action": msg[1], - "target": msg[2], - "text": msg[3][1:] + 'origin': msg[0][1:], + 'action': msg[1], + 'target': msg[2], + 'text': msg[3][1:] } self.handle_events(msg) diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 2e4cae903..9687819a3 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -86,7 +86,7 @@ class ImageTyperz(Hook): res = self.load(self.SUBMIT_URL, post={'action': "UPLOADCAPTCHA", 'username': self.get_config('username'), - 'password': self.get_config('password'), "file": data}, + 'password': self.get_config('password'), 'file': data}, multipart=multipart, req=req) finally: diff --git a/module/plugins/hooks/SmoozedComHook.py b/module/plugins/hooks/SmoozedComHook.py index 2d4fb564e..733fd642a 100644 --- a/module/plugins/hooks/SmoozedComHook.py +++ b/module/plugins/hooks/SmoozedComHook.py @@ -20,4 +20,4 @@ class SmoozedComHook(MultiHook): def get_hosters(self): user, data = self.account.select_account() - return self.account.get_account_info(user)["hosters"] + return self.account.get_account_info(user)['hosters'] diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 4262d3034..5eee3b872 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -77,7 +77,7 @@ class XMPPInterface(IRCInterface, JabberClient): try: if self.get_config('info_file'): self.announce( - _("Download finished: %(name)s @ %(plugin)s") % {"name": pyfile.name, "plugin": pyfile.pluginname}) + _("Download finished: %(name)s @ %(plugin)s") % {'name': pyfile.name, 'plugin': pyfile.pluginname}) except Exception: pass -- cgit v1.2.3 From 56389e28ba5d2f5658278bc7f486d73be747f135 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 11:44:49 +0200 Subject: Rename self.core to self.pyload (plugins only) --- module/plugins/hooks/AndroidPhoneNotify.py | 6 ++--- module/plugins/hooks/BypassCaptcha.py | 2 +- module/plugins/hooks/Captcha9Kw.py | 2 +- module/plugins/hooks/CaptchaBrotherhood.py | 2 +- module/plugins/hooks/Checksum.py | 4 +-- module/plugins/hooks/ClickAndLoad.py | 6 ++--- module/plugins/hooks/DeathByCaptcha.py | 4 +-- module/plugins/hooks/DownloadScheduler.py | 18 +++++++------- module/plugins/hooks/ExpertDecoders.py | 2 +- module/plugins/hooks/ExternalScripts.py | 40 +++++++++++++++--------------- module/plugins/hooks/ExtractArchive.py | 26 +++++++++---------- module/plugins/hooks/HotFolder.py | 4 +-- module/plugins/hooks/IRCInterface.py | 32 ++++++++++++------------ module/plugins/hooks/ImageTyperz.py | 2 +- module/plugins/hooks/JustPremium.py | 8 +++--- module/plugins/hooks/MegaDebridEuHook.py | 2 +- module/plugins/hooks/MergeFiles.py | 6 ++--- module/plugins/hooks/MultiHome.py | 4 +-- module/plugins/hooks/RestartFailed.py | 4 +-- module/plugins/hooks/SkipRev.py | 8 +++--- module/plugins/hooks/UnSkipOnFail.py | 8 +++--- module/plugins/hooks/UpdateManager.py | 26 +++++++++---------- module/plugins/hooks/WindowsPhoneNotify.py | 6 ++--- module/plugins/hooks/XFileSharingPro.py | 8 +++--- 24 files changed, 115 insertions(+), 115 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index e6ddac546..ce3ac9b4c 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -49,7 +49,7 @@ class AndroidPhoneNotify(Addon): if not self.get_config('notifyexit'): return - if self.core.do_restart: + if self.pyload.do_restart: self.notify(_("Restarting pyLoad")) else: self.notify(_("Exiting pyLoad")) @@ -71,7 +71,7 @@ class AndroidPhoneNotify(Addon): if not self.get_config('notifyprocessed'): return - if any(True for pdata in self.core.api.getQueue() if pdata.linksdone < pdata.linkstotal): + if any(True for pdata in self.pyload.api.getQueue() if pdata.linksdone < pdata.linkstotal): self.notify(_("Package failed"), _("One or more packages was not completed successfully")) else: self.notify(_("All packages finished")) @@ -87,7 +87,7 @@ class AndroidPhoneNotify(Addon): if not key: return - if self.core.isClientConnected() and not self.get_config('ignoreclient'): + if self.pyload.isClientConnected() and not self.get_config('ignoreclient'): return elapsed_time = time.time() - self.last_notify diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 8a47da5bd..2ef3033c4 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -99,7 +99,7 @@ class BypassCaptcha(Hook): if not self.get_config('passkey'): return False - if self.core.isClientConnected() and self.get_config('check_client'): + if self.pyload.isClientConnected() and self.get_config('check_client'): return False if self.get_credits() > 0: diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index ec989ae51..8006d9462 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -161,7 +161,7 @@ class Captcha9Kw(Hook): if not self.get_config('passkey'): return - if self.core.isClientConnected() and self.get_config('check_client'): + if self.pyload.isClientConnected() and self.get_config('check_client'): return credits = self.get_credits() diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 1660e2059..946ee2372 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -137,7 +137,7 @@ class CaptchaBrotherhood(Hook): if not self.get_config('username') or not self.get_config('password'): return False - if self.core.isClientConnected() and self.get_config('check_client'): + if self.pyload.isClientConnected() and self.get_config('check_client'): return False if self.get_credits() > 10: diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 29263a180..3110f6d66 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -102,7 +102,7 @@ class Checksum(Addon): self.check_failed(pyfile, None, "No file downloaded") local_file = fs_encode(pyfile.plugin.lastDownload) - # download_folder = self.core.config.get("general", "download_folder") + # download_folder = self.pyload.config.get("general", "download_folder") # local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name)) if not os.path.isfile(local_file): @@ -163,7 +163,7 @@ class Checksum(Addon): def package_finished(self, pypack): - download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder, "") + download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder, "") for link in pypack.getChildren().itervalues(): file_type = os.path.splitext(link['name'])[1][1:].lower() diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index 61e28f469..f6c226225 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -42,11 +42,11 @@ class ClickAndLoad(Addon): def activate(self): - if not self.core.config.get("webinterface", "activated"): + if not self.pyload.config.get("webinterface", "activated"): return ip = "" if self.get_config('extern') else "127.0.0.1" - webport = self.core.config.get("webinterface", "port") + webport = self.pyload.config.get("webinterface", "port") cnlport = self.get_config('port') self.proxy(ip, webport, cnlport) @@ -78,7 +78,7 @@ class ClickAndLoad(Addon): server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if self.core.config.get("webinterface", "https"): + if self.pyload.config.get("webinterface", "https"): try: server_socket = ssl.wrap_socket(server_socket) diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index 699243ddc..e11e7305c 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -68,7 +68,7 @@ class DeathByCaptcha(Hook): def api_response(self, api="captcha", post=False, multipart=False): req = get_request() - req.c.setopt(pycurl.HTTPHEADER, ["Accept: application/json", "User-Agent: pyLoad %s" % self.core.version]) + req.c.setopt(pycurl.HTTPHEADER, ["Accept: application/json", "User-Agent: pyLoad %s" % self.pyload.version]) if post: if not isinstance(post, dict): @@ -168,7 +168,7 @@ class DeathByCaptcha(Hook): if not self.get_config('username') or not self.get_config('password'): return False - if self.core.isClientConnected() and self.get_config('check_client'): + if self.pyload.isClientConnected() and self.get_config('check_client'): return False try: diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index bd67dec67..c32088532 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -48,25 +48,25 @@ class DownloadScheduler(Addon): self.set_download_speed(last[3]) next_time = (((24 + next[0] - now[0]) * 60 + next[1] - now[1]) * 60 + next[2] - now[2]) % 86400 - self.core.scheduler.removeJob(self.cb) - self.cb = self.core.scheduler.addJob(next_time, self.update_schedule, threaded=False) + self.pyload.scheduler.removeJob(self.cb) + self.cb = self.pyload.scheduler.addJob(next_time, self.update_schedule, threaded=False) def set_download_speed(self, speed): if speed == 0: abort = self.get_config('abort') self.log_info(_("Stopping download server. (Running downloads will %sbe aborted.)") % '' if abort else _('not ')) - self.core.api.pauseServer() + self.pyload.api.pauseServer() if abort: - self.core.api.stopAllDownloads() + self.pyload.api.stopAllDownloads() else: - self.core.api.unpauseServer() + self.pyload.api.unpauseServer() if speed > 0: self.log_info(_("Setting download speed to %d kB/s") % speed) - self.core.config.set("download", "limit_speed", 1) - self.core.config.set("download", "max_speed", speed) + self.pyload.config.set("download", "limit_speed", 1) + self.pyload.config.set("download", "max_speed", speed) else: self.log_info(_("Setting download speed to FULL")) - self.core.config.set("download", "limit_speed", 0) - self.core.config.set("download", "max_speed", -1) + self.pyload.config.set("download", "limit_speed", 0) + self.pyload.config.set("download", "max_speed", -1) diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index ac1b223df..7b1ae15b1 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -74,7 +74,7 @@ class ExpertDecoders(Hook): if not self.get_config('passkey'): return False - if self.core.isClientConnected() and self.get_config('check_client'): + if self.pyload.isClientConnected() and self.get_config('check_client'): return False if self.get_credits() > 0: diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 2a96d9e59..6c8acca48 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -103,7 +103,7 @@ class ExternalScripts(Addon): def exit(self): - for script in self.scripts['pyload_restart' if self.core.do_restart else 'pyload_stop']: + for script in self.scripts['pyload_restart' if self.pyload.do_restart else 'pyload_stop']: self.call_script(script) @@ -124,10 +124,10 @@ class ExternalScripts(Addon): def download_failed(self, pyfile): - if self.core.config.get("general", "folder_per_package"): - download_folder = fs_join(self.core.config.get("general", "download_folder"), pyfile.package().folder) + if self.pyload.config.get("general", "folder_per_package"): + download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pyfile.package().folder) else: - download_folder = self.core.config.get("general", "download_folder") + download_folder = self.pyload.config.get("general", "download_folder") for script in self.scripts['download_failed']: file = fs_join(download_folder, pyfile.name) @@ -135,10 +135,10 @@ class ExternalScripts(Addon): def download_finished(self, pyfile): - if self.core.config.get("general", "folder_per_package"): - download_folder = fs_join(self.core.config.get("general", "download_folder"), pyfile.package().folder) + if self.pyload.config.get("general", "folder_per_package"): + download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pyfile.package().folder) else: - download_folder = self.core.config.get("general", "download_folder") + download_folder = self.pyload.config.get("general", "download_folder") for script in self.scripts['download_finished']: file = fs_join(download_folder, pyfile.name) @@ -156,42 +156,42 @@ class ExternalScripts(Addon): def package_finished(self, pypack): - if self.core.config.get("general", "folder_per_package"): - download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder) + if self.pyload.config.get("general", "folder_per_package"): + download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder) else: - download_folder = self.core.config.get("general", "download_folder") + download_folder = self.pyload.config.get("general", "download_folder") for script in self.scripts['package_finished']: self.call_script(script, pypack.id, pypack.name, download_folder, pypack.password) def package_deleted(self, pid): - pack = self.core.api.getPackageInfo(pid) + pack = self.pyload.api.getPackageInfo(pid) - if self.core.config.get("general", "folder_per_package"): - download_folder = fs_join(self.core.config.get("general", "download_folder"), pack.folder) + if self.pyload.config.get("general", "folder_per_package"): + download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pack.folder) else: - download_folder = self.core.config.get("general", "download_folder") + download_folder = self.pyload.config.get("general", "download_folder") for script in self.scripts['package_deleted']: self.call_script(script, pack.id, pack.name, download_folder, pack.password) def package_extract_failed(self, pypack): - if self.core.config.get("general", "folder_per_package"): - download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder) + if self.pyload.config.get("general", "folder_per_package"): + download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder) else: - download_folder = self.core.config.get("general", "download_folder") + download_folder = self.pyload.config.get("general", "download_folder") for script in self.scripts['package_extract_failed']: self.call_script(script, pypack.id, pypack.name, download_folder, pypack.password) def package_extracted(self, pypack): - if self.core.config.get("general", "folder_per_package"): - download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder) + if self.pyload.config.get("general", "folder_per_package"): + download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder) else: - download_folder = self.core.config.get("general", "download_folder") + download_folder = self.pyload.config.get("general", "download_folder") for script in self.scripts['package_extracted']: self.call_script(script, pypack.id, pypack.name, download_folder) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index cead3595c..92774b423 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -159,7 +159,7 @@ class ExtractArchive(Addon): def activate(self): for p in ("UnRar", "SevenZip", "UnZip"): try: - module = self.core.pluginManager.loadModule("internal", p) + module = self.pyload.pluginManager.loadModule("internal", p) klass = getattr(module, p) if klass.is_usable(): self.extractors.append(klass) @@ -171,12 +171,12 @@ class ExtractArchive(Addon): self.log_warning(_("No %s installed") % p) else: self.log_warning(_("Could not activate: %s") % p, e) - if self.core.debug: + if self.pyload.debug: traceback.print_exc() except Exception, e: self.log_warning(_("Could not activate: %s") % p, e) - if self.core.debug: + if self.pyload.debug: traceback.print_exc() if self.extractors: @@ -274,11 +274,11 @@ class ExtractArchive(Addon): #: Reload from txt file self.reload_passwords() - download_folder = self.core.config.get("general", "download_folder") + download_folder = self.pyload.config.get("general", "download_folder") #: Iterate packages -> extractors -> targets for pid in ids: - pypack = self.core.files.getPackage(pid) + pypack = self.pyload.files.getPackage(pid) if not pypack: self.queue.remove(pid) @@ -323,7 +323,7 @@ class ExtractArchive(Addon): self.log_info(name, _("Extract to: %s") % fout) try: - pyfile = self.core.files.getFile(fid) + pyfile = self.pyload.files.getFile(fid) archive = Extractor(self, fname, fout, @@ -513,7 +513,7 @@ class ExtractArchive(Addon): except Exception, e: self.log_error(name, _("Unknown error"), e) - if self.core.debug: + if self.pyload.debug: traceback.print_exc() self.manager.dispatchEvent("archive_extract_failed", pyfile, archive) @@ -589,16 +589,16 @@ class ExtractArchive(Addon): continue try: - if self.core.config.get("permission", "change_file"): + if self.pyload.config.get("permission", "change_file"): if os.path.isfile(f): - os.chmod(f, int(self.core.config.get("permission", "file"), 8)) + os.chmod(f, int(self.pyload.config.get("permission", "file"), 8)) elif os.path.isdir(f): - os.chmod(f, int(self.core.config.get("permission", "folder"), 8)) + os.chmod(f, int(self.pyload.config.get("permission", "folder"), 8)) - if self.core.config.get("permission", "change_dl") and os.name != "nt": - uid = getpwnam(self.core.config.get("permission", "user"))[2] - gid = getgrnam(self.core.config.get("permission", "group"))[2] + if self.pyload.config.get("permission", "change_dl") and os.name != "nt": + uid = getpwnam(self.pyload.config.get("permission", "user"))[2] + gid = getgrnam(self.pyload.config.get("permission", "group"))[2] os.chown(f, uid, gid) except Exception, e: diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index b98f325fa..860e6bd37 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -52,7 +52,7 @@ class HotFolder(Addon): with open(fs_join(folder, "finished", name), "wb") as f: f.write(content) - self.core.api.addPackage(f.name, [f.name], 1) + self.pyload.api.addPackage(f.name, [f.name], 1) for f in os.listdir(folder): path = os.path.join(folder, f) @@ -64,7 +64,7 @@ class HotFolder(Addon): move(path, newpath) self.log_info(_("Added %s from HotFolder") % f) - self.core.api.addPackage(f, [newpath], 1) + self.pyload.api.addPackage(f, [newpath], 1) except (IOError, OSError), e: self.log_error(e) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 732340e3e..1f2db0a14 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -203,7 +203,7 @@ class IRCInterface(Thread, Addon): def event_status(self, args): - downloads = self.core.api.statusDownloads() + downloads = self.pyload.api.statusDownloads() if not downloads: return ["INFO: There are no active downloads currently."] @@ -229,7 +229,7 @@ class IRCInterface(Thread, Addon): def event_queue(self, args): - ps = self.core.api.getQueueData() + ps = self.pyload.api.getQueueData() if not ps: return ["INFO: There are no packages in queue."] @@ -242,7 +242,7 @@ class IRCInterface(Thread, Addon): def event_collector(self, args): - ps = self.core.api.getCollectorData() + ps = self.pyload.api.getCollectorData() if not ps: return ["INFO: No packages in collector!"] @@ -259,7 +259,7 @@ class IRCInterface(Thread, Addon): info = None try: - info = self.core.api.getFileData(int(args[0])) + info = self.pyload.api.getFileData(int(args[0])) except FileDoesNotExists: return ["ERROR: Link doesn't exists."] @@ -274,7 +274,7 @@ class IRCInterface(Thread, Addon): lines = [] pack = None try: - pack = self.core.api.getPackageData(int(args[0])) + pack = self.pyload.api.getPackageData(int(args[0])) except PackageDoesNotExists: return ["ERROR: Package doesn't exists."] @@ -311,12 +311,12 @@ class IRCInterface(Thread, Addon): def event_start(self, args): - self.core.api.unpauseServer() + self.pyload.api.unpauseServer() return ["INFO: Starting downloads."] def event_stop(self, args): - self.core.api.pauseServer() + self.pyload.api.pauseServer() return ["INFO: No new downloads will be started."] @@ -332,7 +332,7 @@ class IRCInterface(Thread, Addon): count_failed = 0 try: id = int(pack) - pack = self.core.api.getPackageData(id) + pack = self.pyload.api.getPackageData(id) if not pack: return ["ERROR: Package doesn't exists."] @@ -342,7 +342,7 @@ class IRCInterface(Thread, Addon): except Exception: #: Create new package - id = self.core.api.addPackage(pack, links, 1) + id = self.pyload.api.addPackage(pack, links, 1) return ["INFO: Created new Package %s [#%d] with %d links." % (pack, id, len(links))] @@ -351,11 +351,11 @@ class IRCInterface(Thread, Addon): return ["ERROR: Use del command like this: del -p|-l [...] (-p indicates that the ids are from packages, -l indicates that the ids are from links)"] if args[0] == "-p": - ret = self.core.api.deletePackages(map(int, args[1:])) + ret = self.pyload.api.deletePackages(map(int, args[1:])) return ["INFO: Deleted %d packages!" % len(args[1:])] elif args[0] == "-l": - ret = self.core.api.delLinks(map(int, args[1:])) + ret = self.pyload.api.delLinks(map(int, args[1:])) return ["INFO: Deleted %d links!" % len(args[1:])] else: @@ -368,11 +368,11 @@ class IRCInterface(Thread, Addon): id = int(args[0]) try: - info = self.core.api.getPackageInfo(id) + info = self.pyload.api.getPackageInfo(id) except PackageDoesNotExists: return ["ERROR: Package #%d does not exist." % id] - self.core.api.pushToQueue(id) + self.pyload.api.pushToQueue(id) return ["INFO: Pushed package #%d to queue." % id] @@ -381,10 +381,10 @@ class IRCInterface(Thread, Addon): return ["ERROR: Pull package from queue like this: pull ."] id = int(args[0]) - if not self.core.api.getPackageData(id): + if not self.pyload.api.getPackageData(id): return ["ERROR: Package #%d does not exist." % id] - self.core.api.pullFromQueue(id) + self.pyload.api.pullFromQueue(id) return ["INFO: Pulled package #%d from queue to collector." % id] @@ -395,7 +395,7 @@ class IRCInterface(Thread, Addon): if not args: return ["ERROR: Captcha ID missing."] - task = self.core.captchaManager.getTaskByID(args[0]) + task = self.pyload.captchaManager.getTaskByID(args[0]) if not task: return ["ERROR: Captcha Task with ID %s does not exists." % args[0]] diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 9687819a3..3c251f9f7 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -114,7 +114,7 @@ class ImageTyperz(Hook): if not self.get_config('username') or not self.get_config('password'): return False - if self.core.isClientConnected() and self.get_config('check_client'): + if self.pyload.isClientConnected() and self.get_config('check_client'): return False if self.get_credits() > 0: diff --git a/module/plugins/hooks/JustPremium.py b/module/plugins/hooks/JustPremium.py index b30625e9a..bae9eb173 100644 --- a/module/plugins/hooks/JustPremium.py +++ b/module/plugins/hooks/JustPremium.py @@ -25,12 +25,12 @@ class JustPremium(Addon): def links_added(self, links, pid): - hosterdict = self.core.pluginManager.hosterPlugins - linkdict = self.core.api.checkURLs(links) + hosterdict = self.pyload.pluginManager.hosterPlugins + linkdict = self.pyload.api.checkURLs(links) - premiumplugins = set(account.type for account in self.core.api.getAccounts(False) \ + premiumplugins = set(account.type for account in self.pyload.api.getAccounts(False) \ if account.valid and account.premium) - multihosters = set(hoster for hoster in self.core.pluginManager.hosterPlugins \ + multihosters = set(hoster for hoster in self.pyload.pluginManager.hosterPlugins \ if 'new_name' in hosterdict[hoster] \ and hosterdict[hoster]['new_name'] in premiumplugins) diff --git a/module/plugins/hooks/MegaDebridEuHook.py b/module/plugins/hooks/MegaDebridEuHook.py index 36aa807ae..202eeb797 100644 --- a/module/plugins/hooks/MegaDebridEuHook.py +++ b/module/plugins/hooks/MegaDebridEuHook.py @@ -27,6 +27,6 @@ class MegaDebridEuHook(MultiHook): host_list = [element[0] for element in json_data['hosters']] else: self.log_error(_("Unable to retrieve hoster list")) - host_list = list() + host_list = [] return host_list diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index b5245cc14..d9049c5b2 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -37,9 +37,9 @@ class MergeFiles(Addon): files[data['name'][:-4]].sort() fid_dict[data['name']] = fid - download_folder = self.core.config.get("general", "download_folder") + download_folder = self.pyload.config.get("general", "download_folder") - if self.core.config.get("general", "folder_per_package"): + if self.pyload.config.get("general", "folder_per_package"): download_folder = fs_join(download_folder, pack.folder) for name, file_list in files.iteritems(): @@ -49,7 +49,7 @@ class MergeFiles(Addon): for splitted_file in file_list: self.log_debug("Merging part", splitted_file) - pyfile = self.core.files.getFile(fid_dict[splitted_file]) + pyfile = self.pyload.files.getFile(fid_dict[splitted_file]) pyfile.setStatus("processing") diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index bfb420aea..05fd5de1e 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -24,7 +24,7 @@ class MultiHome(Addon): self.parse_interfaces(self.get_config('interfaces').split(";")) if not self.interfaces: - self.parse_interfaces([self.core.config.get("download", "interface")]) + self.parse_interfaces([self.pyload.config.get("download", "interface")]) self.set_config("interfaces", self.to_config()) @@ -40,7 +40,7 @@ class MultiHome(Addon): def activate(self): - requestFactory = self.core.requestFactory + requestFactory = self.pyload.requestFactory oldGetRequest = requestFactory.getRequest diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 8740ccd7d..bb248b895 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -22,7 +22,7 @@ class RestartFailed(Addon): # if name == "interval": # interval = value * 60 # if self.MIN_CHECK_INTERVAL <= interval != self.interval: - # self.core.scheduler.removeJob(self.cb) + # self.pyload.scheduler.removeJob(self.cb) # self.interval = interval # self.init_periodical() # else: @@ -31,7 +31,7 @@ class RestartFailed(Addon): def periodical(self): self.log_debug("Restart failed downloads") - self.core.api.restartFailed() + self.pyload.api.restartFailed() def init(self): diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 2123a6543..112395c64 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -35,7 +35,7 @@ class SkipRev(Addon): def _pyfile(self, link): - return PyFile(self.core.files, + return PyFile(self.pyload.files, link.fid, link.url, link.name, @@ -59,7 +59,7 @@ class SkipRev(Addon): status_list = (1, 4, 8, 9, 14) if revtokeep < 0 else (1, 3, 4, 8, 9, 14) pyname = re.compile(r'%s\.part\d+\.rev$' % name.rsplit('.', 2)[0].replace('.', '\.')) - queued = [True for link in self.core.api.getPackageData(pyfile.package().id).links \ + queued = [True for link in self.pyload.api.getPackageData(pyfile.package().id).links \ if link.status not in status_list and pyname.match(link.name)].count(True) if not queued or queued < revtokeep: #: Keep one rev at least in auto mode @@ -85,7 +85,7 @@ class SkipRev(Addon): pyname = re.compile(r'%s\.part\d+\.rev$' % pyfile.name.rsplit('.', 2)[0].replace('.', '\.')) - for link in self.core.api.getPackageData(pyfile.package().id).links: + for link in self.pyload.api.getPackageData(pyfile.package().id).links: if link.status is 4 and pyname.match(link.name): pylink = self._pyfile(link) @@ -94,6 +94,6 @@ class SkipRev(Addon): else: pylink.setCustomStatus(_("unskipped"), "queued") - self.core.files.save() + self.pyload.files.save() pylink.release() return diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index c8e58294c..9adf13e3e 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -39,7 +39,7 @@ class UnSkipOnFail(Addon): pylink.setCustomStatus(_("unskipped"), "queued") - self.core.files.save() + self.pyload.files.save() pylink.release() else: @@ -56,7 +56,7 @@ class UnSkipOnFail(Addon): the data for "pyfile" iotselöf. It does MOT check the link's status. """ - queue = self.core.api.getQueue() #: Get packages (w/o files, as most file data is useless here) + queue = self.pyload.api.getQueue() #: Get packages (w/o files, as most file data is useless here) for package in queue: #: Check if package-folder equals pyfile's package folder @@ -64,7 +64,7 @@ class UnSkipOnFail(Addon): continue #: Now get packaged data w/ files/links - pdata = self.core.api.getPackageData(package.pid) + pdata = self.pyload.api.getPackageData(package.pid) for link in pdata.links: #: Check if link is "skipped" if link.status != 4: @@ -77,7 +77,7 @@ class UnSkipOnFail(Addon): def _pyfile(self, link): - return PyFile(self.core.files, + return PyFile(self.pyload.files, link.fid, link.url, link.name, diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 4ec981ac0..7209f4672 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -51,10 +51,10 @@ class UpdateManager(Addon): def activate(self): if self.checkonstart: - self.core.api.pauseServer() + self.pyload.api.pauseServer() self.update() if self.do_restart is False: - self.core.api.unpauseServer() + self.pyload.api.unpauseServer() self.init_periodical() @@ -68,7 +68,7 @@ class UpdateManager(Addon): self.interval = 10 if self.get_config('checkonstart'): - self.core.api.pauseServer() + self.pyload.api.pauseServer() self.checkonstart = True else: self.checkonstart = False @@ -79,11 +79,11 @@ class UpdateManager(Addon): def all_downloads_processed(self): if self.do_restart is True: self.log_warning(_("Downloads are done, restarting pyLoad to reload the updated plugins")) - self.core.api.restart() + self.pyload.api.restart() def periodical(self): - if self.core.debug: + if self.pyload.debug: if self.get_config('reloadplugins'): self.autoreload_plugins() @@ -120,7 +120,7 @@ class UpdateManager(Addon): for m in modules: root, type, name = m.__name__.rsplit(".", 2) id = (type, name) - if type in self.core.pluginManager.plugins: + if type in self.pyload.pluginManager.plugins: f = m.__file__.replace(".pyc", ".py") if not os.path.isfile(f): continue @@ -133,13 +133,13 @@ class UpdateManager(Addon): reloads.append(id) self.mtimes[id] = mtime - return True if self.core.pluginManager.reloadPlugins(reloads) else False + return True if self.pyload.pluginManager.reloadPlugins(reloads) else False def server_response(self): try: return self.load(self.SERVER_URL, - get={'v': self.core.api.getServerVersion()}).splitlines() + get={'v': self.pyload.api.getServerVersion()}).splitlines() except Exception: self.log_warning(_("Unable to retrieve server to get updates")) @@ -152,12 +152,12 @@ class UpdateManager(Addon): Check for updates """ if self._update() is 2 and self.get_config('autorestart'): - if not self.core.api.statusDownloads(): - self.core.api.restart() + if not self.pyload.api.statusDownloads(): + self.pyload.api.restart() else: self.do_restart = True self.log_warning(_("Downloads are active, will restart once the download is done")) - self.core.api.pauseServer() + self.pyload.api.pauseServer() def _update(self): @@ -249,7 +249,7 @@ class UpdateManager(Addon): else: type = prefix - plugins = getattr(self.core.pluginManager, "%sPlugins" % type) + plugins = getattr(self.pyload.pluginManager, "%sPlugins" % type) oldver = float(plugins[name]['v']) if name in plugins else None newver = float(version) @@ -283,7 +283,7 @@ class UpdateManager(Addon): if updated: self.log_info(_("*** Plugins updated ***")) - if self.core.pluginManager.reloadPlugins(updated): + if self.pyload.pluginManager.reloadPlugins(updated): exitcode = 1 else: self.log_warning(_("pyLoad restart required to reload the updated plugins")) diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index b4b4d2658..ebd755c90 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -51,7 +51,7 @@ class WindowsPhoneNotify(Addon): if not self.get_config('notifyexit'): return - if self.core.do_restart: + if self.pyload.do_restart: self.notify(_("Restarting pyLoad")) else: self.notify(_("Exiting pyLoad")) @@ -73,7 +73,7 @@ class WindowsPhoneNotify(Addon): if not self.get_config('notifyprocessed'): return - if any(True for pdata in self.core.api.getQueue() if pdata.linksdone < pdata.linkstotal): + if any(True for pdata in self.pyload.api.getQueue() if pdata.linksdone < pdata.linkstotal): self.notify(_("Package failed"), _("One or more packages was not completed successfully")) else: self.notify(_("All packages finished")) @@ -95,7 +95,7 @@ class WindowsPhoneNotify(Addon): if not id or not url: return - if self.core.isClientConnected() and not self.get_config('ignoreclient'): + if self.pyload.isClientConnected() and not self.get_config('ignoreclient'): return elapsed_time = time.time() - self.last_notify diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 5829378d8..c82308bb1 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -47,7 +47,7 @@ class XFileSharingPro(Hook): # self.load_pattern() - def init(self): + # def init(self): # self.event_map = {'pluginConfigChanged': "plugin_config_changed"} @@ -89,7 +89,7 @@ class XFileSharingPro(Hook): pattern = self.regexp[type][1] % match_list.replace('.', '\.') - dict = self.core.pluginManager.plugins[type][plugin] + dict = self.pyload.pluginManager.plugins[type][plugin] dict['pattern'] = pattern dict['re'] = re.compile(pattern) @@ -97,7 +97,7 @@ class XFileSharingPro(Hook): def _unload(self, type, plugin): - dict = self.core.pluginManager.plugins[type][plugin] + dict = self.pyload.pluginManager.plugins[type][plugin] dict['pattern'] = r'^unmatchable$' dict['re'] = re.compile(dict['pattern']) @@ -110,7 +110,7 @@ class XFileSharingPro(Hook): def unload_hoster(self, hoster): - hdict = self.core.pluginManager.hosterPlugins[hoster] + hdict = self.pyload.pluginManager.hosterPlugins[hoster] if "new_name" in hdict and hdict['new_name'] == "XFileSharingPro": if "module" in hdict: hdict.pop('module', None) -- cgit v1.2.3 From d38e830b7c0b3c6561a0072c74bbccb5fcdf4a61 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Jul 2015 14:43:42 +0200 Subject: New __status__ magic key --- module/plugins/hooks/AlldebridComHook.py | 1 + module/plugins/hooks/AndroidPhoneNotify.py | 1 + module/plugins/hooks/AntiVirus.py | 1 + module/plugins/hooks/BypassCaptcha.py | 1 + module/plugins/hooks/Captcha9Kw.py | 1 + module/plugins/hooks/CaptchaBrotherhood.py | 1 + module/plugins/hooks/Checksum.py | 1 + module/plugins/hooks/ClickAndLoad.py | 1 + module/plugins/hooks/DeathByCaptcha.py | 1 + module/plugins/hooks/DebridItaliaComHook.py | 1 + module/plugins/hooks/DeleteFinished.py | 1 + module/plugins/hooks/DownloadScheduler.py | 1 + module/plugins/hooks/EasybytezComHook.py | 1 + module/plugins/hooks/ExpertDecoders.py | 1 + module/plugins/hooks/ExternalScripts.py | 1 + module/plugins/hooks/ExtractArchive.py | 1 + module/plugins/hooks/FastixRuHook.py | 1 + module/plugins/hooks/FreeWayMeHook.py | 1 + module/plugins/hooks/HighWayMeHook.py | 1 + module/plugins/hooks/HotFolder.py | 1 + module/plugins/hooks/IRCInterface.py | 1 + module/plugins/hooks/ImageTyperz.py | 1 + module/plugins/hooks/JustPremium.py | 1 + module/plugins/hooks/LinkdecrypterComHook.py | 1 + module/plugins/hooks/LinksnappyComHook.py | 1 + module/plugins/hooks/MegaDebridEuHook.py | 1 + module/plugins/hooks/MegaRapidoNetHook.py | 1 + module/plugins/hooks/MergeFiles.py | 1 + module/plugins/hooks/MultiHome.py | 1 + module/plugins/hooks/MultihostersComHook.py | 1 + module/plugins/hooks/MultishareCzHook.py | 1 + module/plugins/hooks/MyfastfileComHook.py | 1 + module/plugins/hooks/NoPremiumPlHook.py | 1 + module/plugins/hooks/OverLoadMeHook.py | 1 + module/plugins/hooks/PremiumToHook.py | 1 + module/plugins/hooks/PremiumizeMeHook.py | 1 + module/plugins/hooks/PutdriveComHook.py | 1 + module/plugins/hooks/RPNetBizHook.py | 1 + module/plugins/hooks/RapideoPlHook.py | 1 + module/plugins/hooks/RealdebridComHook.py | 1 + module/plugins/hooks/RehostToHook.py | 1 + module/plugins/hooks/RestartFailed.py | 1 + module/plugins/hooks/SimplyPremiumComHook.py | 1 + module/plugins/hooks/SimplydebridComHook.py | 1 + module/plugins/hooks/SkipRev.py | 1 + module/plugins/hooks/SmoozedComHook.py | 1 + module/plugins/hooks/UnSkipOnFail.py | 1 + module/plugins/hooks/UpdateManager.py | 1 + module/plugins/hooks/UserAgentSwitcher.py | 1 + module/plugins/hooks/WindowsPhoneNotify.py | 1 + module/plugins/hooks/XFileSharingPro.py | 1 + module/plugins/hooks/XMPPInterface.py | 1 + module/plugins/hooks/ZeveraComHook.py | 1 + 53 files changed, 53 insertions(+) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridComHook.py b/module/plugins/hooks/AlldebridComHook.py index 9af1cf02f..84ca23a59 100644 --- a/module/plugins/hooks/AlldebridComHook.py +++ b/module/plugins/hooks/AlldebridComHook.py @@ -7,6 +7,7 @@ class AlldebridComHook(MultiHook): __name__ = "AlldebridComHook" __type__ = "hook" __version__ = "0.17" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index ce3ac9b4c..0317c1dc3 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -9,6 +9,7 @@ class AndroidPhoneNotify(Addon): __name__ = "AndroidPhoneNotify" __type__ = "hook" __version__ = "0.10" + __status__ = "stable" __config__ = [("apikey" , "str" , "API key" , "" ), ("notifycaptcha" , "bool", "Notify captcha request" , True ), diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 8b19af84c..7097b87c8 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -17,6 +17,7 @@ class AntiVirus(Addon): __name__ = "AntiVirus" __type__ = "hook" __version__ = "0.11" + __status__ = "stable" #@TODO: add trash option (use Send2Trash lib) __config__ = [("action" , "Antivirus default;Delete;Quarantine", "Manage infected files" , "Antivirus default"), diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 2ef3033c4..c954c5633 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -29,6 +29,7 @@ class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __type__ = "hook" __version__ = "0.08" + __status__ = "stable" __config__ = [("passkey" , "password", "Access key" , "" ), ("check_client", "bool" , "Don't use if client is connected", True)] diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 8006d9462..754af46bd 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -15,6 +15,7 @@ class Captcha9Kw(Hook): __name__ = "Captcha9Kw" __type__ = "hook" __version__ = "0.30" + __status__ = "stable" __config__ = [("check_client" , "bool" , "Don't use if client is connected" , True ), ("confirm" , "bool" , "Confirm Captcha (cost +6 credits)" , False ), diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 946ee2372..017e0952d 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -39,6 +39,7 @@ class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" __type__ = "hook" __version__ = "0.10" + __status__ = "stable" __config__ = [("username" , "str" , "Username" , "" ), ("password" , "password", "Password" , "" ), diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 3110f6d66..2962ec927 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -39,6 +39,7 @@ class Checksum(Addon): __name__ = "Checksum" __type__ = "hook" __version__ = "0.18" + __status__ = "stable" __config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), ("check_action" , "fail;retry;nothing", "What to do if check fails?" , "retry"), diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index f6c226225..a294c3d4d 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -30,6 +30,7 @@ class ClickAndLoad(Addon): __name__ = "ClickAndLoad" __type__ = "hook" __version__ = "0.45" + __status__ = "stable" __config__ = [("activated", "bool", "Activated" , True), ("port" , "int" , "Port" , 9666), diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index e11e7305c..a139f28a6 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -52,6 +52,7 @@ class DeathByCaptcha(Hook): __name__ = "DeathByCaptcha" __type__ = "hook" __version__ = "0.08" + __status__ = "stable" __config__ = [("username" , "str" , "Username" , "" ), ("password" , "password", "Password" , "" ), diff --git a/module/plugins/hooks/DebridItaliaComHook.py b/module/plugins/hooks/DebridItaliaComHook.py index 9f7499783..738f46beb 100644 --- a/module/plugins/hooks/DebridItaliaComHook.py +++ b/module/plugins/hooks/DebridItaliaComHook.py @@ -9,6 +9,7 @@ class DebridItaliaComHook(MultiHook): __name__ = "DebridItaliaComHook" __type__ = "hook" __version__ = "0.13" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 2143fe19a..b79a84531 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -8,6 +8,7 @@ class DeleteFinished(Addon): __name__ = "DeleteFinished" __type__ = "hook" __version__ = "1.14" + __status__ = "stable" __config__ = [("interval" , "int" , "Check interval in hours" , 72 ), ("deloffline", "bool", "Delete package with offline links", False)] diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index c32088532..7c24a41db 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -10,6 +10,7 @@ class DownloadScheduler(Addon): __name__ = "DownloadScheduler" __type__ = "hook" __version__ = "0.24" + __status__ = "stable" __config__ = [("timetable", "str" , "List time periods as hh:mm full or number(kB/s)" , "0:00 full, 7:00 250, 10:00 0, 17:00 150"), ("abort" , "bool", "Abort active downloads when start period with speed 0", False )] diff --git a/module/plugins/hooks/EasybytezComHook.py b/module/plugins/hooks/EasybytezComHook.py index 084c01eb7..896ef93d9 100644 --- a/module/plugins/hooks/EasybytezComHook.py +++ b/module/plugins/hooks/EasybytezComHook.py @@ -9,6 +9,7 @@ class EasybytezComHook(MultiHook): __name__ = "EasybytezComHook" __type__ = "hook" __version__ = "0.08" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 7b1ae15b1..eb62ef796 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -16,6 +16,7 @@ class ExpertDecoders(Hook): __name__ = "ExpertDecoders" __type__ = "hook" __version__ = "0.06" + __status__ = "stable" __config__ = [("passkey" , "password", "Access key" , "" ), ("check_client", "bool" , "Don't use if client is connected", True)] diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 6c8acca48..0859b39a9 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -11,6 +11,7 @@ class ExternalScripts(Addon): __name__ = "ExternalScripts" __type__ = "hook" __version__ = "0.43" + __status__ = "stable" __config__ = [("activated", "bool", "Activated" , True ), ("waitend" , "bool", "Wait script ending", False)] diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 92774b423..8a52fed55 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -113,6 +113,7 @@ class ExtractArchive(Addon): __name__ = "ExtractArchive" __type__ = "hook" __version__ = "1.46" + __status__ = "stable" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract with full paths" , True ), diff --git a/module/plugins/hooks/FastixRuHook.py b/module/plugins/hooks/FastixRuHook.py index c14d6c380..227068049 100644 --- a/module/plugins/hooks/FastixRuHook.py +++ b/module/plugins/hooks/FastixRuHook.py @@ -8,6 +8,7 @@ class FastixRuHook(MultiHook): __name__ = "FastixRuHook" __type__ = "hook" __version__ = "0.06" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/FreeWayMeHook.py b/module/plugins/hooks/FreeWayMeHook.py index a55b6bb93..04952b062 100644 --- a/module/plugins/hooks/FreeWayMeHook.py +++ b/module/plugins/hooks/FreeWayMeHook.py @@ -7,6 +7,7 @@ class FreeWayMeHook(MultiHook): __name__ = "FreeWayMeHook" __type__ = "hook" __version__ = "0.17" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/HighWayMeHook.py b/module/plugins/hooks/HighWayMeHook.py index 8e400a628..231394cfe 100644 --- a/module/plugins/hooks/HighWayMeHook.py +++ b/module/plugins/hooks/HighWayMeHook.py @@ -8,6 +8,7 @@ class HighWayMeHook(MultiHook): __name__ = "HighWayMeHook" __type__ = "hook" __version__ = "0.04" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 860e6bd37..f456d112f 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -15,6 +15,7 @@ class HotFolder(Addon): __name__ = "HotFolder" __type__ = "hook" __version__ = "0.16" + __status__ = "stable" __config__ = [("folder" , "str" , "Folder to observe" , "container"), ("watch_file", "bool", "Observe link file" , False ), diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 1f2db0a14..54a94f6ec 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -19,6 +19,7 @@ class IRCInterface(Thread, Addon): __name__ = "IRCInterface" __type__ = "hook" __version__ = "0.15" + __status__ = "stable" __config__ = [("host" , "str" , "IRC-Server Address" , "Enter your server here!"), ("port" , "int" , "IRC-Server Port" , 6667 ), diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 3c251f9f7..e87014447 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -33,6 +33,7 @@ class ImageTyperz(Hook): __name__ = "ImageTyperz" __type__ = "hook" __version__ = "0.08" + __status__ = "stable" __config__ = [("username" , "str" , "Username" , "" ), ("password" , "password", "Password" , "" ), diff --git a/module/plugins/hooks/JustPremium.py b/module/plugins/hooks/JustPremium.py index bae9eb173..b252fbbe5 100644 --- a/module/plugins/hooks/JustPremium.py +++ b/module/plugins/hooks/JustPremium.py @@ -9,6 +9,7 @@ class JustPremium(Addon): __name__ = "JustPremium" __type__ = "hook" __version__ = "0.24" + __status__ = "stable" __config__ = [("excluded", "str", "Exclude hosters (comma separated)", ""), ("included", "str", "Include hosters (comma separated)", "")] diff --git a/module/plugins/hooks/LinkdecrypterComHook.py b/module/plugins/hooks/LinkdecrypterComHook.py index 1fe7497b3..a4735cd5a 100644 --- a/module/plugins/hooks/LinkdecrypterComHook.py +++ b/module/plugins/hooks/LinkdecrypterComHook.py @@ -9,6 +9,7 @@ class LinkdecrypterComHook(MultiHook): __name__ = "LinkdecrypterComHook" __type__ = "hook" __version__ = "1.07" + __status__ = "stable" __config__ = [("activated" , "bool" , "Activated" , True ), ("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), diff --git a/module/plugins/hooks/LinksnappyComHook.py b/module/plugins/hooks/LinksnappyComHook.py index 9501ba4a2..f7da6e21b 100644 --- a/module/plugins/hooks/LinksnappyComHook.py +++ b/module/plugins/hooks/LinksnappyComHook.py @@ -8,6 +8,7 @@ class LinksnappyComHook(MultiHook): __name__ = "LinksnappyComHook" __type__ = "hook" __version__ = "0.05" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/MegaDebridEuHook.py b/module/plugins/hooks/MegaDebridEuHook.py index 202eeb797..bbb9a0cab 100644 --- a/module/plugins/hooks/MegaDebridEuHook.py +++ b/module/plugins/hooks/MegaDebridEuHook.py @@ -8,6 +8,7 @@ class MegaDebridEuHook(MultiHook): __name__ = "MegaDebridEuHook" __type__ = "hook" __version__ = "0.06" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/MegaRapidoNetHook.py b/module/plugins/hooks/MegaRapidoNetHook.py index 278daa11d..56b582a78 100644 --- a/module/plugins/hooks/MegaRapidoNetHook.py +++ b/module/plugins/hooks/MegaRapidoNetHook.py @@ -9,6 +9,7 @@ class MegaRapidoNetHook(MultiHook): __name__ = "MegaRapidoNetHook" __type__ = "hook" __version__ = "0.03" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index d9049c5b2..fa4c6bcd9 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -14,6 +14,7 @@ class MergeFiles(Addon): __name__ = "MergeFiles" __type__ = "hook" __version__ = "0.16" + __status__ = "stable" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 05fd5de1e..4a70726e4 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -9,6 +9,7 @@ class MultiHome(Addon): __name__ = "MultiHome" __type__ = "hook" __version__ = "0.14" + __status__ = "stable" __config__ = [("interfaces", "str", "Interfaces", "None")] diff --git a/module/plugins/hooks/MultihostersComHook.py b/module/plugins/hooks/MultihostersComHook.py index caa9d5bea..f02c07a7a 100644 --- a/module/plugins/hooks/MultihostersComHook.py +++ b/module/plugins/hooks/MultihostersComHook.py @@ -7,6 +7,7 @@ class MultihostersComHook(ZeveraComHook): __name__ = "MultihostersComHook" __type__ = "hook" __version__ = "0.03" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/MultishareCzHook.py b/module/plugins/hooks/MultishareCzHook.py index 8ddcf74d2..f2c08bf04 100644 --- a/module/plugins/hooks/MultishareCzHook.py +++ b/module/plugins/hooks/MultishareCzHook.py @@ -9,6 +9,7 @@ class MultishareCzHook(MultiHook): __name__ = "MultishareCzHook" __type__ = "hook" __version__ = "0.08" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/MyfastfileComHook.py b/module/plugins/hooks/MyfastfileComHook.py index f1e5d669d..17fdfe4da 100644 --- a/module/plugins/hooks/MyfastfileComHook.py +++ b/module/plugins/hooks/MyfastfileComHook.py @@ -8,6 +8,7 @@ class MyfastfileComHook(MultiHook): __name__ = "MyfastfileComHook" __type__ = "hook" __version__ = "0.06" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/NoPremiumPlHook.py b/module/plugins/hooks/NoPremiumPlHook.py index 1b011e6f8..3f41b1106 100644 --- a/module/plugins/hooks/NoPremiumPlHook.py +++ b/module/plugins/hooks/NoPremiumPlHook.py @@ -8,6 +8,7 @@ class NoPremiumPlHook(MultiHook): __name__ = "NoPremiumPlHook" __type__ = "hook" __version__ = "0.04" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/OverLoadMeHook.py b/module/plugins/hooks/OverLoadMeHook.py index 611285818..29343f8b7 100644 --- a/module/plugins/hooks/OverLoadMeHook.py +++ b/module/plugins/hooks/OverLoadMeHook.py @@ -7,6 +7,7 @@ class OverLoadMeHook(MultiHook): __name__ = "OverLoadMeHook" __type__ = "hook" __version__ = "0.05" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/PremiumToHook.py b/module/plugins/hooks/PremiumToHook.py index 937064087..02de0d1ba 100644 --- a/module/plugins/hooks/PremiumToHook.py +++ b/module/plugins/hooks/PremiumToHook.py @@ -7,6 +7,7 @@ class PremiumToHook(MultiHook): __name__ = "PremiumToHook" __type__ = "hook" __version__ = "0.10" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py index 94fc1d59c..b6bce5985 100644 --- a/module/plugins/hooks/PremiumizeMeHook.py +++ b/module/plugins/hooks/PremiumizeMeHook.py @@ -8,6 +8,7 @@ class PremiumizeMeHook(MultiHook): __name__ = "PremiumizeMeHook" __type__ = "hook" __version__ = "0.19" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/PutdriveComHook.py b/module/plugins/hooks/PutdriveComHook.py index 2c5310dbf..e863c2eda 100644 --- a/module/plugins/hooks/PutdriveComHook.py +++ b/module/plugins/hooks/PutdriveComHook.py @@ -7,6 +7,7 @@ class PutdriveComHook(ZeveraComHook): __name__ = "PutdriveComHook" __type__ = "hook" __version__ = "0.02" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/RPNetBizHook.py b/module/plugins/hooks/RPNetBizHook.py index 19975a0cd..0c911ef00 100644 --- a/module/plugins/hooks/RPNetBizHook.py +++ b/module/plugins/hooks/RPNetBizHook.py @@ -8,6 +8,7 @@ class RPNetBizHook(MultiHook): __name__ = "RPNetBizHook" __type__ = "hook" __version__ = "0.15" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/RapideoPlHook.py b/module/plugins/hooks/RapideoPlHook.py index adbe55f12..f5ec37271 100644 --- a/module/plugins/hooks/RapideoPlHook.py +++ b/module/plugins/hooks/RapideoPlHook.py @@ -8,6 +8,7 @@ class RapideoPlHook(MultiHook): __name__ = "RapideoPlHook" __type__ = "hook" __version__ = "0.04" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/RealdebridComHook.py b/module/plugins/hooks/RealdebridComHook.py index da66249b6..0f5dfc739 100644 --- a/module/plugins/hooks/RealdebridComHook.py +++ b/module/plugins/hooks/RealdebridComHook.py @@ -7,6 +7,7 @@ class RealdebridComHook(MultiHook): __name__ = "RealdebridComHook" __type__ = "hook" __version__ = "0.47" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/RehostToHook.py b/module/plugins/hooks/RehostToHook.py index 67f3a6e8a..265dceb4c 100644 --- a/module/plugins/hooks/RehostToHook.py +++ b/module/plugins/hooks/RehostToHook.py @@ -7,6 +7,7 @@ class RehostToHook(MultiHook): __name__ = "RehostToHook" __type__ = "hook" __version__ = "0.51" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index bb248b895..aa67bd0ca 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -7,6 +7,7 @@ class RestartFailed(Addon): __name__ = "RestartFailed" __type__ = "hook" __version__ = "1.60" + __status__ = "stable" __config__ = [("interval", "int", "Check interval in minutes", 90)] diff --git a/module/plugins/hooks/SimplyPremiumComHook.py b/module/plugins/hooks/SimplyPremiumComHook.py index e522df8b5..44393c305 100644 --- a/module/plugins/hooks/SimplyPremiumComHook.py +++ b/module/plugins/hooks/SimplyPremiumComHook.py @@ -8,6 +8,7 @@ class SimplyPremiumComHook(MultiHook): __name__ = "SimplyPremiumComHook" __type__ = "hook" __version__ = "0.06" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/SimplydebridComHook.py b/module/plugins/hooks/SimplydebridComHook.py index 228df2af4..7bcb20b4c 100644 --- a/module/plugins/hooks/SimplydebridComHook.py +++ b/module/plugins/hooks/SimplydebridComHook.py @@ -7,6 +7,7 @@ class SimplydebridComHook(MultiHook): __name__ = "SimplydebridComHook" __type__ = "hook" __version__ = "0.05" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 112395c64..bbccae0a1 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -14,6 +14,7 @@ class SkipRev(Addon): __name__ = "SkipRev" __type__ = "hook" __version__ = "0.33" + __status__ = "stable" __config__ = [("mode" , "Auto;Manual", "Choose recovery archives to skip" , "Auto"), ("revtokeep", "int" , "Number of recovery archives to keep for package", 0 )] diff --git a/module/plugins/hooks/SmoozedComHook.py b/module/plugins/hooks/SmoozedComHook.py index 733fd642a..0c8e74f49 100644 --- a/module/plugins/hooks/SmoozedComHook.py +++ b/module/plugins/hooks/SmoozedComHook.py @@ -7,6 +7,7 @@ class SmoozedComHook(MultiHook): __name__ = "SmoozedComHook" __type__ = "hook" __version__ = "0.04" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 9adf13e3e..e6064eb7b 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -8,6 +8,7 @@ class UnSkipOnFail(Addon): __name__ = "UnSkipOnFail" __type__ = "hook" __version__ = "0.09" + __status__ = "stable" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 7209f4672..500f3075a 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -29,6 +29,7 @@ class UpdateManager(Addon): __name__ = "UpdateManager" __type__ = "hook" __version__ = "0.54" + __status__ = "stable" __config__ = [("activated" , "bool", "Activated" , True ), ("checkinterval", "int" , "Check interval in hours" , 8 ), diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py index 637f6c3ad..aa90bdd1a 100644 --- a/module/plugins/hooks/UserAgentSwitcher.py +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -9,6 +9,7 @@ class UserAgentSwitcher(Addon): __name__ = "UserAgentSwitcher" __type__ = "hook" __version__ = "0.10" + __status__ = "stable" __config__ = [("activated" , "bool", "Activated" , True ), ("connecttimeout", "int" , "Connection timeout in seconds" , 60 ), diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index ebd755c90..a554642e3 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -10,6 +10,7 @@ class WindowsPhoneNotify(Addon): __name__ = "WindowsPhoneNotify" __type__ = "hook" __version__ = "0.12" + __status__ = "stable" __config__ = [("push-id" , "str" , "Push ID" , "" ), ("push-url" , "str" , "Push url" , "" ), diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index c82308bb1..1e8173830 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -9,6 +9,7 @@ class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" __version__ = "0.40" + __status__ = "stable" __config__ = [("activated" , "bool", "Activated" , True ), ("use_hoster_list" , "bool", "Load listed hosters only" , False), diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 5eee3b872..2e4261286 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -13,6 +13,7 @@ class XMPPInterface(IRCInterface, JabberClient): __name__ = "XMPPInterface" __type__ = "hook" __version__ = "0.12" + __status__ = "stable" __config__ = [("jid" , "str" , "Jabber ID" , "user@exmaple-jabber-server.org" ), ("pw" , "str" , "Password" , "" ), diff --git a/module/plugins/hooks/ZeveraComHook.py b/module/plugins/hooks/ZeveraComHook.py index c0109eb38..b6fcfaa66 100644 --- a/module/plugins/hooks/ZeveraComHook.py +++ b/module/plugins/hooks/ZeveraComHook.py @@ -7,6 +7,7 @@ class ZeveraComHook(MultiHook): __name__ = "ZeveraComHook" __type__ = "hook" __version__ = "0.06" + __status__ = "stable" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), -- cgit v1.2.3 From c2091ebec0ce394ec847f82db9bbaddc150d5fca Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 21 Jul 2015 22:55:54 +0200 Subject: [Extractor] is_usable -> find --- module/plugins/hooks/ExtractArchive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 8a52fed55..6f353f538 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -112,7 +112,7 @@ class ArchiveQueue(object): class ExtractArchive(Addon): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.46" + __version__ = "1.47" __status__ = "stable" __config__ = [("activated" , "bool" , "Activated" , True ), @@ -162,7 +162,7 @@ class ExtractArchive(Addon): try: module = self.pyload.pluginManager.loadModule("internal", p) klass = getattr(module, p) - if klass.is_usable(): + if klass.find(): self.extractors.append(klass) if klass.REPAIR: self.repair = self.get_config('repair') -- cgit v1.2.3 From 4fc28dc09f9632eb4a15a1ef48778427f9dcae33 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 23 Jul 2015 18:53:06 +0200 Subject: Code cosmetics --- module/plugins/hooks/ExtractArchive.py | 2 +- module/plugins/hooks/MegaRapidoNetHook.py | 10 +++++----- module/plugins/hooks/UnSkipOnFail.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 6f353f538..0f757f258 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -298,7 +298,7 @@ class ExtractArchive(Addon): matched = False success = True - files_ids = dict((pylink['name'],((fs_join(download_folder, pypack.folder, pylink['name'])), pylink['id'], out)) for pylink \ + files_ids = dict((pylink['name'], ((fs_join(download_folder, pypack.folder, pylink['name'])), pylink['id'], out)) for pylink \ in sorted(pypack.getChildren().itervalues(), key=lambda k: k['name'])).values() #: Remove duplicates #: Check as long there are unseen files diff --git a/module/plugins/hooks/MegaRapidoNetHook.py b/module/plugins/hooks/MegaRapidoNetHook.py index 56b582a78..1dae5056f 100644 --- a/module/plugins/hooks/MegaRapidoNetHook.py +++ b/module/plugins/hooks/MegaRapidoNetHook.py @@ -22,14 +22,14 @@ class MegaRapidoNetHook(MultiHook): def get_hosters(self): - hosters = {'1fichier' : [],#leave it there are so many possible addresses? + hosters = {'1fichier' : [], # leave it there are so many possible addresses? '1st-files' : ['1st-files.com'], '2shared' : ['2shared.com'], '4shared' : ['4shared.com', '4shared-china.com'], 'asfile' : ['http://asfile.com/'], 'bitshare' : ['bitshare.com'], 'brupload' : ['brupload.net'], - 'crocko' : ['crocko.com','easy-share.com'], + 'crocko' : ['crocko.com', 'easy-share.com'], 'dailymotion' : ['dailymotion.com'], 'depfile' : ['depfile.com'], 'depositfiles': ['depositfiles.com', 'dfiles.eu'], @@ -39,12 +39,12 @@ class MegaRapidoNetHook(MultiHook): 'extmatrix' : ['extmatrix.com'], 'facebook' : [], 'file4go' : ['file4go.com'], - 'filecloud' : ['filecloud.io','ifile.it','mihd.net'], + 'filecloud' : ['filecloud.io', 'ifile.it', 'mihd.net'], 'filefactory' : ['filefactory.com'], 'fileom' : ['fileom.com'], 'fileparadox' : ['fileparadox.in'], 'filepost' : ['filepost.com', 'fp.io'], - 'filerio' : ['filerio.in','filerio.com','filekeen.com'], + 'filerio' : ['filerio.in', 'filerio.com', 'filekeen.com'], 'filesflash' : ['filesflash.com'], 'firedrive' : ['firedrive.com', 'putlocker.com'], 'flashx' : [], @@ -52,7 +52,7 @@ class MegaRapidoNetHook(MultiHook): 'gigasize' : ['gigasize.com'], 'hipfile' : ['hipfile.com'], 'junocloud' : ['junocloud.me'], - 'letitbit' : ['letitbit.net','shareflare.net'], + 'letitbit' : ['letitbit.net', 'shareflare.net'], 'mediafire' : ['mediafire.com'], 'mega' : ['mega.co.nz'], 'megashares' : ['megashares.com'], diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index e6064eb7b..74d778d59 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -35,7 +35,7 @@ class UnSkipOnFail(Addon): #: (i.e. "queued" for this Plugin) #: It creates a temporary PyFile object using #: "link" data, changes its status, and tells - #: The core.files-manager to save its data. + #: The pyload.files-manager to save its data. pylink = self._pyfile(link) pylink.setCustomStatus(_("unskipped"), "queued") -- cgit v1.2.3 From f7df6ef48a7c0a8ab6351e046cd12160257c4ef5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 02:15:31 +0200 Subject: Hotfixes --- module/plugins/hooks/UpdateManager.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 500f3075a..dd39efcc2 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -6,6 +6,7 @@ import os import re import sys import time +import traceback from operator import itemgetter @@ -267,7 +268,7 @@ class UpdateManager(Addon): 'oldver': oldver, 'newver': newver}) try: - content = self.load(url % plugin) + content = self.load(url % plugin, decode=False) m = VERSION.search(content) if m and m.group(2) == version: @@ -280,6 +281,8 @@ class UpdateManager(Addon): except Exception, e: self.log_error(_("Error updating plugin: %s") % filename, e) + if self.pyload.debug: + traceback.print_exc() if updated: self.log_info(_("*** Plugins updated ***")) @@ -345,7 +348,9 @@ class UpdateManager(Addon): os.remove(filename) except OSError, e: - self.log_error(_("Error removing: %s") % filename, e) + self.log_warning(_("Error removing: %s") % filename, e) + if self.pyload.debug: + traceback.print_exc() else: id = (type, name) -- cgit v1.2.3 From 94d017cd2a5c1f194960827a8c7e46afc3682008 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 06:55:49 +0200 Subject: Hotfixes (2) --- module/plugins/hooks/AlldebridComHook.py | 2 +- module/plugins/hooks/AndroidPhoneNotify.py | 2 +- module/plugins/hooks/AntiVirus.py | 2 +- module/plugins/hooks/BypassCaptcha.py | 2 +- module/plugins/hooks/Captcha9Kw.py | 2 +- module/plugins/hooks/CaptchaBrotherhood.py | 2 +- module/plugins/hooks/Checksum.py | 2 +- module/plugins/hooks/ClickAndLoad.py | 2 +- module/plugins/hooks/DeathByCaptcha.py | 2 +- module/plugins/hooks/DebridItaliaComHook.py | 2 +- module/plugins/hooks/DeleteFinished.py | 2 +- module/plugins/hooks/DownloadScheduler.py | 2 +- module/plugins/hooks/EasybytezComHook.py | 2 +- module/plugins/hooks/ExpertDecoders.py | 2 +- module/plugins/hooks/ExternalScripts.py | 2 +- module/plugins/hooks/ExtractArchive.py | 2 +- module/plugins/hooks/FastixRuHook.py | 2 +- module/plugins/hooks/FreeWayMeHook.py | 2 +- module/plugins/hooks/HighWayMeHook.py | 2 +- module/plugins/hooks/HotFolder.py | 2 +- module/plugins/hooks/IRCInterface.py | 2 +- module/plugins/hooks/ImageTyperz.py | 2 +- module/plugins/hooks/JustPremium.py | 2 +- module/plugins/hooks/LinkdecrypterComHook.py | 2 +- module/plugins/hooks/LinksnappyComHook.py | 2 +- module/plugins/hooks/MegaDebridEuHook.py | 2 +- module/plugins/hooks/MegaRapidoNetHook.py | 2 +- module/plugins/hooks/MergeFiles.py | 2 +- module/plugins/hooks/MultiHome.py | 2 +- module/plugins/hooks/MultihostersComHook.py | 2 +- module/plugins/hooks/MultishareCzHook.py | 2 +- module/plugins/hooks/MyfastfileComHook.py | 2 +- module/plugins/hooks/NoPremiumPlHook.py | 2 +- module/plugins/hooks/OverLoadMeHook.py | 2 +- module/plugins/hooks/PremiumToHook.py | 2 +- module/plugins/hooks/PremiumizeMeHook.py | 2 +- module/plugins/hooks/PutdriveComHook.py | 2 +- module/plugins/hooks/RPNetBizHook.py | 2 +- module/plugins/hooks/RapideoPlHook.py | 2 +- module/plugins/hooks/RealdebridComHook.py | 2 +- module/plugins/hooks/RehostToHook.py | 2 +- module/plugins/hooks/RestartFailed.py | 2 +- module/plugins/hooks/SimplyPremiumComHook.py | 2 +- module/plugins/hooks/SimplydebridComHook.py | 2 +- module/plugins/hooks/SkipRev.py | 2 +- module/plugins/hooks/SmoozedComHook.py | 2 +- module/plugins/hooks/UnSkipOnFail.py | 2 +- module/plugins/hooks/UpdateManager.py | 2 +- module/plugins/hooks/UserAgentSwitcher.py | 2 +- module/plugins/hooks/WindowsPhoneNotify.py | 2 +- module/plugins/hooks/XFileSharingPro.py | 2 +- module/plugins/hooks/XMPPInterface.py | 2 +- module/plugins/hooks/ZeveraComHook.py | 2 +- 53 files changed, 53 insertions(+), 53 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AlldebridComHook.py b/module/plugins/hooks/AlldebridComHook.py index 84ca23a59..402850d87 100644 --- a/module/plugins/hooks/AlldebridComHook.py +++ b/module/plugins/hooks/AlldebridComHook.py @@ -7,7 +7,7 @@ class AlldebridComHook(MultiHook): __name__ = "AlldebridComHook" __type__ = "hook" __version__ = "0.17" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py index 0317c1dc3..f79f226e4 100644 --- a/module/plugins/hooks/AndroidPhoneNotify.py +++ b/module/plugins/hooks/AndroidPhoneNotify.py @@ -9,7 +9,7 @@ class AndroidPhoneNotify(Addon): __name__ = "AndroidPhoneNotify" __type__ = "hook" __version__ = "0.10" - __status__ = "stable" + __status__ = "testing" __config__ = [("apikey" , "str" , "API key" , "" ), ("notifycaptcha" , "bool", "Notify captcha request" , True ), diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 7097b87c8..80968c491 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -17,7 +17,7 @@ class AntiVirus(Addon): __name__ = "AntiVirus" __type__ = "hook" __version__ = "0.11" - __status__ = "stable" + __status__ = "testing" #@TODO: add trash option (use Send2Trash lib) __config__ = [("action" , "Antivirus default;Delete;Quarantine", "Manage infected files" , "Antivirus default"), diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index c954c5633..578586ae5 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -29,7 +29,7 @@ class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __type__ = "hook" __version__ = "0.08" - __status__ = "stable" + __status__ = "testing" __config__ = [("passkey" , "password", "Access key" , "" ), ("check_client", "bool" , "Don't use if client is connected", True)] diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 754af46bd..31638214e 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -15,7 +15,7 @@ class Captcha9Kw(Hook): __name__ = "Captcha9Kw" __type__ = "hook" __version__ = "0.30" - __status__ = "stable" + __status__ = "testing" __config__ = [("check_client" , "bool" , "Don't use if client is connected" , True ), ("confirm" , "bool" , "Confirm Captcha (cost +6 credits)" , False ), diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 017e0952d..cc85f8660 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -39,7 +39,7 @@ class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" __type__ = "hook" __version__ = "0.10" - __status__ = "stable" + __status__ = "testing" __config__ = [("username" , "str" , "Username" , "" ), ("password" , "password", "Password" , "" ), diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 2962ec927..b4ccc24a1 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -39,7 +39,7 @@ class Checksum(Addon): __name__ = "Checksum" __type__ = "hook" __version__ = "0.18" - __status__ = "stable" + __status__ = "testing" __config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), ("check_action" , "fail;retry;nothing", "What to do if check fails?" , "retry"), diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index a294c3d4d..ba03129e6 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -30,7 +30,7 @@ class ClickAndLoad(Addon): __name__ = "ClickAndLoad" __type__ = "hook" __version__ = "0.45" - __status__ = "stable" + __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True), ("port" , "int" , "Port" , 9666), diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index a139f28a6..baf73d6b8 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -52,7 +52,7 @@ class DeathByCaptcha(Hook): __name__ = "DeathByCaptcha" __type__ = "hook" __version__ = "0.08" - __status__ = "stable" + __status__ = "testing" __config__ = [("username" , "str" , "Username" , "" ), ("password" , "password", "Password" , "" ), diff --git a/module/plugins/hooks/DebridItaliaComHook.py b/module/plugins/hooks/DebridItaliaComHook.py index 738f46beb..1b000c665 100644 --- a/module/plugins/hooks/DebridItaliaComHook.py +++ b/module/plugins/hooks/DebridItaliaComHook.py @@ -9,7 +9,7 @@ class DebridItaliaComHook(MultiHook): __name__ = "DebridItaliaComHook" __type__ = "hook" __version__ = "0.13" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index b79a84531..630c4cb02 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -8,7 +8,7 @@ class DeleteFinished(Addon): __name__ = "DeleteFinished" __type__ = "hook" __version__ = "1.14" - __status__ = "stable" + __status__ = "testing" __config__ = [("interval" , "int" , "Check interval in hours" , 72 ), ("deloffline", "bool", "Delete package with offline links", False)] diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 7c24a41db..b2e804dce 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -10,7 +10,7 @@ class DownloadScheduler(Addon): __name__ = "DownloadScheduler" __type__ = "hook" __version__ = "0.24" - __status__ = "stable" + __status__ = "testing" __config__ = [("timetable", "str" , "List time periods as hh:mm full or number(kB/s)" , "0:00 full, 7:00 250, 10:00 0, 17:00 150"), ("abort" , "bool", "Abort active downloads when start period with speed 0", False )] diff --git a/module/plugins/hooks/EasybytezComHook.py b/module/plugins/hooks/EasybytezComHook.py index 896ef93d9..f96668245 100644 --- a/module/plugins/hooks/EasybytezComHook.py +++ b/module/plugins/hooks/EasybytezComHook.py @@ -9,7 +9,7 @@ class EasybytezComHook(MultiHook): __name__ = "EasybytezComHook" __type__ = "hook" __version__ = "0.08" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index eb62ef796..630382f2d 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -16,7 +16,7 @@ class ExpertDecoders(Hook): __name__ = "ExpertDecoders" __type__ = "hook" __version__ = "0.06" - __status__ = "stable" + __status__ = "testing" __config__ = [("passkey" , "password", "Access key" , "" ), ("check_client", "bool" , "Don't use if client is connected", True)] diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 0859b39a9..126a17635 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -11,7 +11,7 @@ class ExternalScripts(Addon): __name__ = "ExternalScripts" __type__ = "hook" __version__ = "0.43" - __status__ = "stable" + __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), ("waitend" , "bool", "Wait script ending", False)] diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 0f757f258..03a3d00bf 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -113,7 +113,7 @@ class ExtractArchive(Addon): __name__ = "ExtractArchive" __type__ = "hook" __version__ = "1.47" - __status__ = "stable" + __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract with full paths" , True ), diff --git a/module/plugins/hooks/FastixRuHook.py b/module/plugins/hooks/FastixRuHook.py index 227068049..3fdb29409 100644 --- a/module/plugins/hooks/FastixRuHook.py +++ b/module/plugins/hooks/FastixRuHook.py @@ -8,7 +8,7 @@ class FastixRuHook(MultiHook): __name__ = "FastixRuHook" __type__ = "hook" __version__ = "0.06" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/FreeWayMeHook.py b/module/plugins/hooks/FreeWayMeHook.py index 04952b062..8defeeb3c 100644 --- a/module/plugins/hooks/FreeWayMeHook.py +++ b/module/plugins/hooks/FreeWayMeHook.py @@ -7,7 +7,7 @@ class FreeWayMeHook(MultiHook): __name__ = "FreeWayMeHook" __type__ = "hook" __version__ = "0.17" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/HighWayMeHook.py b/module/plugins/hooks/HighWayMeHook.py index 231394cfe..e9e62525d 100644 --- a/module/plugins/hooks/HighWayMeHook.py +++ b/module/plugins/hooks/HighWayMeHook.py @@ -8,7 +8,7 @@ class HighWayMeHook(MultiHook): __name__ = "HighWayMeHook" __type__ = "hook" __version__ = "0.04" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index f456d112f..84db4db17 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -15,7 +15,7 @@ class HotFolder(Addon): __name__ = "HotFolder" __type__ = "hook" __version__ = "0.16" - __status__ = "stable" + __status__ = "testing" __config__ = [("folder" , "str" , "Folder to observe" , "container"), ("watch_file", "bool", "Observe link file" , False ), diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 54a94f6ec..b46310950 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -19,7 +19,7 @@ class IRCInterface(Thread, Addon): __name__ = "IRCInterface" __type__ = "hook" __version__ = "0.15" - __status__ = "stable" + __status__ = "testing" __config__ = [("host" , "str" , "IRC-Server Address" , "Enter your server here!"), ("port" , "int" , "IRC-Server Port" , 6667 ), diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index e87014447..2021bbf9d 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -33,7 +33,7 @@ class ImageTyperz(Hook): __name__ = "ImageTyperz" __type__ = "hook" __version__ = "0.08" - __status__ = "stable" + __status__ = "testing" __config__ = [("username" , "str" , "Username" , "" ), ("password" , "password", "Password" , "" ), diff --git a/module/plugins/hooks/JustPremium.py b/module/plugins/hooks/JustPremium.py index b252fbbe5..69a6a851b 100644 --- a/module/plugins/hooks/JustPremium.py +++ b/module/plugins/hooks/JustPremium.py @@ -9,7 +9,7 @@ class JustPremium(Addon): __name__ = "JustPremium" __type__ = "hook" __version__ = "0.24" - __status__ = "stable" + __status__ = "testing" __config__ = [("excluded", "str", "Exclude hosters (comma separated)", ""), ("included", "str", "Include hosters (comma separated)", "")] diff --git a/module/plugins/hooks/LinkdecrypterComHook.py b/module/plugins/hooks/LinkdecrypterComHook.py index a4735cd5a..6930afdb5 100644 --- a/module/plugins/hooks/LinkdecrypterComHook.py +++ b/module/plugins/hooks/LinkdecrypterComHook.py @@ -9,7 +9,7 @@ class LinkdecrypterComHook(MultiHook): __name__ = "LinkdecrypterComHook" __type__ = "hook" __version__ = "1.07" - __status__ = "stable" + __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , True ), ("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), diff --git a/module/plugins/hooks/LinksnappyComHook.py b/module/plugins/hooks/LinksnappyComHook.py index f7da6e21b..e46e480d6 100644 --- a/module/plugins/hooks/LinksnappyComHook.py +++ b/module/plugins/hooks/LinksnappyComHook.py @@ -8,7 +8,7 @@ class LinksnappyComHook(MultiHook): __name__ = "LinksnappyComHook" __type__ = "hook" __version__ = "0.05" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/MegaDebridEuHook.py b/module/plugins/hooks/MegaDebridEuHook.py index bbb9a0cab..04f0be86f 100644 --- a/module/plugins/hooks/MegaDebridEuHook.py +++ b/module/plugins/hooks/MegaDebridEuHook.py @@ -8,7 +8,7 @@ class MegaDebridEuHook(MultiHook): __name__ = "MegaDebridEuHook" __type__ = "hook" __version__ = "0.06" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/MegaRapidoNetHook.py b/module/plugins/hooks/MegaRapidoNetHook.py index 1dae5056f..f66129a9e 100644 --- a/module/plugins/hooks/MegaRapidoNetHook.py +++ b/module/plugins/hooks/MegaRapidoNetHook.py @@ -9,7 +9,7 @@ class MegaRapidoNetHook(MultiHook): __name__ = "MegaRapidoNetHook" __type__ = "hook" __version__ = "0.03" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index fa4c6bcd9..94c477b38 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -14,7 +14,7 @@ class MergeFiles(Addon): __name__ = "MergeFiles" __type__ = "hook" __version__ = "0.16" - __status__ = "stable" + __status__ = "testing" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 4a70726e4..929ab9a25 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -9,7 +9,7 @@ class MultiHome(Addon): __name__ = "MultiHome" __type__ = "hook" __version__ = "0.14" - __status__ = "stable" + __status__ = "testing" __config__ = [("interfaces", "str", "Interfaces", "None")] diff --git a/module/plugins/hooks/MultihostersComHook.py b/module/plugins/hooks/MultihostersComHook.py index f02c07a7a..ec1cf9c85 100644 --- a/module/plugins/hooks/MultihostersComHook.py +++ b/module/plugins/hooks/MultihostersComHook.py @@ -7,7 +7,7 @@ class MultihostersComHook(ZeveraComHook): __name__ = "MultihostersComHook" __type__ = "hook" __version__ = "0.03" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/MultishareCzHook.py b/module/plugins/hooks/MultishareCzHook.py index f2c08bf04..30f1e21b5 100644 --- a/module/plugins/hooks/MultishareCzHook.py +++ b/module/plugins/hooks/MultishareCzHook.py @@ -9,7 +9,7 @@ class MultishareCzHook(MultiHook): __name__ = "MultishareCzHook" __type__ = "hook" __version__ = "0.08" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/MyfastfileComHook.py b/module/plugins/hooks/MyfastfileComHook.py index 17fdfe4da..1eedd9238 100644 --- a/module/plugins/hooks/MyfastfileComHook.py +++ b/module/plugins/hooks/MyfastfileComHook.py @@ -8,7 +8,7 @@ class MyfastfileComHook(MultiHook): __name__ = "MyfastfileComHook" __type__ = "hook" __version__ = "0.06" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/NoPremiumPlHook.py b/module/plugins/hooks/NoPremiumPlHook.py index 3f41b1106..7dbdf6a68 100644 --- a/module/plugins/hooks/NoPremiumPlHook.py +++ b/module/plugins/hooks/NoPremiumPlHook.py @@ -8,7 +8,7 @@ class NoPremiumPlHook(MultiHook): __name__ = "NoPremiumPlHook" __type__ = "hook" __version__ = "0.04" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/OverLoadMeHook.py b/module/plugins/hooks/OverLoadMeHook.py index 29343f8b7..5398fc17d 100644 --- a/module/plugins/hooks/OverLoadMeHook.py +++ b/module/plugins/hooks/OverLoadMeHook.py @@ -7,7 +7,7 @@ class OverLoadMeHook(MultiHook): __name__ = "OverLoadMeHook" __type__ = "hook" __version__ = "0.05" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/PremiumToHook.py b/module/plugins/hooks/PremiumToHook.py index 02de0d1ba..6e940c5d9 100644 --- a/module/plugins/hooks/PremiumToHook.py +++ b/module/plugins/hooks/PremiumToHook.py @@ -7,7 +7,7 @@ class PremiumToHook(MultiHook): __name__ = "PremiumToHook" __type__ = "hook" __version__ = "0.10" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py index b6bce5985..c33b5e0a5 100644 --- a/module/plugins/hooks/PremiumizeMeHook.py +++ b/module/plugins/hooks/PremiumizeMeHook.py @@ -8,7 +8,7 @@ class PremiumizeMeHook(MultiHook): __name__ = "PremiumizeMeHook" __type__ = "hook" __version__ = "0.19" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/PutdriveComHook.py b/module/plugins/hooks/PutdriveComHook.py index e863c2eda..d206aaf88 100644 --- a/module/plugins/hooks/PutdriveComHook.py +++ b/module/plugins/hooks/PutdriveComHook.py @@ -7,7 +7,7 @@ class PutdriveComHook(ZeveraComHook): __name__ = "PutdriveComHook" __type__ = "hook" __version__ = "0.02" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/RPNetBizHook.py b/module/plugins/hooks/RPNetBizHook.py index 0c911ef00..2804c9356 100644 --- a/module/plugins/hooks/RPNetBizHook.py +++ b/module/plugins/hooks/RPNetBizHook.py @@ -8,7 +8,7 @@ class RPNetBizHook(MultiHook): __name__ = "RPNetBizHook" __type__ = "hook" __version__ = "0.15" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/RapideoPlHook.py b/module/plugins/hooks/RapideoPlHook.py index f5ec37271..130f73851 100644 --- a/module/plugins/hooks/RapideoPlHook.py +++ b/module/plugins/hooks/RapideoPlHook.py @@ -8,7 +8,7 @@ class RapideoPlHook(MultiHook): __name__ = "RapideoPlHook" __type__ = "hook" __version__ = "0.04" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/RealdebridComHook.py b/module/plugins/hooks/RealdebridComHook.py index 0f5dfc739..01b9d165e 100644 --- a/module/plugins/hooks/RealdebridComHook.py +++ b/module/plugins/hooks/RealdebridComHook.py @@ -7,7 +7,7 @@ class RealdebridComHook(MultiHook): __name__ = "RealdebridComHook" __type__ = "hook" __version__ = "0.47" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/RehostToHook.py b/module/plugins/hooks/RehostToHook.py index 265dceb4c..b3e37369c 100644 --- a/module/plugins/hooks/RehostToHook.py +++ b/module/plugins/hooks/RehostToHook.py @@ -7,7 +7,7 @@ class RehostToHook(MultiHook): __name__ = "RehostToHook" __type__ = "hook" __version__ = "0.51" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index aa67bd0ca..611059588 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -7,7 +7,7 @@ class RestartFailed(Addon): __name__ = "RestartFailed" __type__ = "hook" __version__ = "1.60" - __status__ = "stable" + __status__ = "testing" __config__ = [("interval", "int", "Check interval in minutes", 90)] diff --git a/module/plugins/hooks/SimplyPremiumComHook.py b/module/plugins/hooks/SimplyPremiumComHook.py index 44393c305..6fbd75c8a 100644 --- a/module/plugins/hooks/SimplyPremiumComHook.py +++ b/module/plugins/hooks/SimplyPremiumComHook.py @@ -8,7 +8,7 @@ class SimplyPremiumComHook(MultiHook): __name__ = "SimplyPremiumComHook" __type__ = "hook" __version__ = "0.06" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/SimplydebridComHook.py b/module/plugins/hooks/SimplydebridComHook.py index 7bcb20b4c..0da7ec719 100644 --- a/module/plugins/hooks/SimplydebridComHook.py +++ b/module/plugins/hooks/SimplydebridComHook.py @@ -7,7 +7,7 @@ class SimplydebridComHook(MultiHook): __name__ = "SimplydebridComHook" __type__ = "hook" __version__ = "0.05" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index bbccae0a1..62ab41130 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -14,7 +14,7 @@ class SkipRev(Addon): __name__ = "SkipRev" __type__ = "hook" __version__ = "0.33" - __status__ = "stable" + __status__ = "testing" __config__ = [("mode" , "Auto;Manual", "Choose recovery archives to skip" , "Auto"), ("revtokeep", "int" , "Number of recovery archives to keep for package", 0 )] diff --git a/module/plugins/hooks/SmoozedComHook.py b/module/plugins/hooks/SmoozedComHook.py index 0c8e74f49..a794934de 100644 --- a/module/plugins/hooks/SmoozedComHook.py +++ b/module/plugins/hooks/SmoozedComHook.py @@ -7,7 +7,7 @@ class SmoozedComHook(MultiHook): __name__ = "SmoozedComHook" __type__ = "hook" __version__ = "0.04" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 74d778d59..0be1911b4 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -8,7 +8,7 @@ class UnSkipOnFail(Addon): __name__ = "UnSkipOnFail" __type__ = "hook" __version__ = "0.09" - __status__ = "stable" + __status__ = "testing" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index dd39efcc2..721c78d43 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -30,7 +30,7 @@ class UpdateManager(Addon): __name__ = "UpdateManager" __type__ = "hook" __version__ = "0.54" - __status__ = "stable" + __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), ("checkinterval", "int" , "Check interval in hours" , 8 ), diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py index aa90bdd1a..dbd18bc2c 100644 --- a/module/plugins/hooks/UserAgentSwitcher.py +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -9,7 +9,7 @@ class UserAgentSwitcher(Addon): __name__ = "UserAgentSwitcher" __type__ = "hook" __version__ = "0.10" - __status__ = "stable" + __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), ("connecttimeout", "int" , "Connection timeout in seconds" , 60 ), diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py index a554642e3..900d94a04 100644 --- a/module/plugins/hooks/WindowsPhoneNotify.py +++ b/module/plugins/hooks/WindowsPhoneNotify.py @@ -10,7 +10,7 @@ class WindowsPhoneNotify(Addon): __name__ = "WindowsPhoneNotify" __type__ = "hook" __version__ = "0.12" - __status__ = "stable" + __status__ = "testing" __config__ = [("push-id" , "str" , "Push ID" , "" ), ("push-url" , "str" , "Push url" , "" ), diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 1e8173830..fa3f2ad72 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -9,7 +9,7 @@ class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" __version__ = "0.40" - __status__ = "stable" + __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), ("use_hoster_list" , "bool", "Load listed hosters only" , False), diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 2e4261286..50dd40774 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -13,7 +13,7 @@ class XMPPInterface(IRCInterface, JabberClient): __name__ = "XMPPInterface" __type__ = "hook" __version__ = "0.12" - __status__ = "stable" + __status__ = "testing" __config__ = [("jid" , "str" , "Jabber ID" , "user@exmaple-jabber-server.org" ), ("pw" , "str" , "Password" , "" ), diff --git a/module/plugins/hooks/ZeveraComHook.py b/module/plugins/hooks/ZeveraComHook.py index b6fcfaa66..395c67802 100644 --- a/module/plugins/hooks/ZeveraComHook.py +++ b/module/plugins/hooks/ZeveraComHook.py @@ -7,7 +7,7 @@ class ZeveraComHook(MultiHook): __name__ = "ZeveraComHook" __type__ = "hook" __version__ = "0.06" - __status__ = "stable" + __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", "" ), -- cgit v1.2.3 From 761ca5c66e07559925ebbdbc6531f9ca658b12ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 16:11:58 +0200 Subject: Code cosmetics --- module/plugins/hooks/BypassCaptcha.py | 4 ++-- module/plugins/hooks/Captcha9Kw.py | 6 +++--- module/plugins/hooks/CaptchaBrotherhood.py | 2 +- module/plugins/hooks/Checksum.py | 6 +++--- module/plugins/hooks/DeathByCaptcha.py | 8 ++++---- module/plugins/hooks/DeleteFinished.py | 2 +- module/plugins/hooks/ExtractArchive.py | 2 +- module/plugins/hooks/IRCInterface.py | 2 +- module/plugins/hooks/ImageTyperz.py | 2 +- module/plugins/hooks/RestartFailed.py | 2 +- module/plugins/hooks/SkipRev.py | 2 +- module/plugins/hooks/UnSkipOnFail.py | 6 +++--- module/plugins/hooks/UpdateManager.py | 8 ++++---- 13 files changed, 26 insertions(+), 26 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 578586ae5..a89d1c23f 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -114,12 +114,12 @@ class BypassCaptcha(Hook): def captcha_correct(self, task): - if task.data['service'] == self.__name__ and "ticket" in task.data: + if task.data['service'] is self.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], True) def captcha_invalid(self, task): - if task.data['service'] == self.__name__ and "ticket" in task.data: + if task.data['service'] is self.__name__ and "ticket" in task.data: self.respond(task.data['ticket'], False) diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 31638214e..be01688e2 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -81,7 +81,7 @@ class Captcha9Kw(Hook): details = map(str.strip, opt.split(':')) - if not details or details[0].lower() != pluginname.lower(): + if not details or details[0].lower() not is pluginname.lower(): continue for d in details: @@ -187,14 +187,14 @@ class Captcha9Kw(Hook): for opt in str(self.get_config('hoster_options').split('|')): details = map(str.strip, opt.split(':')) - if not details or details[0].lower() != pluginname.lower(): + if not details or details[0].lower() not is pluginname.lower(): continue for d in details: hosteroption = d.split("=") if len(hosteroption) > 1 \ - and hosteroption[0].lower() == 'timeout' \ + and hosteroption[0].lower() == "timeout" \ and hosteroption[1].isdigit(): timeout = int(hosteroption[1]) diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index cc85f8660..42a9a26d9 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -151,7 +151,7 @@ class CaptchaBrotherhood(Hook): def captcha_invalid(self, task): - if task.data['service'] == self.__name__ and "ticket" in task.data: + if task.data['service'] is self.__name__ and "ticket" in task.data: res = self.api_response("complainCaptcha", task.data['ticket']) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index b4ccc24a1..06cb09215 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -114,7 +114,7 @@ class Checksum(Addon): api_size = int(data['size']) file_size = os.path.getsize(local_file) - if api_size != file_size: + if api_size not is file_size: self.log_warning(_("File %s has incorrect size: %d B (%d expected)") % (pyfile.name, file_size, api_size)) self.check_failed(pyfile, local_file, "Incorrect file size") @@ -133,7 +133,7 @@ class Checksum(Addon): if key in data: checksum = computeChecksum(local_file, key.replace("-", "").lower()) if checksum: - if checksum == data[key].lower(): + if checksum is data[key].lower(): self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') % (pyfile.name, key.upper(), checksum)) break @@ -187,7 +187,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) - if checksum == data['HASH']: + if checksum is data['HASH']: self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') % (data['NAME'], algorithm, checksum)) else: diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index baf73d6b8..c27db422b 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -93,11 +93,11 @@ class DeathByCaptcha(Hook): raise DeathByCaptchaException(str(res)) except BadHeader, e: - if 403 == e.code: + if 403 is e.code: raise DeathByCaptchaException('not-logged-in') - elif 413 == e.code: + elif 413 is e.code: raise DeathByCaptchaException('invalid-captcha') - elif 503 == e.code: + elif 503 is e.code: raise DeathByCaptchaException('service-overload') elif e.code in (400, 405): raise DeathByCaptchaException('invalid-request') @@ -192,7 +192,7 @@ class DeathByCaptcha(Hook): def captcha_invalid(self, task): - if task.data['service'] == self.__name__ and "ticket" in task.data: + if task.data['service'] is self.__name__ and "ticket" in task.data: try: res = self.api_response("captcha/%d/report" % task.data['ticket'], True) diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 630c4cb02..8981c6ac1 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -39,7 +39,7 @@ class DeleteFinished(Addon): # def plugin_config_changed(self, plugin, name, value): - # if name == "interval" and value != self.interval: + # if name == "interval" and value not is self.interval: # self.interval = value * 3600 # self.init_periodical() diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 03a3d00bf..5a51319ad 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -103,7 +103,7 @@ class ArchiveQueue(object): except ValueError: pass - if queue == []: + if queue is []: return self.delete() return self.set(queue) diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index b46310950..c018850b6 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -150,7 +150,7 @@ class IRCInterface(Thread, Addon): if not msg['origin'].split("!", 1)[0] in self.get_config('owner').split(): return - if msg['target'].split("!", 1)[0] != self.get_config('nick'): + if msg['target'].split("!", 1)[0] not is self.get_config('nick'): return if msg['action'] != "PRIVMSG": diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 2021bbf9d..d453122d0 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -129,7 +129,7 @@ class ImageTyperz(Hook): def captcha_invalid(self, task): - if task.data['service'] == self.__name__ and "ticket" in task.data: + if task.data['service'] is self.__name__ and "ticket" in task.data: res = self.load(self.RESPOND_URL, post={'action': "SETBADIMAGE", 'username': self.get_config('username'), diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 611059588..93add5a88 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -22,7 +22,7 @@ class RestartFailed(Addon): # def plugin_config_changed(self, plugin, name, value): # if name == "interval": # interval = value * 60 - # if self.MIN_CHECK_INTERVAL <= interval != self.interval: + # if self.MIN_CHECK_INTERVAL <= interval not is self.interval: # self.pyload.scheduler.removeJob(self.cb) # self.interval = interval # self.init_periodical() diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 62ab41130..a1ddc3094 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -87,7 +87,7 @@ class SkipRev(Addon): pyname = re.compile(r'%s\.part\d+\.rev$' % pyfile.name.rsplit('.', 2)[0].replace('.', '\.')) for link in self.pyload.api.getPackageData(pyfile.package().id).links: - if link.status is 4 and pyname.match(link.name): + if link.status == 4 and pyname.match(link.name): pylink = self._pyfile(link) if revtokeep > -1 or pyfile.name.endswith(".rev"): diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 0be1911b4..5c2e89a7b 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -61,19 +61,19 @@ class UnSkipOnFail(Addon): for package in queue: #: Check if package-folder equals pyfile's package folder - if package.folder != pyfile.package().folder: + if package.folder not is pyfile.package().folder: continue #: Now get packaged data w/ files/links pdata = self.pyload.api.getPackageData(package.pid) for link in pdata.links: - #: Check if link is "skipped" + #: Check if link == "skipped" if link.status != 4: continue #: Check if link name collides with pdata's name #: and at last check if it is not pyfile itself - if link.name == pyfile.name and link.fid != pyfile.id: + if link.name is pyfile.name and link.fid not is pyfile.id: return link diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 721c78d43..4e13bfe9c 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -17,7 +17,7 @@ from module.utils import save_join as fs_join # Case-sensitive os.path.exists def exists(path): if os.path.exists(path): - if os.name == 'nt': + if os.name == "nt": dir, name = os.path.split(path) return name in os.listdir(dir) else: @@ -153,7 +153,7 @@ class UpdateManager(Addon): """ Check for updates """ - if self._update() is 2 and self.get_config('autorestart'): + if self._update() == 2 and self.get_config('autorestart'): if not self.pyload.api.statusDownloads(): self.pyload.api.restart() else: @@ -225,7 +225,7 @@ class UpdateManager(Addon): for t, n in type_plugins: for idx, plugin in enumerate(updatelist): - if n == plugin['name'] and t == plugin['type']: + if n is plugin['name'] and t is plugin['type']: updatelist.pop(idx) break @@ -271,7 +271,7 @@ class UpdateManager(Addon): content = self.load(url % plugin, decode=False) m = VERSION.search(content) - if m and m.group(2) == version: + if m and m.group(2) is version: with open(fs_join("userplugins", prefix, filename), "wb") as f: f.write(content) -- cgit v1.2.3 From dd13825fbd3df9e441200638cd2a92e3924dfff6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 24 Jul 2015 23:57:04 +0200 Subject: Fix typo --- module/plugins/hooks/Captcha9Kw.py | 4 ++-- module/plugins/hooks/Checksum.py | 2 +- module/plugins/hooks/DeleteFinished.py | 2 +- module/plugins/hooks/IRCInterface.py | 2 +- module/plugins/hooks/RestartFailed.py | 2 +- module/plugins/hooks/UnSkipOnFail.py | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index be01688e2..e9edbe7f9 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -81,7 +81,7 @@ class Captcha9Kw(Hook): details = map(str.strip, opt.split(':')) - if not details or details[0].lower() not is pluginname.lower(): + if not details or details[0].lower() is not pluginname.lower(): continue for d in details: @@ -187,7 +187,7 @@ class Captcha9Kw(Hook): for opt in str(self.get_config('hoster_options').split('|')): details = map(str.strip, opt.split(':')) - if not details or details[0].lower() not is pluginname.lower(): + if not details or details[0].lower() is not pluginname.lower(): continue for d in details: diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 06cb09215..9eb47e8a6 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -114,7 +114,7 @@ class Checksum(Addon): api_size = int(data['size']) file_size = os.path.getsize(local_file) - if api_size not is file_size: + if api_size is not file_size: self.log_warning(_("File %s has incorrect size: %d B (%d expected)") % (pyfile.name, file_size, api_size)) self.check_failed(pyfile, local_file, "Incorrect file size") diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py index 8981c6ac1..75a282808 100644 --- a/module/plugins/hooks/DeleteFinished.py +++ b/module/plugins/hooks/DeleteFinished.py @@ -39,7 +39,7 @@ class DeleteFinished(Addon): # def plugin_config_changed(self, plugin, name, value): - # if name == "interval" and value not is self.interval: + # if name == "interval" and value is not self.interval: # self.interval = value * 3600 # self.init_periodical() diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index c018850b6..08b1bad0c 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -150,7 +150,7 @@ class IRCInterface(Thread, Addon): if not msg['origin'].split("!", 1)[0] in self.get_config('owner').split(): return - if msg['target'].split("!", 1)[0] not is self.get_config('nick'): + if msg['target'].split("!", 1)[0] is not self.get_config('nick'): return if msg['action'] != "PRIVMSG": diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 93add5a88..6c3388e3a 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -22,7 +22,7 @@ class RestartFailed(Addon): # def plugin_config_changed(self, plugin, name, value): # if name == "interval": # interval = value * 60 - # if self.MIN_CHECK_INTERVAL <= interval not is self.interval: + # if self.MIN_CHECK_INTERVAL <= interval is not self.interval: # self.pyload.scheduler.removeJob(self.cb) # self.interval = interval # self.init_periodical() diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index 5c2e89a7b..d467b8a01 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -61,7 +61,7 @@ class UnSkipOnFail(Addon): for package in queue: #: Check if package-folder equals pyfile's package folder - if package.folder not is pyfile.package().folder: + if package.folder is not pyfile.package().folder: continue #: Now get packaged data w/ files/links @@ -73,7 +73,7 @@ class UnSkipOnFail(Addon): #: Check if link name collides with pdata's name #: and at last check if it is not pyfile itself - if link.name is pyfile.name and link.fid not is pyfile.id: + if link.name is pyfile.name and link.fid is not pyfile.id: return link -- cgit v1.2.3 From 8f17f875f6e28f73ddb10da59c6464bd04922222 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 04:59:27 +0200 Subject: Account rewritten --- module/plugins/hooks/EasybytezComHook.py | 4 ++-- module/plugins/hooks/FreeWayMeHook.py | 2 +- module/plugins/hooks/PremiumToHook.py | 2 +- module/plugins/hooks/PremiumizeMeHook.py | 2 +- module/plugins/hooks/RPNetBizHook.py | 2 +- module/plugins/hooks/RehostToHook.py | 4 ++-- module/plugins/hooks/SmoozedComHook.py | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/EasybytezComHook.py b/module/plugins/hooks/EasybytezComHook.py index f96668245..9e33bbad0 100644 --- a/module/plugins/hooks/EasybytezComHook.py +++ b/module/plugins/hooks/EasybytezComHook.py @@ -22,9 +22,9 @@ class EasybytezComHook(MultiHook): def get_hosters(self): - user, data = self.account.select_account() + user, data = self.account.select() html = self.load("http://www.easybytez.com", - req=self.account.get_account_request(user)) + req=self.account.get_request(user)) return re.search(r'\s*Supported sites:(.*)', html).group(1).split(',') diff --git a/module/plugins/hooks/FreeWayMeHook.py b/module/plugins/hooks/FreeWayMeHook.py index 8defeeb3c..5f30d70fc 100644 --- a/module/plugins/hooks/FreeWayMeHook.py +++ b/module/plugins/hooks/FreeWayMeHook.py @@ -20,6 +20,6 @@ class FreeWayMeHook(MultiHook): def get_hosters(self): - user, data = self.account.select_account() + user, data = self.account.select() hostis = self.load("http://www.free-way.bz/ajax/jd.php", get={'id': 3, 'user': user, 'pass': data['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10 return [x.strip() for x in hostis.split(",") if x.strip()] diff --git a/module/plugins/hooks/PremiumToHook.py b/module/plugins/hooks/PremiumToHook.py index 6e940c5d9..062113e96 100644 --- a/module/plugins/hooks/PremiumToHook.py +++ b/module/plugins/hooks/PremiumToHook.py @@ -22,7 +22,7 @@ class PremiumToHook(MultiHook): def get_hosters(self): - user, data = self.account.select_account() + user, data = self.account.select() html = self.load("http://premium.to/api/hosters.php", get={'username': user, 'password': data['password']}) return [x.strip() for x in html.replace("\"", "").split(";")] diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py index c33b5e0a5..6be32b70b 100644 --- a/module/plugins/hooks/PremiumizeMeHook.py +++ b/module/plugins/hooks/PremiumizeMeHook.py @@ -22,7 +22,7 @@ class PremiumizeMeHook(MultiHook): def get_hosters(self): #: Get account data - user, data = self.account.select_account() + user, data = self.account.select() #: Get supported hosters list from premiumize.me using the #: json API v1 (see https://secure.premiumize.me/?show=api) diff --git a/module/plugins/hooks/RPNetBizHook.py b/module/plugins/hooks/RPNetBizHook.py index 2804c9356..5e7174de6 100644 --- a/module/plugins/hooks/RPNetBizHook.py +++ b/module/plugins/hooks/RPNetBizHook.py @@ -22,7 +22,7 @@ class RPNetBizHook(MultiHook): def get_hosters(self): #: Get account data - user, data = self.account.select_account() + user, data = self.account.select() res = self.load("https://premium.rpnet.biz/client_api.php", get={'username': user, 'password': data['password'], 'action': "showHosterList"}) diff --git a/module/plugins/hooks/RehostToHook.py b/module/plugins/hooks/RehostToHook.py index b3e37369c..58367e241 100644 --- a/module/plugins/hooks/RehostToHook.py +++ b/module/plugins/hooks/RehostToHook.py @@ -20,8 +20,8 @@ class RehostToHook(MultiHook): def get_hosters(self): - user, data = self.account.select_account() + user, data = self.account.select() html = self.load("http://rehost.to/api.php", get={'cmd' : "get_supported_och_dl", - 'long_ses': self.account.get_account_info(user)['session']}) + 'long_ses': self.account.get_data(user)['session']}) return [x.strip() for x in html.replace("\"", "").split(",")] diff --git a/module/plugins/hooks/SmoozedComHook.py b/module/plugins/hooks/SmoozedComHook.py index a794934de..6b9b688ff 100644 --- a/module/plugins/hooks/SmoozedComHook.py +++ b/module/plugins/hooks/SmoozedComHook.py @@ -20,5 +20,5 @@ class SmoozedComHook(MultiHook): def get_hosters(self): - user, data = self.account.select_account() - return self.account.get_account_info(user)['hosters'] + user, data = self.account.select() + return self.account.get_data(user)['hosters'] -- cgit v1.2.3 From 952001324e1faf584b1adcb01c4a0406a3722932 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 25 Jul 2015 09:42:49 +0200 Subject: =?UTF-8?q?Don't=20user=20dictionary=E2=80=99s=20iterator=20method?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/plugins/hooks/Checksum.py | 2 +- module/plugins/hooks/ExternalScripts.py | 2 +- module/plugins/hooks/ExtractArchive.py | 2 +- module/plugins/hooks/MegaRapidoNetHook.py | 2 +- module/plugins/hooks/MergeFiles.py | 4 ++-- module/plugins/hooks/UpdateManager.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 9eb47e8a6..251918df5 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -166,7 +166,7 @@ class Checksum(Addon): def package_finished(self, pypack): download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder, "") - for link in pypack.getChildren().itervalues(): + for link in pypack.getChildren().values(): file_type = os.path.splitext(link['name'])[1][1:].lower() if file_type not in self.formats: diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 126a17635..9c9cd51c6 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -48,7 +48,7 @@ class ExternalScripts(Addon): for dir in (pypath, ''): self.init_plugin_type(folder, os.path.join(dir, 'scripts', folder)) - for script_type, names in self.scripts.iteritems(): + for script_type, names in self.scripts.items(): if names: self.log_info(_("Installed scripts for: ") + script_type, ", ".join(map(os.path.basename, names))) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 5a51319ad..2e45f4a38 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -299,7 +299,7 @@ class ExtractArchive(Addon): matched = False success = True files_ids = dict((pylink['name'], ((fs_join(download_folder, pypack.folder, pylink['name'])), pylink['id'], out)) for pylink \ - in sorted(pypack.getChildren().itervalues(), key=lambda k: k['name'])).values() #: Remove duplicates + in sorted(pypack.getChildren().values(), key=lambda k: k['name'])).values() #: Remove duplicates #: Check as long there are unseen files while files_ids: diff --git a/module/plugins/hooks/MegaRapidoNetHook.py b/module/plugins/hooks/MegaRapidoNetHook.py index f66129a9e..4956427ff 100644 --- a/module/plugins/hooks/MegaRapidoNetHook.py +++ b/module/plugins/hooks/MegaRapidoNetHook.py @@ -76,7 +76,7 @@ class MegaRapidoNetHook(MultiHook): hoster_list = [] - for item in hosters.itervalues(): + for item in hosters.values(): hoster_list.extend(item) return hoster_list diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 94c477b38..a76a578bf 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -30,7 +30,7 @@ class MergeFiles(Addon): def package_finished(self, pack): files = {} fid_dict = {} - for fid, data in pack.getChildren().iteritems(): + for fid, data in pack.getChildren().items(): if re.search("\.\d{3}$", data['name']): if data['name'][:-4] not in files: files[data['name'][:-4]] = [] @@ -43,7 +43,7 @@ class MergeFiles(Addon): if self.pyload.config.get("general", "folder_per_package"): download_folder = fs_join(download_folder, pack.folder) - for name, file_list in files.iteritems(): + for name, file_list in files.items(): self.log_info(_("Starting merging of"), name) with open(fs_join(download_folder, name), "wb") as final_file: diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 4e13bfe9c..c36b6c539 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -114,7 +114,7 @@ class UpdateManager(Addon): modules = filter( lambda m: m and (m.__name__.startswith("module.plugins.") or m.__name__.startswith("userplugins.")) and - m.__name__.count(".") >= 2, sys.modules.itervalues() + m.__name__.count(".") >= 2, sys.modules.values() ) reloads = [] -- cgit v1.2.3 From 34f48259060656077b5cb45edd8f9d92bb0282de Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Jul 2015 20:19:03 +0200 Subject: Bunch of fixups --- module/plugins/hooks/UpdateManager.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index c36b6c539..0de3d05dc 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -11,25 +11,14 @@ import traceback from operator import itemgetter from module.plugins.internal.Addon import Expose, Addon, threaded -from module.utils import save_join as fs_join - - -# Case-sensitive os.path.exists -def exists(path): - if os.path.exists(path): - if os.name == "nt": - dir, name = os.path.split(path) - return name in os.listdir(dir) - else: - return True - else: - return False +from module.plugins.internal.Plugin import exists +from module.utils import fs_encode, save_join as fs_join class UpdateManager(Addon): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.54" + __version__ = "0.55" __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), @@ -271,13 +260,13 @@ class UpdateManager(Addon): content = self.load(url % plugin, decode=False) m = VERSION.search(content) - if m and m.group(2) is version: + if m and m.group(2) == version: with open(fs_join("userplugins", prefix, filename), "wb") as f: - f.write(content) + f.write(fs_encode(content)) updated.append((prefix, name)) else: - raise Exception, _("Version mismatch") + raise Exception(_("Version mismatch")) except Exception, e: self.log_error(_("Error updating plugin: %s") % filename, e) -- cgit v1.2.3 From 3e350f1da4f760a02a65928175f24fd38e689b6b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Jul 2015 20:38:21 +0200 Subject: [ExtractArchive] Rename archive_password.txt -> passwords.txt --- module/plugins/hooks/ExtractArchive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 2e45f4a38..ffcb6e738 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -122,7 +122,7 @@ class ExtractArchive(Addon): ("repair" , "bool" , "Repair broken archives (RAR required)" , False ), ("test" , "bool" , "Test archive before extracting" , False ), ("usepasswordfile", "bool" , "Use password file" , True ), - ("passwordfile" , "file" , "Password file" , "archive_password.txt" ), + ("passwordfile" , "file" , "Password file" , "passwords.txt" ), ("delete" , "bool" , "Delete archive after extraction" , True ), ("deltotrash" , "bool" , "Move to trash (recycle bin) instead delete", True ), ("subfolder" , "bool" , "Create subfolder for each package" , False ), -- cgit v1.2.3 From a9248ab9213f8464e5c9762ff2493c6ec4732a40 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Jul 2015 23:52:38 +0200 Subject: Fix https://github.com/pyload/pyload/pull/1571 --- module/plugins/hooks/XFileSharingPro.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index fa3f2ad72..6ffbb7f29 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.40" + __version__ = "0.41" __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), @@ -29,11 +29,11 @@ class XFileSharingPro(Hook): r'https?://(?:[^/]+\.)?(?P%s)/(?:user|folder)s?/\w+')} HOSTER_BUILTIN = [#WORKING HOSTERS: - "backin.net", "eyesfile.ca", "file4safe.com", "fileband.com", - "filedwon.com", "fileparadox.in", "filevice.com", "hostingbulk.com", - "junkyvideo.com", "linestorage.com", "ravishare.com", "ryushare.com", - "salefiles.com", "sendmyway.com", "sharebeast.com", "sharesix.com", - "thefile.me", "verzend.be", "worldbytez.com", "xvidstage.com", + "ani-stream.com", "backin.net", "eyesfile.ca", "file4safe.com", + "fileband.com", "filedwon.com", "fileparadox.in", "filevice.com", + "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", + "ryushare.com", "salefiles.com", "sendmyway.com", "sharebeast.com", + "sharesix.com", "thefile.me", "verzend.be", "worldbytez.com", "xvidstage.com", #: NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharerepo.com", -- cgit v1.2.3 From 9e44724d6dda3e1f47cf4d6de4b3e521a244ba4b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Jul 2015 19:15:28 +0200 Subject: Fix content-disposition --- module/plugins/hooks/UpdateManager.py | 5 ++--- module/plugins/hooks/XFileSharingPro.py | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 0de3d05dc..2f82bc498 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -2,14 +2,13 @@ from __future__ import with_statement +import operator import os import re import sys import time import traceback -from operator import itemgetter - from module.plugins.internal.Addon import Expose, Addon, threaded from module.plugins.internal.Plugin import exists from module.utils import fs_encode, save_join as fs_join @@ -224,7 +223,7 @@ class UpdateManager(Addon): 'name': n, }) - for plugin in sorted(updatelist, key=itemgetter("type", "name")): + for plugin in sorted(updatelist, key=operator.itemgetter("type", "name")): filename = plugin['name'] prefix = plugin['type'] version = plugin['version'] diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 6ffbb7f29..eed1c01de 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -29,10 +29,10 @@ class XFileSharingPro(Hook): r'https?://(?:[^/]+\.)?(?P%s)/(?:user|folder)s?/\w+')} HOSTER_BUILTIN = [#WORKING HOSTERS: - "ani-stream.com", "backin.net", "eyesfile.ca", "file4safe.com", - "fileband.com", "filedwon.com", "fileparadox.in", "filevice.com", - "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", - "ryushare.com", "salefiles.com", "sendmyway.com", "sharebeast.com", + "ani-stream.com", "backin.net", "eyesfile.ca", "file4safe.com", + "fileband.com", "filedwon.com", "fileparadox.in", "filevice.com", + "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", + "ryushare.com", "salefiles.com", "sendmyway.com", "sharebeast.com", "sharesix.com", "thefile.me", "verzend.be", "worldbytez.com", "xvidstage.com", #: NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", -- cgit v1.2.3 From f0df222caaa8544b84d84af2f8ea36783ddd8fb8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Jul 2015 19:22:06 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1581 --- module/plugins/hooks/UserAgentSwitcher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py index dbd18bc2c..52f542268 100644 --- a/module/plugins/hooks/UserAgentSwitcher.py +++ b/module/plugins/hooks/UserAgentSwitcher.py @@ -3,12 +3,13 @@ import pycurl from module.plugins.internal.Addon import Addon +from module.plugins.internal.Plugin import encode class UserAgentSwitcher(Addon): __name__ = "UserAgentSwitcher" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.11" __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), @@ -34,4 +35,4 @@ class UserAgentSwitcher(Addon): if useragent: self.log_debug("Use custom user-agent string: " + useragent) - pyfile.plugin.req.http.c.setopt(pycurl.USERAGENT, useragent) + pyfile.plugin.req.http.c.setopt(pycurl.USERAGENT, encode(useragent)) -- cgit v1.2.3 From f5b69d3190892aa5a16486f0c6f4fd80d18eba11 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Jul 2015 21:59:08 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1582 --- module/plugins/hooks/ExternalScripts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 9c9cd51c6..8e79a49a9 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -10,7 +10,7 @@ from module.utils import fs_encode, save_join as fs_join class ExternalScripts(Addon): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.43" + __version__ = "0.44" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -81,7 +81,7 @@ class ExternalScripts(Addon): def call_script(self, script, *args): try: - cmd_args = (fs_encode(x) if isinstande(x, basestring) else str(x) for x in args) #@NOTE: `fs_encode` -> `encode` in 0.4.10 + cmd_args = (fs_encode(x) if isinstance(x, basestring) else str(x) for x in args) #@NOTE: `fs_encode` -> `encode` in 0.4.10 self.log_debug("Executing: %s" % os.path.abspath(script), "Args: " + ' '.join(cmd_args)) -- cgit v1.2.3 From 2ec703256d3565e2b34c277dcee9fb80019f2f74 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Jul 2015 23:08:59 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1583 --- module/plugins/hooks/AntiVirus.py | 6 +++--- module/plugins/hooks/Checksum.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 80968c491..b6fd0ca2d 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -16,7 +16,7 @@ from module.utils import fs_encode, save_join as fs_join class AntiVirus(Addon): __name__ = "AntiVirus" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __status__ = "testing" #@TODO: add trash option (use Send2Trash lib) @@ -36,8 +36,8 @@ class AntiVirus(Addon): @Expose @threaded def scan(self, pyfile, thread): - file = fs_encode(pyfile.plugin.lastDownload) - filename = os.path.basename(pyfile.plugin.lastDownload) + file = fs_encode(pyfile.plugin.last_download) + filename = os.path.basename(pyfile.plugin.last_download) cmdfile = fs_encode(self.get_config('cmdfile')) cmdargs = fs_encode(self.get_config('cmdargs').strip()) diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 251918df5..6ecbfcda2 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.18" + __version__ = "0.19" __status__ = "testing" __config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), @@ -99,10 +99,10 @@ class Checksum(Addon): self.log_debug(data) - if not pyfile.plugin.lastDownload: + if not pyfile.plugin.last_download: self.check_failed(pyfile, None, "No file downloaded") - local_file = fs_encode(pyfile.plugin.lastDownload) + local_file = fs_encode(pyfile.plugin.last_download) # download_folder = self.pyload.config.get("general", "download_folder") # local_file = fs_encode(fs_join(download_folder, pyfile.package().folder, pyfile.name)) -- cgit v1.2.3 From e3364abb9364aff789cecbfc8d79c5633874975c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 05:50:27 +0200 Subject: New plugin: AntiStandby Fix https://github.com/pyload/pyload/issues/1231 --- module/plugins/hooks/AntiStandby.py | 157 ++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 module/plugins/hooks/AntiStandby.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py new file mode 100644 index 000000000..4a1155274 --- /dev/null +++ b/module/plugins/hooks/AntiStandby.py @@ -0,0 +1,157 @@ +# -*- coding: utf-8 -*- + +from __future__ import with_statement + +import os +import time +import subprocess +import sys + +try: + import caffeine +except ImportError: + pass + +from module.plugins.Addon import Addon, Expose + + +class Kernel32(object): + ES_AWAYMODE_REQUIRED = 0x00000040 + ES_CONTINUOUS = 0x80000000 + ES_DISPLAY_REQUIRED = 0x00000002 + ES_SYSTEM_REQUIRED = 0x00000001 + ES_USER_PRESENT = 0x00000004 + + +class AntiStandby(Addon): + __name__ = "AntiStandby" + __type__ = "hook" + __version__ = "0.01" + __status__ = "testing" + + __config__ = [("activated", "bool", "Activated" , True ), + ("hdd" , "bool", "Prevent HDD standby" , True ), + ("system" , "bool", "Prevent OS standby" , True ), + ("display" , "bool", "Prevent display standby" , False), + ("interval" , "int" , "HDD touching interval in seconds", 7 )] + + __description__ = """Prevent OS, HDD and display standby""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + TMP_FILE = ".antistandby" + MIN_INTERVAL = 5 + + + def setup(self): + self.mtime = 0 + + + def activate(self): + hdd = self.get_config('hdd') + system = self.get_config('system') + display = self.get_config('display') + + if hdd: + self.interval = max(self.get_config('interval'), self.MIN_INTERVAL) + self.init_periodical(self, threaded=True) + + if os.name == "nt": + self.win_standby(system, display) + + elif sys.platform == "darwin": + self.osx_standby(system, display) + + else: + self.linux_standby(system, display) + + + def deactivate(self): + try: + os.remove(self.TMP_FILE) + + except OSError: + pass + + if os.name == "nt": + self.win_standby(True) + + elif sys.platform == "darwin": + self.osx_standby(True) + + else: + self.linux_standby(True) + + + @Expose + def win_standby(system=True, display=True): + import ctypes + + set = ctypes.windll.kernel32.SetThreadExecutionState + + if system: + if display: + set(Kernel32.ES_CONTINUOUS) + else: + set(Kernel32.ES_CONTINUOUS | Kernel32.ES_DISPLAY_REQUIRED) + else: + if display: + set(Kernel32.ES_CONTINUOUS | Kernel32.ES_SYSTEM_REQUIRED) + else: + set(Kernel32.ES_CONTINUOUS | Kernel32.ES_SYSTEM_REQUIRED | Kernel32.ES_DISPLAY_REQUIRED) + + + @Expose + def osx_standby(system=True, display=True): + try: + if system: + caffeine.off() + else: + caffeine.on(display) + + except NameError: + self.log_warning(_("Unable to change power state"), + _("caffeine lib not found")) + + except Exception, e: + self.log_warning(_("Unable to change power state"), e) + + + @Expose + def linux_standby(system=True, display=True): + try: + if display: + subprocess.call(["xset", "+dpms", "s", "default"]) + else: + subprocess.call(["xset", "-dpms", "s", "off"]) + + except Exception, e: + self.log_warning(_("Unable to change power state"), e) + + + @Expose + def touch(self, path): + with open(path, 'w'): + os.utime(path, None) + + self.mtime = time.time() + + + @Expose + def max_mtime(self, path): + return max(os.path.getmtime(os.path.join(root, file)) + for file in files + for root, dirs, files in os.walk(path, topdown=False)) + + + def periodical(self): + if self.get_config('hdd') is False: + return + + if os.name != "nt": + path = self.pyload.config.get("general", "download_folder") + if (self.max_mtime(path) - self.mtime) < self.interval: + return + + self.touch(self.TMP_FILE) -- cgit v1.2.3 From 5181a04839f700f482fabed842b2ea0150b2c21d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 06:01:58 +0200 Subject: [AntiStandby] Hotfix --- module/plugins/hooks/AntiStandby.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index 4a1155274..4a542953e 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -12,7 +12,7 @@ try: except ImportError: pass -from module.plugins.Addon import Addon, Expose +from module.plugins.internal.Addon import Addon, Expose class Kernel32(object): @@ -26,7 +26,7 @@ class Kernel32(object): class AntiStandby(Addon): __name__ = "AntiStandby" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -50,12 +50,12 @@ class AntiStandby(Addon): def activate(self): hdd = self.get_config('hdd') - system = self.get_config('system') - display = self.get_config('display') + system = not self.get_config('system') + display = not self.get_config('display') if hdd: self.interval = max(self.get_config('interval'), self.MIN_INTERVAL) - self.init_periodical(self, threaded=True) + self.init_periodical(threaded=True) if os.name == "nt": self.win_standby(system, display) @@ -85,7 +85,7 @@ class AntiStandby(Addon): @Expose - def win_standby(system=True, display=True): + def win_standby(self, system=True, display=True): import ctypes set = ctypes.windll.kernel32.SetThreadExecutionState @@ -103,7 +103,7 @@ class AntiStandby(Addon): @Expose - def osx_standby(system=True, display=True): + def osx_standby(self, system=True, display=True): try: if system: caffeine.off() @@ -119,7 +119,7 @@ class AntiStandby(Addon): @Expose - def linux_standby(system=True, display=True): + def linux_standby(self, system=True, display=True): try: if display: subprocess.call(["xset", "+dpms", "s", "default"]) -- cgit v1.2.3 From 5a2781c923ecd13f3e671366fa6fa311d92d8547 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 08:21:04 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1586 --- module/plugins/hooks/ExtractArchive.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index ffcb6e738..98dea58ca 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -112,7 +112,7 @@ class ArchiveQueue(object): class ExtractArchive(Addon): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.47" + __version__ = "1.48" __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , True ), @@ -490,13 +490,15 @@ class ExtractArchive(Addon): send2trash.send2trash(file) except NameError: - self.log_warning(_("Unable to move %s to trash: Send2Trash lib not found") % os.path.basename(f)) + self.log_warning(_("Unable to move %s to trash") % os.path.basename(f), + _("Send2Trash lib not found")) except Exception, e: - self.log_warning(_("Unable to move %s to trash: %s") % (os.path.basename(f), e.message)) + self.log_warning(_("Unable to move %s to trash") % os.path.basename(f), + e.message) else: - self.log_debug("Successfully moved %s to trash" % os.path.basename(f)) + self.log_info(_("Moved %s to trash") % os.path.basename(f)) self.log_info(name, _("Extracting finished")) extracted_files = archive.files or archive.list() -- cgit v1.2.3 From bf6297fe115d0ca46ec39a4dbfd58b1878c6287d Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 08:26:05 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1588 --- module/plugins/hooks/AntiStandby.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index 4a542953e..b0262ed33 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -26,14 +26,14 @@ class Kernel32(object): class AntiStandby(Addon): __name__ = "AntiStandby" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), ("hdd" , "bool", "Prevent HDD standby" , True ), ("system" , "bool", "Prevent OS standby" , True ), ("display" , "bool", "Prevent display standby" , False), - ("interval" , "int" , "HDD touching interval in seconds", 7 )] + ("interval" , "int" , "HDD touching interval in seconds", 25 )] __description__ = """Prevent OS, HDD and display standby""" __license__ = "GPLv3" @@ -141,8 +141,8 @@ class AntiStandby(Addon): @Expose def max_mtime(self, path): return max(os.path.getmtime(os.path.join(root, file)) - for file in files - for root, dirs, files in os.walk(path, topdown=False)) + for root, dirs, files in os.walk(path, topdown=False) + for file in files) def periodical(self): -- cgit v1.2.3 From 6f5062a7ac02c8d583c7f9d480be69e3ee83c05c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 08:41:47 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1520 (3) --- module/plugins/hooks/UpdateManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 2f82bc498..117da0633 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -115,7 +115,7 @@ class UpdateManager(Addon): if not os.path.isfile(f): continue - mtime = os.stat(f).st_mtime + mtime = os.path.getmtime(f) if id not in self.mtimes: self.mtimes[id] = mtime -- cgit v1.2.3 From 8c18ee63d1e23dd1e54ecc04b2158fd9eef8a291 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 10:39:01 +0200 Subject: Fix http://forum.pyload.org/viewtopic.php?f=12&t=4419 --- module/plugins/hooks/ExternalScripts.py | 94 +++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 33 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 8e79a49a9..8495e2be2 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -3,18 +3,18 @@ import os import subprocess -from module.plugins.internal.Addon import Addon +from module.plugins.internal.Addon import Addon, Expose from module.utils import fs_encode, save_join as fs_join class ExternalScripts(Addon): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.44" + __version__ = "0.45" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), - ("waitend" , "bool", "Wait script ending", False)] + ("lock" , "bool", "Wait script ending", False)] __description__ = """Run external scripts""" __license__ = "GPLv3" @@ -74,57 +74,62 @@ class ExternalScripts(Addon): continue if not os.access(file, os.X_OK): - self.log_warning(_("Script not executable:") + " %s/%s" % (name, filename)) + self.log_warning(_("Script not executable: %s/%s" % (name, filename)) self.scripts[name].append(file) - def call_script(self, script, *args): + @Expose + def call(self, script, args=[], lock=False): try: - cmd_args = (fs_encode(x) if isinstance(x, basestring) else str(x) for x in args) #@NOTE: `fs_encode` -> `encode` in 0.4.10 + args = [script] + map(encode, args) + self.log_info(_("EXECUTE [%s] %s") % (os.path.dirname(script), args)) - self.log_debug("Executing: %s" % os.path.abspath(script), "Args: " + ' '.join(cmd_args)) - - cmd = (script,) + cmd_args - - p = subprocess.Popen(cmd, bufsize=-1) #@NOTE: output goes to pyload - if self.get_config('waitend'): + p = subprocess.Popen(args, bufsize=-1) #@NOTE: output goes to pyload + if lock: p.communicate() except Exception, e: - try: - self.log_error(_("Runtime error: %s") % os.path.abspath(script), e) - except Exception: - self.log_error(_("Runtime error: %s") % os.path.abspath(script), _("Unknown error")) + self.log_error(_("Runtime error: %s") % os.path.abspath(script), e or _("Unknown error")) def pyload_start(self): + lock = self.get_config('lock') for script in self.scripts['pyload_start']: - self.call_script(script) + self.call(script, lock=lock) def exit(self): + lock = self.get_config('lock') for script in self.scripts['pyload_restart' if self.pyload.do_restart else 'pyload_stop']: - self.call_script(script) + self.call(script, lock=True) def before_reconnect(self, ip): + lock = self.get_config('lock') for script in self.scripts['before_reconnect']: - self.call_script(script, ip) + args = [ip] + self.call(script, args, lock) self.info['oldip'] = ip def after_reconnect(self, ip): + lock = self.get_config('lock') for script in self.scripts['after_reconnect']: - self.call_script(script, ip, self.info['oldip']) #@TODO: Use built-in oldip in 0.4.10 + args = [ip, self.info['oldip']] #@TODO: Use built-in oldip in 0.4.10 + self.call(script, args, lock) def download_preparing(self, pyfile): + lock = self.get_config('lock') for script in self.scripts['download_preparing']: - self.call_script(script, pyfile.id, pyfile.name, None, pyfile.pluginname, pyfile.url) + args = [pyfile.id, pyfile.name, None, pyfile.pluginname, pyfile.url] + self.call(script, args, lock) def download_failed(self, pyfile): + lock = self.get_config('lock') + if self.pyload.config.get("general", "folder_per_package"): download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pyfile.package().folder) else: @@ -132,10 +137,13 @@ class ExternalScripts(Addon): for script in self.scripts['download_failed']: file = fs_join(download_folder, pyfile.name) - self.call_script(script, pyfile.id, pyfile.name, file, pyfile.pluginname, pyfile.url) + args = [script, pyfile.id, pyfile.name, file, pyfile.pluginname, pyfile.url] + self.call(script, args, lock) def download_finished(self, pyfile): + lock = self.get_config('lock') + if self.pyload.config.get("general", "folder_per_package"): download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pyfile.package().folder) else: @@ -143,30 +151,39 @@ class ExternalScripts(Addon): for script in self.scripts['download_finished']: file = fs_join(download_folder, pyfile.name) - self.call_script(script, pyfile.id, pyfile.name, file, pyfile.pluginname, pyfile.url) + args = [pyfile.id, pyfile.name, file, pyfile.pluginname, pyfile.url] + self.call(script, args, lock) def archive_extract_failed(self, pyfile, archive): + lock = self.get_config('lock') for script in self.scripts['archive_extract_failed']: - self.call_script(script, pyfile.id, pyfile.name, archive.filename, archive.out, archive.files) + args = [pyfile.id, pyfile.name, archive.filename, archive.out, archive.files] + self.call(script, args, lock) def archive_extracted(self, pyfile, archive): + lock = self.get_config('lock') for script in self.scripts['archive_extracted']: - self.call_script(script, pyfile.id, pyfile.name, archive.filename, archive.out, archive.files) + args = [script, pyfile.id, pyfile.name, archive.filename, archive.out, archive.files] + self.call(script, args, lock) def package_finished(self, pypack): + lock = self.get_config('lock') + if self.pyload.config.get("general", "folder_per_package"): download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder) else: download_folder = self.pyload.config.get("general", "download_folder") for script in self.scripts['package_finished']: - self.call_script(script, pypack.id, pypack.name, download_folder, pypack.password) + args = [pypack.id, pypack.name, download_folder, pypack.password] + self.call(script, args, lock) def package_deleted(self, pid): + lock = self.get_config('lock') pack = self.pyload.api.getPackageInfo(pid) if self.pyload.config.get("general", "folder_per_package"): @@ -175,44 +192,55 @@ class ExternalScripts(Addon): download_folder = self.pyload.config.get("general", "download_folder") for script in self.scripts['package_deleted']: - self.call_script(script, pack.id, pack.name, download_folder, pack.password) + args = [pack.id, pack.name, download_folder, pack.password] + self.call(script, args, lock) def package_extract_failed(self, pypack): + lock = self.get_config('lock') + if self.pyload.config.get("general", "folder_per_package"): download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder) else: download_folder = self.pyload.config.get("general", "download_folder") for script in self.scripts['package_extract_failed']: - self.call_script(script, pypack.id, pypack.name, download_folder, pypack.password) + args = [pypack.id, pypack.name, download_folder, pypack.password] + self.call(script, args, lock) def package_extracted(self, pypack): + lock = self.get_config('lock') + if self.pyload.config.get("general", "folder_per_package"): download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder) else: download_folder = self.pyload.config.get("general", "download_folder") for script in self.scripts['package_extracted']: - self.call_script(script, pypack.id, pypack.name, download_folder) + args = [pypack.id, pypack.name, download_folder] + self.call(script, args, lock) def all_downloads_finished(self): + lock = self.get_config('lock') for script in self.scripts['all_downloads_finished']: - self.call_script(script) + self.call(script, lock=lock) def all_downloads_processed(self): + lock = self.get_config('lock') for script in self.scripts['all_downloads_processed']: - self.call_script(script) + self.call(script, lock=lock) def all_archives_extracted(self): + lock = self.get_config('lock') for script in self.scripts['all_archives_extracted']: - self.call_script(script) + self.call(script, lock=lock) def all_archives_processed(self): + lock = self.get_config('lock') for script in self.scripts['all_archives_processed']: - self.call_script(script) + self.call(script, lock=lock) -- cgit v1.2.3 From 5ced8cccb300b8971cec4326016df79670c4e7ad Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 12:32:28 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1595 --- module/plugins/hooks/AntiStandby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index b0262ed33..5c54b8c96 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -26,7 +26,7 @@ class Kernel32(object): class AntiStandby(Addon): __name__ = "AntiStandby" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -44,7 +44,7 @@ class AntiStandby(Addon): MIN_INTERVAL = 5 - def setup(self): + def init(self): self.mtime = 0 -- cgit v1.2.3 From 07ada1c7e1e7abb22a8889382c1f898ed7a3274c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 13:00:20 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1597 --- module/plugins/hooks/ExternalScripts.py | 37 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 8495e2be2..b7495136a 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -10,7 +10,7 @@ from module.utils import fs_encode, save_join as fs_join class ExternalScripts(Addon): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.45" + __version__ = "0.46" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -44,37 +44,37 @@ class ExternalScripts(Addon): "all_archives_extracted", "all_archives_processed"] for folder in folders: - self.scripts[folder] = [] - for dir in (pypath, ''): - self.init_plugin_type(folder, os.path.join(dir, 'scripts', folder)) + path = os.path.join("scripts", folder) + self.init_folder(folder, path) - for script_type, names in self.scripts.items(): - if names: - self.log_info(_("Installed scripts for: ") + script_type, ", ".join(map(os.path.basename, names))) + for folder, scripts in self.scripts.items(): + if scripts: + self.log_info(_("Installed scripts in folder `%s`: %s") + % (folder, ", ".join(scripts))) self.pyload_start() - def init_plugin_type(self, name, dir): - if not os.path.isdir(dir): + def init_folder(self, name, path): + self.scripts[name] = [] + + if not os.path.isdir(path): try: - os.makedirs(dir) + os.makedirs(path) except OSError, e: self.log_debug(e) return - for filename in os.listdir(dir): - file = fs_join(dir, filename) - + for file in os.listdir(path): if not os.path.isfile(file): continue - if filename[0] in ("#", "_") or filename.endswith("~") or filename.endswith(".swp"): + if file[0] in ("#", "_") or file.endswith("~") or file.endswith(".swp"): continue if not os.access(file, os.X_OK): - self.log_warning(_("Script not executable: %s/%s" % (name, filename)) + self.log_warning(_("Script not executable: [%s] %s") % (name, file)) self.scripts[name].append(file) @@ -82,15 +82,16 @@ class ExternalScripts(Addon): @Expose def call(self, script, args=[], lock=False): try: - args = [script] + map(encode, args) - self.log_info(_("EXECUTE [%s] %s") % (os.path.dirname(script), args)) + script = os.path.abspath(script) + args = [script] + map(encode, args) + self.log_info(_("EXECUTE [%s] %s") % (os.path.dirname(script), args)) p = subprocess.Popen(args, bufsize=-1) #@NOTE: output goes to pyload if lock: p.communicate() except Exception, e: - self.log_error(_("Runtime error: %s") % os.path.abspath(script), e or _("Unknown error")) + self.log_error(_("Runtime error: %s") % script, e or _("Unknown error")) def pyload_start(self): -- cgit v1.2.3 From 6a38ae35495d39f5c2649434810a9d507abcbf20 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 13:05:30 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1594 (2) --- module/plugins/hooks/ExtractArchive.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 98dea58ca..62139ccc5 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -112,7 +112,7 @@ class ArchiveQueue(object): class ExtractArchive(Addon): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.48" + __version__ = "1.49" __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , True ), @@ -353,7 +353,7 @@ class ExtractArchive(Addon): #: Remove processed file and related multiparts from list files_ids = [(fname, fid, fout) for fname, fid, fout in files_ids \ - if fname not in archive.getDeleteFiles()] + if fname not in archive.get_delete_files()] self.log_debug("Extracted files: %s" % new_files) self.set_permissions(new_files) @@ -470,7 +470,7 @@ class ExtractArchive(Addon): pyfile.setProgress(100) pyfile.setStatus("processing") - delfiles = archive.getDeleteFiles() + delfiles = archive.get_delete_files() self.log_debug("Would delete: " + ", ".join(delfiles)) if self.get_config('delete'): -- cgit v1.2.3 From c7e2c7771fe6acd64f5ef461bf121fa77ad0c931 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 13:23:52 +0200 Subject: New plugins: AniStreamCom and CloudsixMe --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index eed1c01de..7567a31a3 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.41" + __version__ = "0.42" __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), @@ -29,7 +29,7 @@ class XFileSharingPro(Hook): r'https?://(?:[^/]+\.)?(?P%s)/(?:user|folder)s?/\w+')} HOSTER_BUILTIN = [#WORKING HOSTERS: - "ani-stream.com", "backin.net", "eyesfile.ca", "file4safe.com", + "ani-stream.com", "backin.net", "cloudsix.me", "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "fileparadox.in", "filevice.com", "hostingbulk.com", "junkyvideo.com", "linestorage.com", "ravishare.com", "ryushare.com", "salefiles.com", "sendmyway.com", "sharebeast.com", -- cgit v1.2.3 From 2e5ad6d1cc7b352975df79a0885413ad157f0ba0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 18:49:49 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1600 --- module/plugins/hooks/AntiStandby.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index 5c54b8c96..3667e378a 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -26,7 +26,7 @@ class Kernel32(object): class AntiStandby(Addon): __name__ = "AntiStandby" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -45,6 +45,7 @@ class AntiStandby(Addon): def init(self): + self.pid = None self.mtime = 0 @@ -121,6 +122,13 @@ class AntiStandby(Addon): @Expose def linux_standby(self, system=True, display=True): try: + if system: + if self.pid: + self.pid.kill() + + elif not self.pid: + self.pid = subprocess.Popen(["caffeine"]) + if display: subprocess.call(["xset", "+dpms", "s", "default"]) else: @@ -140,18 +148,23 @@ class AntiStandby(Addon): @Expose def max_mtime(self, path): - return max(os.path.getmtime(os.path.join(root, file)) - for root, dirs, files in os.walk(path, topdown=False) - for file in files) + return max(0, 0, + *(os.path.getmtime(os.path.join(root, file)) + for root, dirs, files in os.walk(path, topdown=False) + for file in files)) def periodical(self): if self.get_config('hdd') is False: return - if os.name != "nt": - path = self.pyload.config.get("general", "download_folder") - if (self.max_mtime(path) - self.mtime) < self.interval: - return + if (self.pyfile.threadManager.pause or + not self.pyfile.api.isTimeDownload() or + not self.pyfile.threadManager.getActiveFiles()): + return + + path = self.pyload.config.get("general", "download_folder") + if (self.max_mtime(path) - self.mtime) < self.interval: + return self.touch(self.TMP_FILE) -- cgit v1.2.3 From 1142e6c4f2acef87dce9d87d6053f9679636953a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 29 Jul 2015 21:06:01 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1600 (2) --- module/plugins/hooks/AntiStandby.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index 3667e378a..93eca09cc 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -26,7 +26,7 @@ class Kernel32(object): class AntiStandby(Addon): __name__ = "AntiStandby" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -158,9 +158,9 @@ class AntiStandby(Addon): if self.get_config('hdd') is False: return - if (self.pyfile.threadManager.pause or - not self.pyfile.api.isTimeDownload() or - not self.pyfile.threadManager.getActiveFiles()): + if (self.pyload.threadManager.pause or + not self.pyload.api.isTimeDownload() or + not self.pyload.threadManager.getActiveFiles()): return path = self.pyload.config.get("general", "download_folder") -- cgit v1.2.3 From 88f98ab3bd6e091c1b6ca6ac9fddc37b2e29694c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 30 Jul 2015 14:37:44 +0200 Subject: Fix get_code call in captcha hooks --- module/plugins/hooks/BypassCaptcha.py | 2 +- module/plugins/hooks/CaptchaBrotherhood.py | 2 +- module/plugins/hooks/DeathByCaptcha.py | 2 +- module/plugins/hooks/ImageTyperz.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index a89d1c23f..4b155a67e 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -129,7 +129,7 @@ class BypassCaptcha(Hook): try: ticket, result = self.submit(c) except BypassCaptchaException, e: - task.error = e.getCode() + task.error = e.get_code() return task.data['ticket'] = ticket diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 42a9a26d9..0df1ab8a9 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -161,7 +161,7 @@ class CaptchaBrotherhood(Hook): try: ticket, result = self.submit(c) except CaptchaBrotherhoodException, e: - task.error = e.getCode() + task.error = e.get_code() return task.data['ticket'] = ticket diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index c27db422b..98572191e 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -209,7 +209,7 @@ class DeathByCaptcha(Hook): try: ticket, result = self.submit(c) except DeathByCaptchaException, e: - task.error = e.getCode() + task.error = e.get_code() self.log_error(e.getDesc()) return diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index d453122d0..42ab99027 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -148,7 +148,7 @@ class ImageTyperz(Hook): try: ticket, result = self.submit(c) except ImageTyperzException, e: - task.error = e.getCode() + task.error = e.get_code() return task.data['ticket'] = ticket -- cgit v1.2.3 From 3b6e1b55a0ab527af98c901cf2d855359500b14e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 30 Jul 2015 14:52:01 +0200 Subject: [AntiStandby] Fix max_mtime method --- module/plugins/hooks/AntiStandby.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index 93eca09cc..ba462e002 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -13,6 +13,7 @@ except ImportError: pass from module.plugins.internal.Addon import Addon, Expose +from module.utils import fs_join class Kernel32(object): @@ -26,7 +27,7 @@ class Kernel32(object): class AntiStandby(Addon): __name__ = "AntiStandby" __type__ = "hook" - __version__ = "0.06" + __version__ = "0.07" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -149,7 +150,7 @@ class AntiStandby(Addon): @Expose def max_mtime(self, path): return max(0, 0, - *(os.path.getmtime(os.path.join(root, file)) + *(os.path.getmtime(fs_join(root, file)) for root, dirs, files in os.walk(path, topdown=False) for file in files)) -- cgit v1.2.3 From bd9c692ab57f906383f264850bce95ff310fd61f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 30 Jul 2015 16:00:19 +0200 Subject: [AntiStandby] Fix import typo --- module/plugins/hooks/AntiStandby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index ba462e002..e669ae4f3 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -13,7 +13,7 @@ except ImportError: pass from module.plugins.internal.Addon import Addon, Expose -from module.utils import fs_join +from module.utils import save_join as fs_join class Kernel32(object): @@ -27,7 +27,7 @@ class Kernel32(object): class AntiStandby(Addon): __name__ = "AntiStandby" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.08" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), -- cgit v1.2.3 From 092112b44af84c7a59b1fa2cfff5c5875e778a8f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 31 Jul 2015 02:21:35 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1625 --- module/plugins/hooks/ExtractArchive.py | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 62139ccc5..a71ec0e98 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -355,7 +355,9 @@ class ExtractArchive(Addon): files_ids = [(fname, fid, fout) for fname, fid, fout in files_ids \ if fname not in archive.get_delete_files()] self.log_debug("Extracted files: %s" % new_files) - self.set_permissions(new_files) + + for file in new_files: + self.set_permissions(file) for filename in new_files: file = fs_encode(fs_join(os.path.dirname(archive.filename), filename)) @@ -584,25 +586,3 @@ class ExtractArchive(Addon): except IOError, e: self.log_error(e) - - - def set_permissions(self, files): - for f in files: - if not os.path.exists(f): - continue - - try: - if self.pyload.config.get("permission", "change_file"): - if os.path.isfile(f): - os.chmod(f, int(self.pyload.config.get("permission", "file"), 8)) - - elif os.path.isdir(f): - os.chmod(f, int(self.pyload.config.get("permission", "folder"), 8)) - - if self.pyload.config.get("permission", "change_dl") and os.name != "nt": - uid = getpwnam(self.pyload.config.get("permission", "user"))[2] - gid = getgrnam(self.pyload.config.get("permission", "group"))[2] - os.chown(f, uid, gid) - - except Exception, e: - self.log_warning(_("Setting User and Group failed"), e) -- cgit v1.2.3 From e3799bcb0731e8cdf4d3f86ae6ee67e9cc5e4d80 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 31 Jul 2015 06:35:21 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1601 --- module/plugins/hooks/Captcha9Kw.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index e9edbe7f9..10d29e2c6 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -110,9 +110,9 @@ class Captcha9Kw(Hook): 'numeric' : option['numeric'], 'math' : option['math'], 'oldsource' : pluginname, - 'pyload' : "1", + 'pyload' : 1, 'source' : "pyload", - 'base64' : "1", + 'base64' : 1, 'mouse' : 1 if task.isPositional() else 0, 'file-upload-01': b64encode(data), 'action' : "usercaptchaupload"} @@ -120,11 +120,14 @@ class Captcha9Kw(Hook): for _i in xrange(5): try: res = self.load(self.API_URL, post=post_data) + except BadHeader, e: time.sleep(3) + else: if res and res.isdigit(): break + else: self.log_error(_("Bad upload: %s") % res) return -- cgit v1.2.3 From 8a8323f3fd86985a5ca876e8d54f1699e75b24a8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 31 Jul 2015 07:37:10 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1628 --- module/plugins/hooks/ExtractArchive.py | 5 ----- 1 file changed, 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index a71ec0e98..eab196160 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -50,11 +50,6 @@ try: except ImportError: pass -from copy import copy -if os.name != "nt": - from grp import getgrnam - from pwd import getpwnam - from module.plugins.internal.Addon import Addon, Expose, threaded from module.plugins.internal.Plugin import replace_patterns from module.plugins.internal.Extractor import ArchiveError, CRCError, PasswordError -- cgit v1.2.3 From 53784948a3ae27ed69463eea2d7babb979460e1e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 07:12:26 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1646 --- module/plugins/hooks/PremiumizeMeHook.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/PremiumizeMeHook.py b/module/plugins/hooks/PremiumizeMeHook.py index 6be32b70b..9a9a380af 100644 --- a/module/plugins/hooks/PremiumizeMeHook.py +++ b/module/plugins/hooks/PremiumizeMeHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class PremiumizeMeHook(MultiHook): __name__ = "PremiumizeMeHook" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), @@ -22,12 +22,14 @@ class PremiumizeMeHook(MultiHook): def get_hosters(self): #: Get account data - user, data = self.account.select() + user, info = self.account.select() #: Get supported hosters list from premiumize.me using the #: json API v1 (see https://secure.premiumize.me/?show=api) answer = self.load("http://api.premiumize.me/pm-api/v1.php", #@TODO: Revert to `https` in 0.4.10 - get={'method': "hosterlist", 'params[login]': user, 'params[pass]': data['password']}) + get={'method' : "hosterlist", + 'params[login]': user, + 'params[pass]' : info['login']['password']}) data = json_loads(answer) #: If account is not valid thera are no hosters available -- cgit v1.2.3 From 21cf50c60a794b5ca7d54408b590f74d4567ca79 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 07:15:28 +0200 Subject: Update some plugins --- module/plugins/hooks/FreeWayMeHook.py | 9 ++++++--- module/plugins/hooks/PremiumToHook.py | 7 ++++--- module/plugins/hooks/RPNetBizHook.py | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/FreeWayMeHook.py b/module/plugins/hooks/FreeWayMeHook.py index 5f30d70fc..1380433bf 100644 --- a/module/plugins/hooks/FreeWayMeHook.py +++ b/module/plugins/hooks/FreeWayMeHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class FreeWayMeHook(MultiHook): __name__ = "FreeWayMeHook" __type__ = "hook" - __version__ = "0.17" + __version__ = "0.18" __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), @@ -20,6 +20,9 @@ class FreeWayMeHook(MultiHook): def get_hosters(self): - user, data = self.account.select() - hostis = self.load("http://www.free-way.bz/ajax/jd.php", get={'id': 3, 'user': user, 'pass': data['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10 + user, info = self.account.select() + hostis = self.load("http://www.free-way.bz/ajax/jd.php", + get={'id' : 3, + 'user': user, + 'pass': info['login']['password']}).replace("\"", "") #@TODO: Revert to `https` in 0.4.10 return [x.strip() for x in hostis.split(",") if x.strip()] diff --git a/module/plugins/hooks/PremiumToHook.py b/module/plugins/hooks/PremiumToHook.py index 062113e96..bcd7a7aab 100644 --- a/module/plugins/hooks/PremiumToHook.py +++ b/module/plugins/hooks/PremiumToHook.py @@ -6,7 +6,7 @@ from module.plugins.internal.MultiHook import MultiHook class PremiumToHook(MultiHook): __name__ = "PremiumToHook" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.11" __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), @@ -22,7 +22,8 @@ class PremiumToHook(MultiHook): def get_hosters(self): - user, data = self.account.select() + user, info = self.account.select() html = self.load("http://premium.to/api/hosters.php", - get={'username': user, 'password': data['password']}) + get={'username': user, + 'password': info['login']['password']}) return [x.strip() for x in html.replace("\"", "").split(";")] diff --git a/module/plugins/hooks/RPNetBizHook.py b/module/plugins/hooks/RPNetBizHook.py index 5e7174de6..5d26b7f09 100644 --- a/module/plugins/hooks/RPNetBizHook.py +++ b/module/plugins/hooks/RPNetBizHook.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class RPNetBizHook(MultiHook): __name__ = "RPNetBizHook" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __status__ = "testing" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), @@ -22,10 +22,12 @@ class RPNetBizHook(MultiHook): def get_hosters(self): #: Get account data - user, data = self.account.select() + user, info = self.account.select() res = self.load("https://premium.rpnet.biz/client_api.php", - get={'username': user, 'password': data['password'], 'action': "showHosterList"}) + get={'username': user, + 'password': info['login']['password'], + 'action' : "showHosterList"}) hoster_list = json_loads(res) #: If account is not valid thera are no hosters available -- cgit v1.2.3 From 1c6457a71d11759ea8c62feac94d47d3becfc062 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 07:16:01 +0200 Subject: [AntiStandby] Improve linux_standby --- module/plugins/hooks/AntiStandby.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index e669ae4f3..4b35c787a 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -27,7 +27,7 @@ class Kernel32(object): class AntiStandby(Addon): __name__ = "AntiStandby" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -130,13 +130,17 @@ class AntiStandby(Addon): elif not self.pid: self.pid = subprocess.Popen(["caffeine"]) + except Exception, e: + self.log_warning(_("Unable to change system power state"), e) + + try: if display: subprocess.call(["xset", "+dpms", "s", "default"]) else: subprocess.call(["xset", "-dpms", "s", "off"]) except Exception, e: - self.log_warning(_("Unable to change power state"), e) + self.log_warning(_("Unable to change display power state"), e) @Expose -- cgit v1.2.3 From 84f2193d76f7c6f47c834dc8902d8ead8e45a11a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 07:44:07 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1640 (2) --- module/plugins/hooks/EasybytezComHook.py | 2 +- module/plugins/hooks/RehostToHook.py | 2 +- module/plugins/hooks/SmoozedComHook.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/EasybytezComHook.py b/module/plugins/hooks/EasybytezComHook.py index 9e33bbad0..6f53619ac 100644 --- a/module/plugins/hooks/EasybytezComHook.py +++ b/module/plugins/hooks/EasybytezComHook.py @@ -22,7 +22,7 @@ class EasybytezComHook(MultiHook): def get_hosters(self): - user, data = self.account.select() + user, info = self.account.select() html = self.load("http://www.easybytez.com", req=self.account.get_request(user)) diff --git a/module/plugins/hooks/RehostToHook.py b/module/plugins/hooks/RehostToHook.py index 58367e241..7bb27e820 100644 --- a/module/plugins/hooks/RehostToHook.py +++ b/module/plugins/hooks/RehostToHook.py @@ -20,7 +20,7 @@ class RehostToHook(MultiHook): def get_hosters(self): - user, data = self.account.select() + user, info = self.account.select() html = self.load("http://rehost.to/api.php", get={'cmd' : "get_supported_och_dl", 'long_ses': self.account.get_data(user)['session']}) diff --git a/module/plugins/hooks/SmoozedComHook.py b/module/plugins/hooks/SmoozedComHook.py index 6b9b688ff..b9825b223 100644 --- a/module/plugins/hooks/SmoozedComHook.py +++ b/module/plugins/hooks/SmoozedComHook.py @@ -20,5 +20,5 @@ class SmoozedComHook(MultiHook): def get_hosters(self): - user, data = self.account.select() + user, info = self.account.select() return self.account.get_data(user)['hosters'] -- cgit v1.2.3 From 04f4b7aa724454a69588ecc9fa46f7dd6e65c747 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 09:16:39 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1630 --- module/plugins/hooks/Captcha9Kw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 10d29e2c6..2e2685978 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -63,7 +63,7 @@ class Captcha9Kw(Hook): self.log_error(e) return - pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) + pluginname = re.search(r'_(.+?)_\d+.\w+', task.captchaFile).group(1) option = {'min' : 2, 'max' : 50, 'phrase' : 0, @@ -176,7 +176,7 @@ class Captcha9Kw(Hook): queue = min(self.get_config('queue'), 999) timeout = min(max(self.get_config('timeout'), 300), 3999) - pluginname = re.search(r'_([^_]*)_\d+.\w+', task.captchaFile).group(1) + pluginname = re.search(r'_(.+?)_\d+.\w+', task.captchaFile).group(1) for _i in xrange(5): servercheck = self.load("http://www.9kw.eu/grafik/servercheck.txt") -- cgit v1.2.3 From 1fbaa17324b8f16dcaf0eb78f2a8aa017ec57881 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 10:34:44 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1651 --- module/plugins/hooks/AntiStandby.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index 4b35c787a..699ecbbde 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -13,7 +13,7 @@ except ImportError: pass from module.plugins.internal.Addon import Addon, Expose -from module.utils import save_join as fs_join +from module.utils import save_join as fs_encode, fs_join class Kernel32(object): @@ -27,7 +27,7 @@ class Kernel32(object): class AntiStandby(Addon): __name__ = "AntiStandby" __type__ = "hook" - __version__ = "0.09" + __version__ = "0.10" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -155,7 +155,7 @@ class AntiStandby(Addon): def max_mtime(self, path): return max(0, 0, *(os.path.getmtime(fs_join(root, file)) - for root, dirs, files in os.walk(path, topdown=False) + for root, dirs, files in os.walk(fs_encode(path), topdown=False) for file in files)) @@ -168,8 +168,8 @@ class AntiStandby(Addon): not self.pyload.threadManager.getActiveFiles()): return - path = self.pyload.config.get("general", "download_folder") - if (self.max_mtime(path) - self.mtime) < self.interval: + download_folder = self.pyload.config.get("general", "download_folder") + if (self.max_mtime(download_folder) - self.mtime) < self.interval: return self.touch(self.TMP_FILE) -- cgit v1.2.3 From 9cb6b5d05ddcc15148bd5fab0fe02978159cfef5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Aug 2015 17:23:46 +0200 Subject: Tiny fixes --- module/plugins/hooks/AntiVirus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index b6fd0ca2d..b58d0b61d 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -63,7 +63,7 @@ class AntiVirus(Addon): return if p.returncode: - pyfile.error = _("infected file") + pyfile.error = _("Infected file") action = self.get_config('action') try: if action == "Delete": -- cgit v1.2.3 From 0fbe60c3c0941f3c68ab688b1a9610115ee66133 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Mon, 3 Aug 2015 01:15:27 +0300 Subject: fix import error --- module/plugins/hooks/AntiStandby.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index 699ecbbde..2d7a165a6 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -13,7 +13,7 @@ except ImportError: pass from module.plugins.internal.Addon import Addon, Expose -from module.utils import save_join as fs_encode, fs_join +from module.utils import save_join as fs_join, fs_encode class Kernel32(object): @@ -27,7 +27,7 @@ class Kernel32(object): class AntiStandby(Addon): __name__ = "AntiStandby" __type__ = "hook" - __version__ = "0.10" + __version__ = "0.11" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), -- cgit v1.2.3 From 2cf928db10224b5327f918dceaa13273753620ac Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 4 Aug 2015 18:06:42 +0200 Subject: Some fixes --- module/plugins/hooks/AntiStandby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index 2d7a165a6..48b86fa55 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -13,7 +13,7 @@ except ImportError: pass from module.plugins.internal.Addon import Addon, Expose -from module.utils import save_join as fs_join, fs_encode +from module.utils import fs_encode, save_join as fs_join class Kernel32(object): -- cgit v1.2.3