From 7943a306eb794e826d5ffeb54218f350fbc8e34f Mon Sep 17 00:00:00 2001 From: Jochen Oberreiter Date: Fri, 14 Aug 2015 08:14:30 +0200 Subject: Check if search has returned a result Fixes #1753 --- module/plugins/crypter/ShareLinksBiz.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 6fbe59b38..da91cc065 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -68,8 +68,12 @@ class ShareLinksBiz(Crypter): url = pyfile.url if 's2l.biz' in url: url = self.load(url, just_header=True)['location'] - self.base_url = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1) - self.file_id = re.match(self.__pattern__, url).group('ID') + if re.match(self.__pattern__, url): + self.base_url = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1) + self.file_id = re.match(self.__pattern__, url).group('ID') + else: + self.log_debug("Could not initialize, URL [%s] does not match pattern [%s]" % (url, self.__pattern__)) + self.fail("Unsupported download link") self.package = pyfile.package() -- cgit v1.2.3 From f705acb7621a6a4c9f8f11bf6a30d54b26de6918 Mon Sep 17 00:00:00 2001 From: Jochen Oberreiter Date: Fri, 14 Aug 2015 08:25:39 +0200 Subject: Update ShareLinksBiz.py Bump version --- module/plugins/crypter/ShareLinksBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index da91cc065..df6068908 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -10,7 +10,7 @@ from module.plugins.internal.Crypter import Crypter class ShareLinksBiz(Crypter): __name__ = "ShareLinksBiz" __type__ = "crypter" - __version__ = "1.16" + __version__ = "1.17" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P_?\w+)' -- cgit v1.2.3 From 67864826ef26c831c9fa216b154917d48b045f72 Mon Sep 17 00:00:00 2001 From: Jochen Oberreiter Date: Sun, 16 Aug 2015 21:42:08 +0200 Subject: Update ShareLinksBiz.py Correct regex search for getting captcha url data --- module/plugins/crypter/ShareLinksBiz.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index df6068908..712b4fff2 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -118,7 +118,10 @@ class ShareLinksBiz(Crypter): self.log_debug("Captcha map with [%d] positions" % len(captchaMap.keys())) #: Request user for captcha coords - m = re.search(r' Date: Mon, 21 Sep 2015 14:36:22 +0200 Subject: Spare code cosmetics --- module/plugins/crypter/ShareLinksBiz.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 712b4fff2..2e9abff61 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -216,8 +216,10 @@ class ShareLinksBiz(Crypter): self.log_debug("JsEngine returns value [%s] for redirection link" % dlLink) package_links.append(dlLink) + except Exception, detail: self.log_debug("Error decrypting Web link [%s], %s" % (ID, detail)) + return package_links @@ -242,8 +244,10 @@ class ShareLinksBiz(Crypter): try: (crypted, jk) = self._get_cipher_params() package_links.extend(self._get_links(crypted, jk)) + except Exception: self.fail(_("Unable to decrypt CNL2 links")) + return package_links -- cgit v1.2.3 From 9fdf1ed882fa981efd96179aaee23fb87e597c9b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 29 Sep 2015 21:48:26 +0200 Subject: Update crypter plugins --- module/plugins/crypter/ShareLinksBiz.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 2e9abff61..3316aea56 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -10,7 +10,7 @@ from module.plugins.internal.Crypter import Crypter class ShareLinksBiz(Crypter): __name__ = "ShareLinksBiz" __type__ = "crypter" - __version__ = "1.17" + __version__ = "1.18" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P_?\w+)' @@ -131,7 +131,7 @@ class ShareLinksBiz(Crypter): href = self._resolve_coords(coords, captchaMap) if href is None: self.captcha.invalid() - self.retry(wait_time=5) + self.retry(delay=5) url = self.base_url + href self.html = self.load(url) @@ -161,7 +161,7 @@ class ShareLinksBiz(Crypter): if self.captcha: if "Your choice was wrong" in self.html: self.captcha.invalid() - self.retry(wait_time=5) + self.retry(delay=5) else: self.captcha.correct() -- cgit v1.2.3 From 25d5726d4953b93a2e286fd6af8d4ead20670ba6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 1 Oct 2015 04:55:17 +0200 Subject: A lot of plugin code cosmetics --- module/plugins/crypter/ShareLinksBiz.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 3316aea56..e372d7c6a 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -66,14 +66,18 @@ class ShareLinksBiz(Crypter): def init_file(self, pyfile): url = pyfile.url + if 's2l.biz' in url: url = self.load(url, just_header=True)['location'] + if re.match(self.__pattern__, url): self.base_url = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1) self.file_id = re.match(self.__pattern__, url).group('ID') + else: self.log_debug("Could not initialize, URL [%s] does not match pattern [%s]" % (url, self.__pattern__)) - self.fail("Unsupported download link") + self.fail(_("Unsupported download link")) + self.package = pyfile.package() @@ -81,7 +85,8 @@ class ShareLinksBiz(Crypter): if "No usable content was found" in self.html: self.log_debug("File not found") return False - return True + else: + return True def is_password_protected(self): @@ -121,7 +126,8 @@ class ShareLinksBiz(Crypter): m = re.search(r'(.*)' m = re.search(title_re, self.html, re.S) - if m: + if m is not None: title = m.group(1).strip() if 'unnamed' not in title: name = folder = title -- cgit v1.2.3