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 | |
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
-rwxr-xr-x[-rw-r--r--] | module/plugins/accounts/NetloadIn.py | 17 | ||||
-rwxr-xr-x[-rw-r--r--] | module/plugins/accounts/OronCom.py | 21 | ||||
-rwxr-xr-x[-rw-r--r--] | module/plugins/hoster/OronCom.py | 2 |
3 files changed, 27 insertions, 13 deletions
diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py index 4f5b08689..6febf2ff1 100644..100755 --- a/module/plugins/accounts/NetloadIn.py +++ b/module/plugins/accounts/NetloadIn.py @@ -23,18 +23,25 @@ from time import time class NetloadIn(Account): __name__ = "NetloadIn" - __version__ = "0.1" + __version__ = "0.2" __type__ = "account" __description__ = """netload.in account plugin""" - __author_name__ = ("RaNaN") - __author_mail__ = ("RaNaN@pyload.org") + __author_name__ = ("RaNaN", "DHMH") + __author_mail__ = ("RaNaN@pyload.org", "DHMH@pyload.org") def loadAccountInfo(self, user, req): page = req.load("http://netload.in/index.php?id=2") left = r">(\d+) Tage, (\d+) Stunden<" left = re.search(left, page) - validuntil = time() + int(left.group(1)) * 24 * 60 * 60 + int(left.group(2)) * 60 * 60 - return {"validuntil": validuntil, "trafficleft": -1} + if left: + validuntil = time() + int(left.group(1)) * 24 * 60 * 60 + int(left.group(2)) * 60 * 60 + trafficleft = -1 + premium = True + else: + validuntil = None + premium = False + trafficleft = None + return {"validuntil": validuntil, "trafficleft": trafficleft, "premium" : premium} def login(self, user, data,req): page = req.load("http://netload.in/index.php", None, { "txtuser" : user, "txtpass" : data['password'], "txtcheck" : "login", "txtlogin" : ""}, cookies=True) 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): diff --git a/module/plugins/hoster/OronCom.py b/module/plugins/hoster/OronCom.py index 7f09ea3a3..aaf039b3f 100644..100755 --- a/module/plugins/hoster/OronCom.py +++ b/module/plugins/hoster/OronCom.py @@ -36,7 +36,7 @@ class OronCom(Hoster): __version__ = "0.1" __description__ = "File Hoster: Oron.com" __author_name__ = ("chrox", "DHMH") - __author_mail__ = ("chrox@pyload.org", "webmaster@pcProfil.de") + __author_mail__ = ("chrox@pyload.org", "DHMH@pyload.org") FILE_INFO_PATTERN = r'Dateiname: <b class="f_arial f_14px">(.*)</b> <br>Größe: ([0-9,.]+) (Kb|Mb|Gb)' |