diff options
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/ShareRapidCom.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py index a14f93a9c..178fe236e 100644 --- a/module/plugins/accounts/ShareRapidCom.py +++ b/module/plugins/accounts/ShareRapidCom.py @@ -5,32 +5,29 @@ from module.plugins.Account import Account class ShareRapidCom(Account): __name__ = "ShareRapidCom" - __version__ = "0.2" + __version__ = "0.3" __type__ = "account" __description__ = """ShareRapid account plugin""" __author_name__ = ("MikyWoW") def loadAccountInfo(self, user, req): src = req.load("http://share-rapid.com/mujucet/", cookies=True) - if "Kredit:" in src: - start = src.index('Kredit:</td><td>') - src = src[start+16:] - start = src.index('GB') - kredit = src[0:start-1] - ret = float(kredit)*1024*1024 - tmp = {"premium": True, "trafficleft": ret, "validuntil": -1} + found = re.search(r'<tr><td>GB:</td><td>(.*?) GB', src) + if found: + ret = float(found.group(1)) * (1 << 20) + tmp = {"premium": True, "trafficleft": ret, "validuntil": -1} else: - tmp = {"premium": False, "trafficleft": None, "validuntil": None} + tmp = {"premium": False, "trafficleft": None, "validuntil": None} return tmp 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:] - hashes = htm[0:32] - htm = req.load("http://share-rapid.com/prihlaseni/", + start = htm.index('id="inp_hash" name="hash" value="') + htm = htm[start+33:] + hashes = htm[0:32] + htm = req.load("http://share-rapid.com/prihlaseni/", post={"hash": hashes,"login": user, "pass1": data["password"],"remember": 0, "sbmt": "P%C5%99ihl%C3%A1sit"}, cookies=True) - if "Heslo:" in htm: - self.wrongPassword()
\ No newline at end of file + if "Heslo:" in htm: + self.wrongPassword()
\ No newline at end of file |