summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/RapidgatorNet.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/RapidgatorNet.py')
-rw-r--r--module/plugins/accounts/RapidgatorNet.py29
1 files changed, 8 insertions, 21 deletions
diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py
index 05d31e6a0..2899d5a68 100644
--- a/module/plugins/accounts/RapidgatorNet.py
+++ b/module/plugins/accounts/RapidgatorNet.py
@@ -1,32 +1,18 @@
# -*- coding: utf-8 -*-
-"""
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License,
- or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>.
-"""
-
from module.plugins.Account import Account
from module.common.json_layer import json_loads
class RapidgatorNet(Account):
- __name__ = "RapidgatorNet"
- __version__ = "0.04"
- __type__ = "account"
+ __name__ = "RapidgatorNet"
+ __type__ = "account"
+ __version__ = "0.05"
__description__ = """Rapidgator.net account plugin"""
- __author_name__ = "zoidberg"
- __author_mail__ = "zoidberg@mujmail.cz"
+ __license__ = "GPLv3"
+ __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
+
API_URL = 'http://rapidgator.net/api/user'
@@ -45,7 +31,7 @@ class RapidgatorNet(Account):
self.scheduleRefresh(user, json['response']['reset_in'])
return {"validuntil": json['response']['expire_date'],
- "trafficleft": int(json['response']['traffic_left']) / 1024,
+ "trafficleft": float(json['response']['traffic_left']) / 1024, #@TODO: Remove `/ 1024` in 0.4.10
"premium": True}
else:
self.logError(json['response_details'])
@@ -54,6 +40,7 @@ class RapidgatorNet(Account):
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']})