summaryrefslogtreecommitdiffstats
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
parent[RapidgatorNet] Set the language in COOKIES (diff)
downloadpyload-d7d2b0c56e16866313b7f746f94569f085acef01.tar.xz
[UlozTo] Fixed hoster and account
-rw-r--r--module/plugins/accounts/UlozTo.py22
-rw-r--r--module/plugins/hoster/UlozTo.py4
-rw-r--r--module/plugins/internal/SimpleHoster.py2
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('&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()
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