From 97d25752691aa561c29a91166fdd30302bef2db2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 00:54:03 +0200 Subject: [Account] parse_info -> grab_info --- module/plugins/accounts/RehostTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/RehostTo.py') diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 36e5e33eb..2c2c7a712 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -14,7 +14,7 @@ class RehostTo(Account): __authors__ = [("RaNaN", "RaNaN@pyload.org")] - def parse_info(self, user, password, data, req): + def grab_info(self, user, password, data, req): premium = False trafficleft = None validuntil = -1 @@ -55,4 +55,4 @@ class RehostTo(Account): if "ERROR" in html: self.log_debug(html) - self.login_fail() + self.fail_login() -- cgit v1.2.3 From fb45ec44220201268f99b747831df717fa7a83f8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 21 Sep 2015 16:31:48 +0200 Subject: [Account] Fix __version__ --- module/plugins/accounts/RehostTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/RehostTo.py') diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 2c2c7a712..50b64bff8 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -6,7 +6,7 @@ from module.plugins.internal.Account import Account class RehostTo(Account): __name__ = "RehostTo" __type__ = "account" - __version__ = "0.18" + __version__ = "0.19" __status__ = "testing" __description__ = """Rehost.to account plugin""" -- cgit v1.2.3 From ec6e5dc7fcdcefee10e37d22473c9accae1104cf Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 29 Sep 2015 20:05:07 +0200 Subject: Account class completely rewritten + plugins updated --- module/plugins/accounts/RehostTo.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts/RehostTo.py') diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 50b64bff8..9406f22af 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -6,7 +6,7 @@ from module.plugins.internal.Account import Account class RehostTo(Account): __name__ = "RehostTo" __type__ = "account" - __version__ = "0.19" + __version__ = "0.20" __status__ = "testing" __description__ = """Rehost.to account plugin""" @@ -14,7 +14,14 @@ class RehostTo(Account): __authors__ = [("RaNaN", "RaNaN@pyload.org")] - def grab_info(self, user, password, data, req): + def grab_hosters(self, user, password, data): + html = self.load("http://rehost.to/api.php", + get={'cmd' : "get_supported_och_dl", + 'long_ses': data['session']}) + return [x.strip() for x in html.replace("\"", "").split(",")] + + + def grab_info(self, user, password, data): premium = False trafficleft = None validuntil = -1 @@ -47,7 +54,7 @@ class RehostTo(Account): 'session' : session} - def login(self, user, password, data, req): + def signin(self, user, password, data): html = self.load("https://rehost.to/api.php", get={'cmd': "login", 'user': user, -- cgit v1.2.3 From 3b3a4bd889286777ba6a590a1f74cf3edae36a72 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 30 Sep 2015 00:30:53 +0200 Subject: Add __config__ to MultiAccount (and XFSAccount) based plugins --- module/plugins/accounts/RehostTo.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'module/plugins/accounts/RehostTo.py') diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 9406f22af..a9f2746c2 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -9,6 +9,10 @@ class RehostTo(Account): __version__ = "0.20" __status__ = "testing" + __config__ = [("mh_mode" , "all;listed;unlisted", "Filter hosters to use" , "all"), + ("mh_list" , "str" , "Hoster list (comma separated)", "" ), + ("mh_interval", "int" , "Reload interval in minutes" , 60 )] + __description__ = """Rehost.to account plugin""" __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org")] -- cgit v1.2.3 From 25d5726d4953b93a2e286fd6af8d4ead20670ba6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 1 Oct 2015 04:55:17 +0200 Subject: A lot of plugin code cosmetics --- module/plugins/accounts/RehostTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/accounts/RehostTo.py') diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index a9f2746c2..2ad4cdceb 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -22,7 +22,7 @@ class RehostTo(Account): html = self.load("http://rehost.to/api.php", get={'cmd' : "get_supported_och_dl", 'long_ses': data['session']}) - return [x.strip() for x in html.replace("\"", "").split(",")] + return [x for x in map(str.strip, html.replace("\"", "").split(",")) if x] def grab_info(self, user, password, data): -- cgit v1.2.3 From ab695d17397e101447102877cdd282d825051035 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 2 Oct 2015 04:22:19 +0200 Subject: [Account] Improve parse_traffic method + code cosmetics --- module/plugins/accounts/RehostTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/accounts/RehostTo.py') diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 2ad4cdceb..4ff3f15a8 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -6,7 +6,7 @@ from module.plugins.internal.Account import Account class RehostTo(Account): __name__ = "RehostTo" __type__ = "account" - __version__ = "0.20" + __version__ = "0.21" __status__ = "testing" __config__ = [("mh_mode" , "all;listed;unlisted", "Filter hosters to use" , "all"), @@ -48,7 +48,7 @@ class RehostTo(Account): traffic, valid = html.split(",") premium = True - trafficleft = self.parse_traffic(traffic + "MB") + trafficleft = self.parse_traffic(traffic, "MB") validuntil = float(valid) finally: -- cgit v1.2.3