diff options
author | CryNickSystems <d.hardtke@yahoo.de> | 2011-11-12 00:17:21 +0100 |
---|---|---|
committer | CryNickSystems <d.hardtke@yahoo.de> | 2011-11-12 00:17:21 +0100 |
commit | 7e785423898da7044f180e99fe33b40764c86727 (patch) | |
tree | a3ec5a7fa0deea8cb31eb08799291eb7ab49e285 /module/plugins/accounts/OronCom.py | |
parent | option for subfolders (diff) | |
parent | Check validity of OronCom and NetloadIn accounts (diff) | |
download | pyload-7e785423898da7044f180e99fe33b40764c86727.tar.xz |
Check account validity for OronCom and NetloadIn
Diffstat (limited to 'module/plugins/accounts/OronCom.py')
-rwxr-xr-x[-rw-r--r--] | module/plugins/accounts/OronCom.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/module/plugins/accounts/OronCom.py b/module/plugins/accounts/OronCom.py index 4e4d26e7c..fdb23c93a 100644..100755 --- a/module/plugins/accounts/OronCom.py +++ b/module/plugins/accounts/OronCom.py @@ -27,17 +27,24 @@ class OronCom(Account): __type__ = "account" __description__ = """oron.com account plugin""" __author_name__ = ("DHMH") - __author_mail__ = ("webmaster@pcProfil.de") + __author_mail__ = ("oron@pyload.org") def loadAccountInfo(self, user, req): req.load("http://oron.com/?op=change_lang&lang=german") src = req.load("http://oron.com/?op=my_account").replace("\n", "") - validuntil = re.search(r"<td>Premiumaccount läuft bis:</td>\s*<td>(.*?)</td>", src).group(1) - validuntil = int(mktime(strptime(validuntil, "%d %B %Y"))) - trafficleft = re.search(r'<td>Download Traffic verfügbar:</td>\s*<td>(.*?)</td>', src).group(1) - self.logDebug("Oron left: " + trafficleft) - trafficleft = int(self.parseTraffic(trafficleft)) - tmp = {"validuntil": validuntil, "trafficleft": trafficleft} + validuntil = re.search(r"<td>Premiumaccount läuft bis:</td>\s*<td>(.*?)</td>", src) + if validuntil: + validuntil = validuntil.group(1) + validuntil = int(mktime(strptime(validuntil, "%d %B %Y"))) + trafficleft = re.search(r'<td>Download Traffic verfügbar:</td>\s*<td>(.*?)</td>', src).group(1) + self.logDebug("Oron left: " + trafficleft) + trafficleft = int(self.parseTraffic(trafficleft)) + premium = True + else: + validuntil = -1 + trafficleft = None + premium = False + tmp = {"validuntil": validuntil, "trafficleft": trafficleft, "premium" : premium} return tmp def login(self, user, data, req): |