summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/RapideoPl.py
diff options
context:
space:
mode:
authorGravatar synweap15 <shamdog+github@gmail.com> 2014-07-09 13:47:49 +0200
committerGravatar synweap15 <shamdog+github@gmail.com> 2014-07-09 13:47:49 +0200
commit2e8ed2bf0b357e907f6921c7bb88719bb347367b (patch)
treed938b32f0b55fe708dc4306f74ea32f1c00458e0 /module/plugins/accounts/RapideoPl.py
parentremove enviroment line (diff)
downloadpyload-2e8ed2bf0b357e907f6921c7bb88719bb347367b.tar.xz
remove blank lines and unused imports
Diffstat (limited to 'module/plugins/accounts/RapideoPl.py')
-rw-r--r--module/plugins/accounts/RapideoPl.py26
1 files changed, 7 insertions, 19 deletions
diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py
index 0463bba69..853731f26 100644
--- a/module/plugins/accounts/RapideoPl.py
+++ b/module/plugins/accounts/RapideoPl.py
@@ -3,9 +3,7 @@
from datetime import datetime
from module.plugins.Account import Account
-from module.plugins.internal.SimpleHoster import parseHtmlForm
-import re
-from time import mktime, strptime
+from time import mktime
import module.lib.beaker.crypto as crypto
try:
@@ -13,6 +11,7 @@ try:
except ImportError:
from simplejson import loads
+
class RapideoPl(Account):
__name__ = "RapideoPl"
__version__ = "0.01"
@@ -37,40 +36,32 @@ class RapideoPl(Account):
_pwd = None
def loadAccountInfo(self, name, req):
-
self._req = req
-
try:
result = loads(self.runAuthQuery())
except:
- #todo: return or let it be thrown?
+ # todo: return or let it be thrown?
return
premium = False
valid_untill = -1
-
is_premium = "expire" in result.keys() and result["expire"] is not None
-
if is_premium:
-
premium = True
valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple())
traffic_left = result["balance"]
return ({
- "validuntil": valid_untill,
- "trafficleft": traffic_left,
- "premium": premium
- })
+ "validuntil": valid_untill,
+ "trafficleft": traffic_left,
+ "premium": premium
+ })
def login(self, user, data, req):
-
self._usr = user
self._pwd = crypto.md5(data["password"]).hexdigest()
-
self._req = req
-
try:
response = loads(self.runAuthQuery())
except:
@@ -78,12 +69,10 @@ class RapideoPl(Account):
if "errno" in response.keys():
self.wrongPassword()
-
data['usr'] = self._usr
data['pwd'] = self._pwd
def createAuthQuery(self):
-
query = self._api_query
query["username"] = self._usr
query["password"] = self._pwd
@@ -91,7 +80,6 @@ class RapideoPl(Account):
return query
def runAuthQuery(self):
-
data = self._req.load(self._api_url, post=self.createAuthQuery())
return data \ No newline at end of file