diff options
Diffstat (limited to 'module/plugins/hooks/ReloadCc.py')
-rw-r--r-- | module/plugins/hooks/ReloadCc.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/module/plugins/hooks/ReloadCc.py b/module/plugins/hooks/ReloadCc.py index 1d4adfbe3..e563e81ba 100644 --- a/module/plugins/hooks/ReloadCc.py +++ b/module/plugins/hooks/ReloadCc.py @@ -5,7 +5,7 @@ from module.network.RequestFactory import getURL class ReloadCc(MultiHoster): __name__ = "ReloadCc" - __version__ = "0.1" + __version__ = "0.2" __type__ = "hook" __description__ = """Reload.cc hook plugin""" @@ -16,7 +16,7 @@ class ReloadCc(MultiHoster): __author_name__ = ("Reload Team") __author_mail__ = ("hello@reload.cc") - interval = 0 # Disable periodic calls, we dont use them anyway + interval = 0 # Disable periodic calls def getHoster(self): # If no accounts are available there will be no hosters available @@ -26,16 +26,22 @@ class ReloadCc(MultiHoster): # Get account data (user, data) = self.account.selectAccount() - - pwd = "pwd=%s" % data['password'] + + # Get supported hosters list from reload.cc using the json API v1 + query_params = dict( + via='pyload', + v=1, + get_supported='true', + get_traffic='true', + user=user + ) try: - pwd = "hash=%s" % data['pwdhash'] + query_params.update(dict(hash=self.account.infos[user]['pwdhash'])) except Exception: - pass + query_params.update(dict(pwd=data['password'])) - # Get supported hosters list from reload.cc using the json API v1 - answer = getURL("https://api.reload.cc/login?via=pyload&v=1&get_supported=true&get_traffic=true&user=%s&%s" % (user, pwd)) + answer = getURL("https://api.reload.cc/login", get=query_params) data = json_loads(answer) @@ -52,7 +58,7 @@ class ReloadCc(MultiHoster): self.account = self.core.accountManager.getAccountPlugin("ReloadCc") if not self.account.canUse(): self.account = None - self.logError(_("Please add a valid reload.cc account first and restart pyLoad.")) + self.logError("Please add a valid reload.cc account first and restart pyLoad.") return # Run the overwriten core ready which actually enables the multihoster hook |