diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-18 10:52:11 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-18 10:52:11 +0200 |
commit | 01da7eb561776ee706c1fd74e49a1b1664951d76 (patch) | |
tree | aa413795fe1e518657d4d234066a82400f56c2ed /module/plugins/accounts | |
parent | rs fix, more cleanup stuff (diff) | |
download | pyload-01da7eb561776ee706c1fd74e49a1b1664951d76.tar.xz |
closed #157, account request cleanup
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r-- | module/plugins/accounts/DepositfilesCom.py | 7 | ||||
-rw-r--r-- | module/plugins/accounts/FileserveCom.py | 7 | ||||
-rw-r--r-- | module/plugins/accounts/FreakshareCom.py | 6 | ||||
-rw-r--r-- | module/plugins/accounts/HotfileCom.py | 9 | ||||
-rw-r--r-- | module/plugins/accounts/MegauploadCom.py | 6 | ||||
-rw-r--r-- | module/plugins/accounts/NetloadIn.py | 6 | ||||
-rw-r--r-- | module/plugins/accounts/RapidshareCom.py | 6 | ||||
-rw-r--r-- | module/plugins/accounts/ShareonlineBiz.py | 6 | ||||
-rw-r--r-- | module/plugins/accounts/UploadedTo.py | 6 |
9 files changed, 23 insertions, 36 deletions
diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py index 70741da0b..4a5792c40 100644 --- a/module/plugins/accounts/DepositfilesCom.py +++ b/module/plugins/accounts/DepositfilesCom.py @@ -29,8 +29,7 @@ class DepositfilesCom(Account): __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - def loadAccountInfo(self, user): - req = self.getAccountRequest(user) + def loadAccountInfo(self, user, req): src = req.load("http://depositfiles.com/de/gold/") validuntil = re.search("noch den Gold-Zugriff: <b>(.*?)</b></div>", src).group(1) @@ -40,7 +39,7 @@ class DepositfilesCom(Account): tmp = {"validuntil":validuntil, "trafficleft":-1} return tmp - def login(self, user, data): - req = self.getAccountRequest(user) + def login(self, user, data, req): + req.load("http://depositfiles.com/de/gold/payment.php") req.load("http://depositfiles.com/de/login.php", get={"return": "/de/gold/payment.php"}, post={"login": user, "password": data["password"]}) diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py index 27cad18bd..793d240cc 100644 --- a/module/plugins/accounts/FileserveCom.py +++ b/module/plugins/accounts/FileserveCom.py @@ -29,8 +29,7 @@ class FileserveCom(Account): __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - def loadAccountInfo(self, user): - req = self.getAccountRequest(user) + def loadAccountInfo(self, user, req): src = req.load("http://fileserve.com/dashboard.php", cookies=True) @@ -43,8 +42,8 @@ class FileserveCom(Account): tmp = {"trafficleft":-1} return tmp - def login(self, user, data): - req = self.getAccountRequest(user) + def login(self, user, data, req): + req.load("http://fileserve.com/login.php", post={"loginUserName": user, "loginUserPassword": data["password"], "autoLogin": "on", "loginFormSubmit": "Login"}, cookies=True) diff --git a/module/plugins/accounts/FreakshareCom.py b/module/plugins/accounts/FreakshareCom.py index ba9566522..732f9e203 100644 --- a/module/plugins/accounts/FreakshareCom.py +++ b/module/plugins/accounts/FreakshareCom.py @@ -29,8 +29,7 @@ class FreakshareCom(Account): __author_name__ = ("RaNaN") __author_mail__ = ("RaNaN@pyload.org") - def loadAccountInfo(self, user): - req = self.getAccountRequest(user) + def loadAccountInfo(self, user, req): page = req.load("http://freakshare.com/") validuntil = r"ltig bis:</td>\s*<td><b>([0-9 \-:.]+)</b></td>" @@ -45,8 +44,7 @@ class FreakshareCom(Account): return {"validuntil": validuntil, "trafficleft": traffic} - def login(self, user, data): - req = self.getAccountRequest(user) + def login(self, user, data, req): page = req.load("http://freakshare.com/login.html", None, { "submit" : "Login", "user" : user, "pass" : data['password']}, cookies=True) if "Falsche Logindaten!" in page or "Wrong Username or Password!" in page: diff --git a/module/plugins/accounts/HotfileCom.py b/module/plugins/accounts/HotfileCom.py index 52bff87fe..a4354eb2e 100644 --- a/module/plugins/accounts/HotfileCom.py +++ b/module/plugins/accounts/HotfileCom.py @@ -29,7 +29,7 @@ class HotfileCom(Account): __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - def loadAccountInfo(self, user): + def loadAccountInfo(self, user, req): resp = self.apiCall("getuserinfo", user=user) if resp.startswith("."): self.core.debug("HotfileCom API Error: %s" % resp) @@ -68,10 +68,11 @@ class HotfileCom(Account): post.update({"action": method}) post.update({"username":user, "passwordmd5dig":pwhash, "digest":digest}) - return req.load("http://api.hotfile.com/", post=post) + resp = req.load("http://api.hotfile.com/", post=post) + req.clean() + return resp - def login(self, user, data): - req = self.getAccountRequest(user) + def login(self, user, data, req): cj = self.getAccountCookies(user) cj.setCookie("hotfile.com", "lang", "en") req.load("http://hotfile.com/", cookies=True) diff --git a/module/plugins/accounts/MegauploadCom.py b/module/plugins/accounts/MegauploadCom.py index e50c62788..dce6fb088 100644 --- a/module/plugins/accounts/MegauploadCom.py +++ b/module/plugins/accounts/MegauploadCom.py @@ -30,8 +30,7 @@ class MegauploadCom(Account): __author_name__ = ("RaNaN") __author_mail__ = ("RaNaN@pyload.org") - def loadAccountInfo(self, user): - req = self.getAccountRequest(user) + def loadAccountInfo(self, user, req): page = req.load("http://www.megaupload.com/?c=account") if 'id="directdownloadstxt">Activate' in page: @@ -43,8 +42,7 @@ class MegauploadCom(Account): return {"validuntil": valid, "trafficleft": -1} - def login(self, user, data): - req = self.getAccountRequest(user) + def login(self, user, data, req): page = req.load("http://www.megaupload.com/?c=login&next=c%3Dpremium", post={ "username" : user, "password" : data["password"], "login" :"1"}, cookies=True) if "Username and password do not match" in page: self.wrongPassword()
\ No newline at end of file diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py index 16e06b688..957435b46 100644 --- a/module/plugins/accounts/NetloadIn.py +++ b/module/plugins/accounts/NetloadIn.py @@ -29,16 +29,14 @@ class NetloadIn(Account): __author_name__ = ("RaNaN") __author_mail__ = ("RaNaN@pyload.org") - def loadAccountInfo(self, user): - req = self.getAccountRequest(user) + 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} - def login(self, user, data): - req = self.getAccountRequest(user) + def login(self, user, req): page = req.load("http://netload.in/index.php", None, { "txtuser" : user, "txtpass" : data['password'], "txtcheck" : "login", "txtlogin" : ""}, cookies=True) if "password or it might be invalid!" in page: self.wrongPassword() diff --git a/module/plugins/accounts/RapidshareCom.py b/module/plugins/accounts/RapidshareCom.py index 683237674..a2bb30211 100644 --- a/module/plugins/accounts/RapidshareCom.py +++ b/module/plugins/accounts/RapidshareCom.py @@ -27,9 +27,8 @@ class RapidshareCom(Account): __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - def loadAccountInfo(self, user): + def loadAccountInfo(self, user, req): data = self.getAccountData(user) - req = self.getAccountRequest(user) api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", "login": user, "password": data["password"], "withcookie": 1} src = req.load(api_url_base, cookies=False, get=api_param_prem) @@ -49,8 +48,7 @@ class RapidshareCom(Account): return tmp - def login(self, user, data): - req = self.getAccountRequest(user) + def login(self, user, data, req): api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", "login": user, "password": data["password"], "withcookie": 1} src = req.load(api_url_base, cookies=False, get=api_param_prem) diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 15a554db0..3564d489c 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -29,8 +29,7 @@ class ShareonlineBiz(Account): __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - def loadAccountInfo(self, user): - req = self.getAccountRequest(user) + def loadAccountInfo(self, user, req): src = req.load("http://www.share-online.biz/members.php?setlang=en") validuntil = re.search(r'<td align="left"><b>Package Expire Date:</b></td>\s*<td align="left">(\d+/\d+/\d+)</td>', src).group(1) validuntil = int(mktime(strptime(validuntil, "%m/%d/%y"))) @@ -38,8 +37,7 @@ class ShareonlineBiz(Account): tmp = {"validuntil":validuntil, "trafficleft":-1} return tmp - def login(self, user, data): - req = self.getAccountRequest(user) + def login(self, user, data, req): post_vars = { "act": "login", "location": "index.php", diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py index 4c45fb6fc..2cb447877 100644 --- a/module/plugins/accounts/UploadedTo.py +++ b/module/plugins/accounts/UploadedTo.py @@ -29,8 +29,7 @@ class UploadedTo(Account): __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - def loadAccountInfo(self, user): - req = self.getAccountRequest(user) + def loadAccountInfo(self, user, req): html = req.load("http://uploaded.to/?setlang=en", cookies=True) raw_traffic = re.search(r"Traffic left: </span><span class=.*?>(.*?)</span>", html).group(1) raw_valid = re.search(r"Valid until: </span> <span class=.*?>(.*?)</span>", html).group(1) @@ -40,8 +39,7 @@ class UploadedTo(Account): tmp = {"validuntil":validuntil, "trafficleft":traffic, "maxtraffic":100*1024*1024} return tmp - def login(self, user, data): - req = self.getAccountRequest(user) + def login(self, user, data, req): page = req.load("http://uploaded.to/login", post={ "email" : user, "password" : data["password"]}, cookies=True) if "Login failed!" in page: self.wrongPassword() |