diff options
author | Nils Hesse <nphesse@gmail.com> | 2012-11-08 23:46:51 +0100 |
---|---|---|
committer | Nils Hesse <nphesse@gmail.com> | 2012-11-08 23:46:51 +0100 |
commit | a0217bf6ef37f5ee57b2bf04baa6568adb69247a (patch) | |
tree | d8fb4dbb217d933c85034775821a849063127004 /module/plugins/accounts/ReloadCc.py | |
parent | Change self.accounts to self.info for getting the cached password hash (diff) | |
download | pyload-a0217bf6ef37f5ee57b2bf04baa6568adb69247a.tar.xz |
Use a dictionary to supply HTTP requests with the GET parameters (ensure proper URL encoding)
Diffstat (limited to 'module/plugins/accounts/ReloadCc.py')
-rw-r--r-- | module/plugins/accounts/ReloadCc.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/module/plugins/accounts/ReloadCc.py b/module/plugins/accounts/ReloadCc.py index dbccd8f8f..e0eb5df6e 100644 --- a/module/plugins/accounts/ReloadCc.py +++ b/module/plugins/accounts/ReloadCc.py @@ -4,7 +4,7 @@ from module.common.json_layer import json_loads class ReloadCc(Account): __name__ = "ReloadCc" - __version__ = "0.1" + __version__ = "0.2" __type__ = "account" __description__ = """Reload.Cc account plugin""" @@ -34,13 +34,18 @@ class ReloadCc(Account): def getAccountStatus(self, user, req): - pwd = "pwd=%s" % self.accounts[user]['password'] + # Use reload.cc API v1 to retrieve account info and return the parsed json answer + query_params = dict( + via='pyload', + v=1, + get_traffic='true', + user=user + ) try: - pwd = "hash=%s" % self.infos[user]['pwdhash'] + query_params.update(dict(hash=self.infos[user]['pwdhash'])) except Exception: - pass + query_params.update(dict(pwd=self.accounts[user]['password'])) - # Use reload.cc API v1 to retrieve account info and return the parsed json answer - answer = req.load("https://api.reload.cc/login?via=pyload&v=1&get_traffic=true&user=%s&%s" % (user, pwd)) + answer = req.load("https://api.reload.cc/login", get=query_params) return json_loads(answer)
\ No newline at end of file |