diff options
-rw-r--r-- | module/plugins/accounts/UlozTo.py | 22 | ||||
-rw-r--r-- | module/plugins/hoster/UlozTo.py | 4 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 2 |
3 files changed, 16 insertions, 12 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('&', '&') 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() diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index e4b28e81d..294bd8e17 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -15,7 +15,7 @@ def convertDecimalPrefix(m): class UlozTo(SimpleHoster): __name__ = "UlozTo" __type__ = "hoster" - __version__ = "0.99" + __version__ = "1.00" __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(?:live/)?(?P<id>\w+/[^/?]*)' @@ -37,7 +37,7 @@ class UlozTo(SimpleHoster): VIPLINK_PATTERN = r'<a href="[^"]*\?disclaimer=1" class="linkVip">' FREE_URL_PATTERN = r'<div class="freeDownloadForm"><form action="([^"]+)"' PREMIUM_URL_PATTERN = r'<div class="downloadForm"><form action="([^"]+)"' - TOKEN_PATTERN = r'<input type="hidden" name="_token_" id="[^\"]*" value="(?P<token>[^\"]*)" />' + TOKEN_PATTERN = r'<input type="hidden" name="_token_" id="[^\"]*" value="(?P<token>.+?)"' def setup(self): diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 6726d4fa5..1f7753003 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -324,7 +324,7 @@ class SimpleHoster(Hoster): def getFileInfo(self): - name, size, status, url = parseFileInfo(self) + name, size, status, url = parseFileInfo(self, html=self.html) if name and name != url: self.pyfile.name = name |