From fd105f8e51768ec1943cda2375bdfdbe5b0a3951 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 00:35:51 +0100 Subject: "New Year" Update: hoster plugins --- module/plugins/hoster/CatShareNet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/CatShareNet.py') diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index 949a021dd..f2ddd64a0 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class CatShareNet(SimpleHoster): __name__ = "CatShareNet" __type__ = "hoster" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'http://(?:www\.)?catshare\.net/\w{16}' @@ -27,7 +27,7 @@ class CatShareNet(SimpleHoster): IP_BLOCKED_PATTERN = ur'>Nasz serwis wykrył że Twój adres IP nie pochodzi z Polski.<' SECONDS_PATTERN = 'var\scount\s=\s(\d+);' - LINK_PATTERN = r'
' + LINK_FREE_PATTERN = r'' def setup(self): @@ -42,7 +42,7 @@ class CatShareNet(SimpleHoster): return super(CatShareNet, self).getFileInfo() - def handleFree(self): + def handleFree(self, pyfile): m = re.search(self.SECONDS_PATTERN, self.html) if m: wait_time = int(m.group(1)) @@ -51,11 +51,11 @@ class CatShareNet(SimpleHoster): recaptcha = ReCaptcha(self) challenge, response = recaptcha.challenge() - self.html = self.load(self.pyfile.url, + self.html = self.load(pyfile.url, post={'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response}) - m = re.search(self.LINK_PATTERN, self.html) + m = re.search(self.LINK_FREE_PATTERN, self.html) if m is None: self.invalidCaptcha() self.retry(reason=_("Wrong captcha entered")) -- cgit v1.2.3 From b6a4059b19d827b044d096d2ca9ddab2fb96997d Mon Sep 17 00:00:00 2001 From: rukasuzu Date: Sat, 17 Jan 2015 20:00:26 +0100 Subject: [CatShareNet] Added premium account handler --- module/plugins/hoster/CatShareNet.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'module/plugins/hoster/CatShareNet.py') diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index f2ddd64a0..19598a092 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -28,6 +28,7 @@ class CatShareNet(SimpleHoster): IP_BLOCKED_PATTERN = ur'>Nasz serwis wykrył że Twój adres IP nie pochodzi z Polski.<' SECONDS_PATTERN = 'var\scount\s=\s(\d+);' LINK_FREE_PATTERN = r'' + LINK_PREMIUM_PATTERN = r'' def setup(self): @@ -41,6 +42,14 @@ class CatShareNet(SimpleHoster): self.fail(_("Only connections from Polish IP address are allowed")) return super(CatShareNet, self).getFileInfo() + def handlePremium(self): + m = re.search(self.LINK_PREMIUM_PATTERN, self.html) + if m is None: + self.fail(_("File not found")) + + dl_link = m.group(1) + self.download(dl_link, disposition=True) + def handleFree(self, pyfile): m = re.search(self.SECONDS_PATTERN, self.html) -- cgit v1.2.3 From 70cc18ec1552c580b8e53737a32f7324720d67dc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 18 Jan 2015 11:59:32 +0100 Subject: [CatShareNet] Update --- module/plugins/hoster/CatShareNet.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'module/plugins/hoster/CatShareNet.py') diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index 19598a092..ba8996193 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class CatShareNet(SimpleHoster): __name__ = "CatShareNet" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?catshare\.net/\w{16}' @@ -26,9 +26,9 @@ class CatShareNet(SimpleHoster): OFFLINE_PATTERN = ur'Podany plik został usunięty\s*' IP_BLOCKED_PATTERN = ur'>Nasz serwis wykrył że Twój adres IP nie pochodzi z Polski.<' - SECONDS_PATTERN = 'var\scount\s=\s(\d+);' - LINK_FREE_PATTERN = r'' - LINK_PREMIUM_PATTERN = r'' + WAIT_PATTERN = r'var\scount\s=\s(\d+);' + + LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'' def setup(self): @@ -42,21 +42,8 @@ class CatShareNet(SimpleHoster): self.fail(_("Only connections from Polish IP address are allowed")) return super(CatShareNet, self).getFileInfo() - def handlePremium(self): - m = re.search(self.LINK_PREMIUM_PATTERN, self.html) - if m is None: - self.fail(_("File not found")) - - dl_link = m.group(1) - self.download(dl_link, disposition=True) - def handleFree(self, pyfile): - m = re.search(self.SECONDS_PATTERN, self.html) - if m: - wait_time = int(m.group(1)) - self.wait(wait_time, True) - recaptcha = ReCaptcha(self) challenge, response = recaptcha.challenge() -- cgit v1.2.3 From cf4ded052964047de88d676045329b8fa4fca2dc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 22 Jan 2015 21:31:19 +0100 Subject: Update plugins after CaptchaService changes --- module/plugins/hoster/CatShareNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/CatShareNet.py') diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index ba8996193..339253aeb 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class CatShareNet(SimpleHoster): __name__ = "CatShareNet" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" __pattern__ = r'http://(?:www\.)?catshare\.net/\w{16}' @@ -46,7 +46,7 @@ class CatShareNet(SimpleHoster): def handleFree(self, pyfile): recaptcha = ReCaptcha(self) - challenge, response = recaptcha.challenge() + response, challenge = recaptcha.challenge() self.html = self.load(pyfile.url, post={'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response}) -- cgit v1.2.3 From 6616c00ba1c40f5d56959bd0e4725f26250e1292 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 9 Feb 2015 17:42:31 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/CatShareNet.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/CatShareNet.py') diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index 339253aeb..125e63481 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -56,8 +56,7 @@ class CatShareNet(SimpleHoster): self.invalidCaptcha() self.retry(reason=_("Wrong captcha entered")) - dl_link = m.group(1) - self.download(dl_link, disposition=True) + self.link = m.group(1) getInfo = create_getInfo(CatShareNet) -- cgit v1.2.3 From 7e08d4ccdc0547d223605b3c0aac6d57cc696e19 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 20 Mar 2015 23:25:03 +0100 Subject: [CatShareNet] getFileInfo -> checkErrors --- module/plugins/hoster/CatShareNet.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/CatShareNet.py') diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index 125e63481..bda9d27ae 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class CatShareNet(SimpleHoster): __name__ = "CatShareNet" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" __pattern__ = r'http://(?:www\.)?catshare\.net/\w{16}' @@ -36,11 +36,12 @@ class CatShareNet(SimpleHoster): self.resumeDownload = True - def getFileInfo(self): + def checkErrors(self): m = re.search(self.IP_BLOCKED_PATTERN, self.html) if m: self.fail(_("Only connections from Polish IP address are allowed")) - return super(CatShareNet, self).getFileInfo() + + return super(CatShareNet, self).checkErrors() def handleFree(self, pyfile): -- cgit v1.2.3 From 7d90803262ccbb4fc5296a4dc3ce30fe98f55631 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 25 Mar 2015 23:10:07 +0100 Subject: __config__ cosmetics --- module/plugins/hoster/CatShareNet.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/CatShareNet.py') diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index bda9d27ae..ec9c62a23 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -12,6 +12,7 @@ class CatShareNet(SimpleHoster): __version__ = "0.12" __pattern__ = r'http://(?:www\.)?catshare\.net/\w{16}' + __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """CatShare.net hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 58980accb36660d200d2239f7c801173ec899b56 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Apr 2015 14:22:26 +0200 Subject: [CatShareNet] https://github.com/pyload/pyload/issues/1325 --- module/plugins/hoster/CatShareNet.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster/CatShareNet.py') diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index ec9c62a23..9e3f28cfa 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class CatShareNet(SimpleHoster): __name__ = "CatShareNet" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __pattern__ = r'http://(?:www\.)?catshare\.net/\w{16}' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -24,12 +24,13 @@ class CatShareNet(SimpleHoster): TEXT_ENCODING = True INFO_PATTERN = r'(?P<N>.+) \((?P<S>[\d.,]+) (?P<U>[\w^_]+)\)<' - OFFLINE_PATTERN = ur'Podany plik został usunięty\s*</div>' + OFFLINE_PATTERN = r'<div class="alert alert-error"' IP_BLOCKED_PATTERN = ur'>Nasz serwis wykrył że Twój adres IP nie pochodzi z Polski.<' WAIT_PATTERN = r'var\scount\s=\s(\d+);' - LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'<form action="(.+?)" method="GET">' + LINK_FREE_PATTERN = r'<form action="(.+?)" method="GET">' + LINK_PREMIUM_PATTERN = r'<form action="(.+?)" method="GET">' def setup(self): @@ -54,11 +55,8 @@ class CatShareNet(SimpleHoster): 'recaptcha_response_field' : response}) m = re.search(self.LINK_FREE_PATTERN, self.html) - if m is None: - self.invalidCaptcha() - self.retry(reason=_("Wrong captcha entered")) - - self.link = m.group(1) + if m: + self.link = m.group(1) getInfo = create_getInfo(CatShareNet) -- cgit v1.2.3 From 14600aa22812176c4f61ffcfd4ae3b0ee62ae368 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@users.noreply.github.com> Date: Mon, 18 May 2015 05:25:09 +0200 Subject: Spare plugins updates --- module/plugins/hoster/CatShareNet.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'module/plugins/hoster/CatShareNet.py') diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index 9e3f28cfa..868be4033 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -9,7 +9,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class CatShareNet(SimpleHoster): __name__ = "CatShareNet" __type__ = "hoster" - __version__ = "0.13" + __version__ = "0.14" __pattern__ = r'http://(?:www\.)?catshare\.net/\w{16}' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -38,14 +38,6 @@ class CatShareNet(SimpleHoster): self.resumeDownload = True - def checkErrors(self): - m = re.search(self.IP_BLOCKED_PATTERN, self.html) - if m: - self.fail(_("Only connections from Polish IP address are allowed")) - - return super(CatShareNet, self).checkErrors() - - def handleFree(self, pyfile): recaptcha = ReCaptcha(self) -- cgit v1.2.3