diff options
Diffstat (limited to 'pyload/plugins/account/RapidgatorNet.py')
-rw-r--r-- | pyload/plugins/account/RapidgatorNet.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/pyload/plugins/account/RapidgatorNet.py b/pyload/plugins/account/RapidgatorNet.py deleted file mode 100644 index 3dd8cf3d2..000000000 --- a/pyload/plugins/account/RapidgatorNet.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugins.Account import Account -from pyload.utils import json_loads - - -class RapidgatorNet(Account): - __name = "RapidgatorNet" - __type = "account" - __version = "0.04" - - __description = """Rapidgator.net account plugin""" - __license = "GPLv3" - __authors = [("zoidberg", "zoidberg@mujmail.cz")] - - - API_URL = 'http://rapidgator.net/api/user' - - - def loadAccountInfo(self, user, req): - try: - sid = self.getAccountData(user).get('SID') - assert sid - - json = req.load("%s/info?sid=%s" % (self.API_URL, sid)) - self.logDebug("API:USERINFO", json) - json = json_loads(json) - - if json['response_status'] == 200: - if "reset_in" in json['response']: - self.scheduleRefresh(user, json['response']['reset_in']) - - return {"validuntil": json['response']['expire_date'], - "trafficleft": int(json['response']['traffic_left']), - "premium": True} - else: - self.logError(json['response_details']) - except Exception, e: - self.logError(e) - - return {"validuntil": None, "trafficleft": None, "premium": False} - - - def login(self, user, data, req): - try: - json = req.load('%s/login' % self.API_URL, post={"username": user, "password": data['password']}) - self.logDebug("API:LOGIN", json) - json = json_loads(json) - - if json['response_status'] == 200: - data['SID'] = str(json['response']['session_id']) - return - else: - self.logError(json['response_details']) - except Exception, e: - self.logError(e) - - self.wrongPassword() |