summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/account/UlozTo.py
diff options
context:
space:
mode:
authorGravatar Radek Senfeld <rush@logic.cz> 2014-11-14 01:47:39 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-11-14 01:56:11 +0100
commit5d4443c144323bef78faa354d9aba47e672a7327 (patch)
tree0412ae1445efe2d3d331aac46d184edf0c75d9e4 /pyload/plugins/account/UlozTo.py
parent[RapidgatorNet] Set the language in COOKIES (diff)
downloadpyload-5d4443c144323bef78faa354d9aba47e672a7327.tar.xz
[UlozTo] Fixed hoster and account
Conflicts: pyload/plugins/account/UlozTo.py
Diffstat (limited to 'pyload/plugins/account/UlozTo.py')
-rw-r--r--pyload/plugins/account/UlozTo.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/pyload/plugins/account/UlozTo.py b/pyload/plugins/account/UlozTo.py
index 105a962cd..fefc334e9 100644
--- a/pyload/plugins/account/UlozTo.py
+++ b/pyload/plugins/account/UlozTo.py
@@ -2,13 +2,15 @@
import re
+from urlparse import urljoin
+
from pyload.plugins.base.Account import Account
class UlozTo(Account):
__name__ = "UlozTo"
__type__ = "account"
- __version__ = "0.06"
+ __version__ = "0.07"
__description__ = """Uloz.to account plugin"""
__license__ = "GPLv3"
@@ -20,9 +22,10 @@ class UlozTo(Account):
def loadAccountInfo(self, user, req):
- #this cookie gets lost somehow after each request
- self.phpsessid = req.cj.getCookie("ULOSESSID")
+ self.phpsessid = req.cj.getCookie("ULOSESSID") #@NOTE: this cookie gets lost somehow after each request
+
html = req.load("http://www.ulozto.net/", decode=True)
+
req.cj.setCookie(".ulozto.net", "ULOSESSID", self.phpsessid)
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
@@ -37,12 +40,13 @@ class UlozTo(Account):
action = re.findall('<form action="(.+?)"', login_page)[1].replace('&amp;', '&')
token = re.search('_token_" value="(.+?)"', login_page).group(1)
- html = req.load('http://www.ulozto.net'+action, post={
- "_token_": token,
- "login": "Submit",
- "password": data['password'],
- "username": user
- }, decode=True)
+ html = req.load(urljoin("http://www.ulozto.net/", action),
+ post={'_token_' : token,
+ 'do' : "loginForm-submit",
+ 'login' : u"Přihlásit",
+ 'password': data['password'],
+ 'username': user},
+ decode=True)
if '<div class="flash error">' in html:
self.wrongPassword()