From 575ce629081995766a231f0a9f3e97e3b79d23b1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 21:20:59 +0100 Subject: Update MultiHook based hooks --- module/plugins/hooks/RPNetBiz.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'module/plugins/hooks/RPNetBiz.py') diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index c54f7d445..5af355fcc 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -1,18 +1,17 @@ # -*- coding: utf-8 -*- from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL from module.plugins.internal.MultiHook import MultiHook class RPNetBiz(MultiHook): __name__ = "RPNetBiz" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" - __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("hosterList", "str", "Hoster list (comma separated)", ""), - ("unloadFailing", "bool", "Revert to stanard download if download fails", False), + __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), + ("pluginlist", "str", "Hoster list (comma separated)", ""), + ("revertfailed", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """RPNet.biz hook plugin""" @@ -20,7 +19,7 @@ class RPNetBiz(MultiHook): __authors__ = [("Dman", "dmanugm@gmail.com")] - def getHoster(self): + def getHosters(self): # No hosts supported if no account if not self.account or not self.account.canUse(): return [] @@ -28,7 +27,7 @@ class RPNetBiz(MultiHook): # Get account data (user, data) = self.account.selectAccount() - res = getURL("https://premium.rpnet.biz/client_api.php", + res = self.getURL("https://premium.rpnet.biz/client_api.php", get={'username': user, 'password': data['password'], 'action': "showHosterList"}) hoster_list = json_loads(res) -- cgit v1.2.3 From 08f9ab64b9e2f2b7f4c41cc1629a96af7febb740 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 31 Dec 2014 02:33:33 +0100 Subject: Tiny code cosmetics --- module/plugins/hooks/RPNetBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/RPNetBiz.py') diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 5af355fcc..bbbe8e128 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -11,7 +11,7 @@ class RPNetBiz(MultiHook): __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to stanard download if download fails", False), + ("revertfailed", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] __description__ = """RPNet.biz hook plugin""" -- cgit v1.2.3 From 7979d0833573a107baae8c45330b8b5874630a76 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 4 Jan 2015 20:26:13 +0100 Subject: Spare code improvements --- module/plugins/hooks/RPNetBiz.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'module/plugins/hooks/RPNetBiz.py') diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index bbbe8e128..9c88e6c01 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -7,7 +7,7 @@ from module.plugins.internal.MultiHook import MultiHook class RPNetBiz(MultiHook): __name__ = "RPNetBiz" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("pluginlist", "str", "Hoster list (comma separated)", ""), @@ -20,12 +20,8 @@ class RPNetBiz(MultiHook): def getHosters(self): - # No hosts supported if no account - if not self.account or not self.account.canUse(): - return [] - # Get account data - (user, data) = self.account.selectAccount() + user, data = self.account.selectAccount() res = self.getURL("https://premium.rpnet.biz/client_api.php", get={'username': user, 'password': data['password'], 'action': "showHosterList"}) @@ -37,15 +33,3 @@ class RPNetBiz(MultiHook): # Extract hosters from json file return hoster_list['hosters'] - - - def coreReady(self): - # Get account plugin and check if there is a valid account available - self.account = self.core.accountManager.getAccountPlugin("RPNetBiz") - if not self.account.canUse(): - self.account = None - self.logError(_("Please enter your %s account or deactivate this plugin") % "rpnet") - return - - # Run the overwriten core ready which actually enables the multihoster hook - return MultiHook.coreReady(self) -- cgit v1.2.3 From e977be3c78ea9d976e9b2338244b214a4b3a5199 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 8 Jan 2015 23:40:17 +0100 Subject: "New Year" Update: hook plugins --- module/plugins/hooks/RPNetBiz.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks/RPNetBiz.py') diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 9c88e6c01..0768bd6cd 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -7,12 +7,15 @@ from module.plugins.internal.MultiHook import MultiHook class RPNetBiz(MultiHook): __name__ = "RPNetBiz" __type__ = "hook" - __version__ = "0.13" - - __config__ = [("mode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("pluginlist", "str", "Hoster list (comma separated)", ""), - ("revertfailed", "bool", "Revert to standard download if download fails", False), - ("interval", "int", "Reload interval in hours (0 to disable)", 24)] + __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 ), + ("retry" , "int" , "Number of retries before revert" , 10 ), + ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), + ("reload" , "bool" , "Reload plugin list" , True ), + ("reloadinterval", "int" , "Reload interval in hours" , 12 )] __description__ = """RPNet.biz hook plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 6db62380b80a144aca18335d50c724e9915d8038 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 18 Mar 2015 22:20:17 +0100 Subject: Hooks cleanup --- module/plugins/hooks/RPNetBiz.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hooks/RPNetBiz.py') diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index 0768bd6cd..a24697265 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -12,8 +12,6 @@ class RPNetBiz(MultiHook): __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("retry" , "int" , "Number of retries before revert" , 10 ), - ("retryinterval" , "int" , "Retry interval in minutes" , 1 ), ("reload" , "bool" , "Reload plugin list" , True ), ("reloadinterval", "int" , "Reload interval in hours" , 12 )] -- cgit v1.2.3 From 348a386486d081d86363774e64525484ef159cd6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Apr 2015 19:23:06 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1157 --- module/plugins/hooks/RPNetBiz.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 module/plugins/hooks/RPNetBiz.py (limited to 'module/plugins/hooks/RPNetBiz.py') diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py deleted file mode 100644 index a24697265..000000000 --- a/module/plugins/hooks/RPNetBiz.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.common.json_layer import json_loads -from module.plugins.internal.MultiHook import MultiHook - - -class RPNetBiz(MultiHook): - __name__ = "RPNetBiz" - __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 )] - - __description__ = """RPNet.biz hook plugin""" - __license__ = "GPLv3" - __authors__ = [("Dman", "dmanugm@gmail.com")] - - - def getHosters(self): - # Get account data - user, data = self.account.selectAccount() - - res = self.getURL("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 'error' in hoster_list: - return [] - - # Extract hosters from json file - return hoster_list['hosters'] -- cgit v1.2.3