summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/ShareRapidCom.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-07-23 20:22:42 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-07-23 20:22:42 +0200
commitf5535809bebc6cc343475704832c8fd8674d2d06 (patch)
treec59bc1e6d71c04f5545ea262056c0c5be1bd8910 /module/plugins/accounts/ShareRapidCom.py
parentFixed PEP 8 violations in Hosters (diff)
downloadpyload-f5535809bebc6cc343475704832c8fd8674d2d06.tar.xz
Fixed PEP 8 violations in Accounts
Diffstat (limited to 'module/plugins/accounts/ShareRapidCom.py')
-rw-r--r--module/plugins/accounts/ShareRapidCom.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py
index f8043449c..b532768b1 100644
--- a/module/plugins/accounts/ShareRapidCom.py
+++ b/module/plugins/accounts/ShareRapidCom.py
@@ -4,44 +4,45 @@ import re
from time import mktime, strptime
from module.plugins.Account import Account
+
class ShareRapidCom(Account):
__name__ = "ShareRapidCom"
__version__ = "0.32"
__type__ = "account"
__description__ = """ShareRapid account plugin"""
__author_name__ = ("MikyWoW", "zoidberg")
-
+
login_timeout = 60
-
+
def loadAccountInfo(self, user, req):
src = req.load("http://share-rapid.com/mujucet/", decode=True)
-
+
found = re.search(ur'<td>Max. počet paralelních stahování: </td><td>(\d+)', src)
if found:
data = self.getAccountData(user)
data["options"]["limitDL"] = [int(found.group(1))]
-
+
found = re.search(ur'<td>Paušální stahování aktivní. Vyprší </td><td><strong>(.*?)</strong>', src)
if found:
validuntil = mktime(strptime(found.group(1), "%d.%m.%Y - %H:%M"))
- return {"premium": True, "trafficleft": -1, "validuntil": validuntil}
-
+ return {"premium": True, "trafficleft": -1, "validuntil": validuntil}
+
found = re.search(r'<tr><td>GB:</td><td>(.*?) GB', src)
if found:
trafficleft = float(found.group(1)) * (1 << 20)
return {"premium": True, "trafficleft": trafficleft, "validuntil": -1}
-
+
return {"premium": False, "trafficleft": None, "validuntil": None}
def login(self, user, data, req):
htm = req.load("http://share-rapid.com/prihlaseni/", cookies=True)
if "Heslo:" in htm:
start = htm.index('id="inp_hash" name="hash" value="')
- htm = htm[start+33:]
+ htm = htm[start + 33:]
hashes = htm[0:32]
htm = req.load("http://share-rapid.com/prihlaseni/",
post={"hash": hashes,
- "login": user,
+ "login": user,
"pass1": data["password"],
"remember": 0,
- "sbmt": u"Přihlásit"}, cookies=True) \ No newline at end of file
+ "sbmt": u"Přihlásit"}, cookies=True)