summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/UploadedTo.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-12-22 20:33:23 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2010-12-22 20:33:23 +0100
commit0fd06af30e6ec943b6ddcfed2e2cf4cd64095309 (patch)
treef82c64a4504412ac848285cbf5a235e4295cb106 /module/plugins/accounts/UploadedTo.py
parentfixed getURL (diff)
downloadpyload-0fd06af30e6ec943b6ddcfed2e2cf4cd64095309.tar.xz
cookie handling WIP -.-
Diffstat (limited to 'module/plugins/accounts/UploadedTo.py')
-rw-r--r--module/plugins/accounts/UploadedTo.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py
index fcc2daf22..9b17debf5 100644
--- a/module/plugins/accounts/UploadedTo.py
+++ b/module/plugins/accounts/UploadedTo.py
@@ -20,6 +20,7 @@
from module.plugins.Account import Account
import re
from time import strptime, mktime
+from cookielib import Cookie
class UploadedTo(Account):
__name__ = "UploadedTo"
@@ -30,7 +31,7 @@ class UploadedTo(Account):
__author_mail__ = ("mkaay@mkaay.de")
def loadAccountInfo(self, user, req):
- html = req.getPage("http://uploaded.to/?setlang=en", cookies=True)
+ html = req.getPage("http://uploaded.to/", 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)
traffic = int(self.parseTraffic(raw_traffic))
@@ -40,6 +41,7 @@ class UploadedTo(Account):
return tmp
def login(self, user, data, req):
- page = req.getPage("http://uploaded.to/login", post={ "email" : user, "password" : data["password"]}, cookies=True)
+ req.cookieJar.set_cookie(Cookie(version=0, name='lang', value='en', port=None, port_specified=False, domain='.uploaded.to', domain_specified=True, domain_initial_dot=True, path='/', path_specified=True, secure=False, expires=None, discard=False, comment=None, comment_url=None, rest={}, rfc2109=False))
+ page = req.getPage("http://uploaded.to/login", post={ "email" : user, "password" : data["password"]})
if "Login failed!" in page:
self.wrongPassword()