diff options
author | OndrejIT <git@ondrej.it> | 2016-06-07 11:08:04 +0200 |
---|---|---|
committer | OndrejIT <git@ondrej.it> | 2016-06-07 11:08:04 +0200 |
commit | 36a5cd2da8c7dff928cbaa16688362632ae57ad9 (patch) | |
tree | f6cbb2e3309682ecd9b7f68ba26519d0e2034e72 | |
parent | Add https support for UlozTo hoster. (diff) | |
parent | [FilerNet] Fix #2489 (diff) | |
download | pyload-36a5cd2da8c7dff928cbaa16688362632ae57ad9.tar.xz |
Merge branch 'stable' of https://github.com/pyload/pyload into stable
Conflicts:
module/plugins/hoster/UlozTo.py
-rw-r--r-- | module/plugins/accounts/UlozTo.py | 8 | ||||
-rw-r--r-- | module/plugins/hooks/UpdateManager.py | 9 | ||||
-rw-r--r-- | module/plugins/hoster/FilerNet.py | 13 | ||||
-rw-r--r-- | module/plugins/hoster/UlozTo.py | 25 |
4 files changed, 29 insertions, 26 deletions
diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index da3bb6f0c..a712ea551 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account class UlozTo(Account): __name__ = "UlozTo" __type__ = "account" - __version__ = "0.17" + __version__ = "0.18" __status__ = "testing" __description__ = """Uloz.to account plugin""" @@ -23,7 +23,7 @@ class UlozTo(Account): def grab_info(self, user, password, data): - html = self.load("http://www.ulozto.net/") + html = self.load("https://www.ulozto.net/") m = re.search(self.TRAFFIC_LEFT_PATTERN, html) @@ -34,11 +34,11 @@ class UlozTo(Account): def signin(self, user, password, data): - login_page = self.load('http://www.ulozto.net/?do=web-login') + login_page = self.load('https://www.ulozto.net/?do=web-login') action = re.findall('<form action="(.+?)"', login_page)[1].replace('&', '&') token = re.search('_token_" value="(.+?)"', login_page).group(1) - html = self.load(urlparse.urljoin("http://www.ulozto.net/", action), + html = self.load(urlparse.urljoin("https://www.ulozto.net/", action), post={'_token_' : token, 'do' : "loginForm-submit", 'login' : u"Přihlásit", diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 3cb325d29..504b1e353 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -15,7 +15,7 @@ from module.plugins.internal.misc import encode, exists, Expose, fsjoin, threade class UpdateManager(Addon): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "1.13" + __version__ = "1.14" __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), @@ -164,19 +164,22 @@ class UpdateManager(Addon): self.info['pyload'] = False self.info['last_check'] = time.time() - if not newversion or not re.search(r'^\d+(?:\.\d+){0,3}[a-z]?$', newversion): + if not newversion: exitcode = 0 elif newversion == "None": self.log_info(_("pyLoad is up to date!")) exitcode = self.update_plugins() - else: + elif re.search(r'^\d+(?:\.\d+){0,3}[a-z]?$', newversion): self.log_info(_("*** New pyLoad %s available ***") % newversion) self.log_info(_("*** Get it here: https://github.com/pyload/pyload/releases ***")) self.info['pyload'] = True exitcode = 3 + else: + exitcode = 0 + #: Exit codes: #: -1 = No plugin updated, new pyLoad version available #: 0 = No plugin updated diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index a1ad5d8c9..cc4788772 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -32,7 +32,7 @@ class FilerNet(SimpleHoster): INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>[\w^_]+)</small></h1>' OFFLINE_PATTERN = r'Nicht gefunden' - WAIT_PATTERN = r'musst du <span id="time">(\d+)' + WAIT_PATTERN = r'var count = (\d+);' LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'href="([^"]+)">Get download</a>' @@ -51,10 +51,7 @@ class FilerNet(SimpleHoster): self.captcha = ReCaptcha(pyfile) response, challenge = self.captcha.challenge() - header = self.load(pyfile.url, - post={'recaptcha_challenge_field': challenge, - 'recaptcha_response_field' : response, - 'hash' : inputs['hash']}, - just_header=True) - - self.link = header.get('location') + self.download(pyfile.url, + post={'recaptcha_challenge_field': challenge, + 'recaptcha_response_field' : response, + 'hash' : inputs['hash']}) diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index de6efde27..478758492 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -17,7 +17,7 @@ class UlozTo(SimpleHoster): __version__ = "1.33" __status__ = "testing" - __pattern__ = r'http(s)?://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl|pornfile\.cz)/(?:live/)?(?P<ID>\w+/[^/?]*)' + __pattern__ = r'https?://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl|pornfile\.cz)/(?:live/)?(?P<ID>\w+/[^/?]*)' __config__ = [("activated" , "bool", "Activated" , True), @@ -37,7 +37,8 @@ class UlozTo(SimpleHoster): SIZE_PATTERN = r'<span id="fileSize">.*?(?P<S>[\d.,]+\s[kMG]?B)</span>' OFFLINE_PATTERN = r'<title>404 - Page not found</title>|<h1 class="h1">File (has been deleted|was banned)</h1>' - URL_REPLACEMENTS = [(r'(?<=http://)([^/]+)', "www.ulozto.net")] + URL_REPLACEMENTS = [(r'(?<=http://)([^/]+)', "www.ulozto.net"), + ("http://", "https://")] SIZE_REPLACEMENTS = [(r'([\d.]+)\s([kMG])B', convert_decimal_prefix)] CHECK_TRAFFIC = True @@ -60,8 +61,9 @@ class UlozTo(SimpleHoster): self.log_info(_("Adult content confirmation needed")) url = pyfile.url.replace("ulozto.net", "pornfile.cz") - self.load("http://pornfile.cz/porn-disclaimer", - post={'agree': "Confirm", 'do': 'pornDisclaimer-submit'}) + self.load("https://pornfile.cz/porn-disclaimer", + post={'agree': "Confirm", + 'do' : "pornDisclaimer-submit"}) html = self.load(url) name = re.search(self.NAME_PATTERN, html).group(2) @@ -81,7 +83,7 @@ class UlozTo(SimpleHoster): #: Old version - last seen 9.12.2013 self.log_debug('Using "old" version') - captcha_value = self.captcha.decrypt("http://img.uloz.to/captcha/%s.png" % inputs['captcha_id']) + captcha_value = self.captcha.decrypt("https://img.uloz.to/captcha/%s.png" % inputs['captcha_id']) self.log_debug("CAPTCHA ID: " + inputs['captcha_id'] + ", CAPTCHA VALUE: " + captcha_value) inputs.update({'captcha_id': inputs['captcha_id'], 'captcha_key': inputs['captcha_key'], 'captcha_value': captcha_value}) @@ -90,10 +92,10 @@ class UlozTo(SimpleHoster): #: New version - better to get new parameters (like captcha reload) because of image url - since 6.12.2013 self.log_debug('Using "new" version') - xapca = self.load("http://www.ulozto.net/reloadXapca.php", + xapca = self.load("https://www.ulozto.net/reloadXapca.php", get={'rnd': timestamp()}) - xapca = xapca.replace('sound":"', 'sound":"http:').replace('image":"', 'image":"http:') + xapca = xapca.replace('sound":"', 'sound":"https:').replace('image":"', 'image":"https:') self.log_debug("xapca: %s" % xapca) data = json.loads(xapca) @@ -116,7 +118,7 @@ class UlozTo(SimpleHoster): else: self.error(_("CAPTCHA form changed")) - self.download("http://www.ulozto.net" + action, post=inputs) + self.download("https://www.ulozto.net" + action, post=inputs) def handle_premium(self, pyfile): @@ -131,7 +133,8 @@ class UlozTo(SimpleHoster): self.log_info(_("Password protected link, trying ") + password) self.data = self.load(self.pyfile.url, get={'do': "passwordProtectedForm-submit"}, - post={'password': password, 'password_send': 'Send'}) + post={'password' : password, + 'password_send': 'Send'}) if self.PASSWD_PATTERN in self.data: self.fail(_("Wrong password")) @@ -139,7 +142,7 @@ class UlozTo(SimpleHoster): self.fail(_("No password found")) if re.search(self.VIPLINK_PATTERN, self.data): - self.data = self.load(pyfile.url, get={'disclaimer': "1"}) + self.data = self.load(self.pyfile.url, get={'disclaimer': "1"}) return super(UlozTo, self).check_errors() @@ -149,7 +152,7 @@ class UlozTo(SimpleHoster): 'wrong_captcha': ">An error ocurred while verifying the user", 'offline' : re.compile(self.OFFLINE_PATTERN), 'passwd' : self.PASSWD_PATTERN, - 'server_error' : 'src="http://img.ulozto.cz/error403/vykricnik.jpg"', #: Paralell dl, server overload etc. + 'server_error' : 'src="https://img.ulozto.cz/error403/vykricnik.jpg"', #: Paralell dl, server overload etc. 'not_found' : "<title>Ulož.to</title>" }) |