summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar radek-senfeld <rush@logic.cz> 2014-03-29 22:37:01 +0100
committerGravatar Stefano <l.stickell@yahoo.it> 2014-04-21 17:12:02 +0200
commit4981cffd64037960af8567d9f954c5c7fb3fd915 (patch)
treecf9e28a8da57d52c4f48db0248bffd58974c8bf9
parentMerge pull request #488 from vuolter/s/crypter/MultiupOrg (diff)
downloadpyload-4981cffd64037960af8567d9f954c5c7fb3fd915.tar.xz
Fixed UlozTo hoster and account
Merged #554 (cherry picked from commit a80bf6d4edc8ba13d1383d9502e994be10a9d375)
-rw-r--r--pyload/plugins/accounts/UlozTo.py8
-rw-r--r--pyload/plugins/hoster/UlozTo.py15
2 files changed, 18 insertions, 5 deletions
diff --git a/pyload/plugins/accounts/UlozTo.py b/pyload/plugins/accounts/UlozTo.py
index 8a281389e..429a32db3 100644
--- a/pyload/plugins/accounts/UlozTo.py
+++ b/pyload/plugins/accounts/UlozTo.py
@@ -7,13 +7,13 @@ from module.plugins.Account import Account
class UlozTo(Account):
__name__ = "UlozTo"
- __version__ = "0.05"
+ __version__ = "0.06"
__type__ = "account"
__description__ = """uloz.to account plugin"""
__author_name__ = ("zoidberg", "pulpe")
__author_mail__ = ("zoidberg@mujmail.cz")
- TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="http://www.ulozto.net/kredit" title="[^"]*?GB = ([0-9.]+) MB"'
+ TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="/kredit" title="[^"]*?GB = ([0-9.]+) MB"'
def loadAccountInfo(self, user, req):
#this cookie gets lost somehow after each request
@@ -22,7 +22,7 @@ class UlozTo(Account):
req.cj.setCookie("www.ulozto.net", "ULOSESSID", self.phpsessid)
found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- trafficleft = int(float(found.group(1).replace(' ', '').replace(',', '.')) * 1000 / 1.024) if found else 0
+ trafficleft = int(float(found.group(1).replace(' ', '').replace(',', '.')) * 1000 * 1.048) if found else 0
self.premium = True if trafficleft else False
return {"validuntil": -1, "trafficleft": trafficleft}
@@ -31,7 +31,7 @@ class UlozTo(Account):
login_page = req.load('http://www.ulozto.net/?do=web-login', decode=True)
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",
diff --git a/pyload/plugins/hoster/UlozTo.py b/pyload/plugins/hoster/UlozTo.py
index 5dc6f7f00..a8c36fec3 100644
--- a/pyload/plugins/hoster/UlozTo.py
+++ b/pyload/plugins/hoster/UlozTo.py
@@ -29,7 +29,7 @@ class UlozTo(SimpleHoster):
__name__ = "UlozTo"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(?:live/)?(?P<id>\w+/[^/?]*)"
- __version__ = "0.95"
+ __version__ = "0.96"
__description__ = """uloz.to"""
__author_name__ = ("zoidberg")
@@ -40,10 +40,12 @@ class UlozTo(SimpleHoster):
FILE_SIZE_REPLACEMENTS = [('([0-9.]+)\s([kMG])B', convertDecimalPrefix)]
FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "www.ulozto.net")]
+ ADULT_PATTERN = r'<form action="(?P<link>[^\"]*)" method="post" id="frm-askAgeForm">'
PASSWD_PATTERN = r'<div class="passwordProtectedFile">'
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>[^\"]*)" />'
def setup(self):
self.multiDL = self.premium
@@ -53,6 +55,17 @@ class UlozTo(SimpleHoster):
pyfile.url = re.sub(r"(?<=http://)([^/]+)", "www.ulozto.net", pyfile.url)
self.html = self.load(pyfile.url, decode=True, cookies=True)
+ if re.search(self.ADULT_PATTERN, self.html):
+ self.logInfo("Adult content confirmation needed. Proceeding..")
+
+ found = re.search(self.TOKEN_PATTERN, self.html)
+ if not found:
+ self.parseError('TOKEN')
+ token = found.group(1)
+
+ self.html = self.load(pyfile.url, get={"do": "askAgeForm-submit"},
+ post={"agree": "Confirm", "_token_": token}, cookies=True)
+
passwords = self.getPassword().splitlines()
while self.PASSWD_PATTERN in self.html:
if passwords: