diff options
author | radek-senfeld <rush@logic.cz> | 2014-03-29 22:37:01 +0100 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2014-03-29 22:37:01 +0100 |
commit | a80bf6d4edc8ba13d1383d9502e994be10a9d375 (patch) | |
tree | b5f25af4b1062125ad96eeb03db0ac0df12975c4 /module/plugins/hoster | |
parent | Merge pull request #488 from vuolter/s/crypter/MultiupOrg (diff) | |
download | pyload-a80bf6d4edc8ba13d1383d9502e994be10a9d375.tar.xz |
Fixed UlozTo hoster and account
Merged #554
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/UlozTo.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index 5dc6f7f00..a8c36fec3 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/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: |