summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/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:47:39 +0100
commitd7d2b0c56e16866313b7f746f94569f085acef01 (patch)
treec4e031d44d47b3e68a6e5e2aba66c47a7f81f69f /module/plugins/accounts/UlozTo.py
parent[RapidgatorNet] Set the language in COOKIES (diff)
downloadpyload-d7d2b0c56e16866313b7f746f94569f085acef01.tar.xz
[UlozTo] Fixed hoster and account
Diffstat (limited to 'module/plugins/accounts/UlozTo.py')
-rw-r--r--module/plugins/accounts/UlozTo.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py
index 2632d2535..ea2562280 100644
--- a/module/plugins/accounts/UlozTo.py
+++ b/module/plugins/accounts/UlozTo.py
@@ -2,13 +2,15 @@
import re
+from urlparse import urljoin
+
from module.plugins.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()