From 430092f0ba67e4bb2dd75433b08340d0afca0fa9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 12 Dec 2014 20:34:42 +0100 Subject: Update plugins after SimpleHoster changes --- module/plugins/hoster/FilerNet.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index c943a076d..5dd72efe7 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -15,7 +15,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -25,8 +25,6 @@ class FilerNet(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - CONTENT_DISPOSITION = True - INFO_PATTERN = r'

Free Download (?P\S+) (?P[\w.]+) (?P[\w^_]+)

' OFFLINE_PATTERN = r'Nicht gefunden' @@ -66,16 +64,17 @@ class FilerNet(SimpleHoster): if 'location' in header and header['location']: self.correctCaptcha() - self.link = urljoin('http://filer.net', header['location']) + self.link = header['location'] return else: self.invalidCaptcha() - def handlePremium(self): - super(FilerNet, self).handlePremium() - if self.link: - self.link = urljoin("http://filer.net/", self.link) + def downloadLink(self, link): + if not link: + return + + self.download(urljoin("http://filer.net/", link), disposition=True) getInfo = create_getInfo(FilerNet) -- cgit v1.2.3 From 3d27f5ccee412d38102873a5b02e3f236375eb97 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Dec 2014 03:44:15 +0100 Subject: Update plugins (2) --- module/plugins/hoster/FilerNet.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 5dd72efe7..5a33439d2 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -4,6 +4,7 @@ # http://filer.net/get/ivgf5ztw53et3ogd # http://filer.net/get/hgo14gzcng3scbvv +import pycurl import re from urlparse import urljoin @@ -15,13 +16,13 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' __description__ = """Filer.net hoster plugin""" __license__ = "GPLv3" - __authors__ = [("stickell", "l.stickell@yahoo.it") + __authors__ = [("stickell", "l.stickell@yahoo.it"), ("Walter Purcaro", "vuolter@gmail.com")] @@ -57,15 +58,18 @@ class FilerNet(SimpleHoster): for _i in xrange(5): challenge, response = recaptcha.challenge() - header = self.load(self.pyfile.url, - post={'recaptcha_challenge_field': challenge, - 'recaptcha_response_field' : response, - 'hash' : inputs['hash']}) + #@NOTE: Work-around for v0.4.9 just_header issue + #@TODO: Check for v0.4.10 + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) + self.load(self.pyfile.url, post={'recaptcha_challenge_field': challenge, + 'recaptcha_response_field' : response, + 'hash' : inputs['hash']})) + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) - if 'location' in header and header['location']: + if 'location' in self.req.http.header.lower(): + self.link = re.search(r'location: (\S+)', self.req.http.header, re.I).group(1) self.correctCaptcha() - self.link = header['location'] - return + break else: self.invalidCaptcha() -- cgit v1.2.3 From aab32f731e0b5c996004312ee8862fe30cbd6b89 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 02:40:59 +0100 Subject: [FilerNet] Typo --- module/plugins/hoster/FilerNet.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 5a33439d2..2a38ac470 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -63,7 +63,7 @@ class FilerNet(SimpleHoster): self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) self.load(self.pyfile.url, post={'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response, - 'hash' : inputs['hash']})) + 'hash' : inputs['hash']}) self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) if 'location' in self.req.http.header.lower(): @@ -75,10 +75,8 @@ class FilerNet(SimpleHoster): def downloadLink(self, link): - if not link: - return - - self.download(urljoin("http://filer.net/", link), disposition=True) + if link and isinstance(link, basestring): + self.download(urljoin("http://filer.net/", link), disposition=True) getInfo = create_getInfo(FilerNet) -- cgit v1.2.3 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/FilerNet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 2a38ac470..159aab964 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -42,12 +42,12 @@ class FilerNet(SimpleHoster): self.info.pop('error', None) - def handleFree(self): + def handleFree(self, pyfile): inputs = self.parseHtmlForm(input_names={'token': re.compile(r'.+')})[1] if 'token' not in inputs: self.error(_("Unable to detect token")) - self.html = self.load(self.pyfile.url, post={'token': inputs['token']}, decode=True) + self.html = self.load(pyfile.url, post={'token': inputs['token']}, decode=True) inputs = self.parseHtmlForm(input_names={'hash': re.compile(r'.+')})[1] if 'hash' not in inputs: @@ -61,7 +61,7 @@ class FilerNet(SimpleHoster): #@NOTE: Work-around for v0.4.9 just_header issue #@TODO: Check for v0.4.10 self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) - self.load(self.pyfile.url, post={'recaptcha_challenge_field': challenge, + self.load(pyfile.url, post={'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response, 'hash' : inputs['hash']}) self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) -- cgit v1.2.3 From 56db4681e9dfa77b1e616d600d19ba98c915fef9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 13 Jan 2015 01:47:03 +0100 Subject: [FilerNet] Code cosmetics --- module/plugins/hoster/FilerNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 159aab964..a668a834b 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -62,8 +62,8 @@ class FilerNet(SimpleHoster): #@TODO: Check for v0.4.10 self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) self.load(pyfile.url, post={'recaptcha_challenge_field': challenge, - 'recaptcha_response_field' : response, - 'hash' : inputs['hash']}) + 'recaptcha_response_field' : response, + 'hash' : inputs['hash']}) self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) if 'location' in self.req.http.header.lower(): -- 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/FilerNet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index a668a834b..f0b37e4cb 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.13" + __version__ = "0.14" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -56,7 +56,7 @@ class FilerNet(SimpleHoster): recaptcha = ReCaptcha(self) for _i in xrange(5): - challenge, response = recaptcha.challenge() + response, challenge = recaptcha.challenge() #@NOTE: Work-around for v0.4.9 just_header issue #@TODO: Check for v0.4.10 -- cgit v1.2.3 From 031d86706aa13270793e31c21ad3f386ca62752b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 24 Jan 2015 03:50:33 +0100 Subject: Spare code improvements --- module/plugins/hoster/FilerNet.py | 43 ++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index f0b37e4cb..53fa2bda1 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.14" + __version__ = "0.15" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -53,30 +53,23 @@ class FilerNet(SimpleHoster): if 'hash' not in inputs: self.error(_("Unable to detect hash")) - recaptcha = ReCaptcha(self) - - for _i in xrange(5): - response, challenge = recaptcha.challenge() - - #@NOTE: Work-around for v0.4.9 just_header issue - #@TODO: Check for v0.4.10 - self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) - self.load(pyfile.url, post={'recaptcha_challenge_field': challenge, - 'recaptcha_response_field' : response, - 'hash' : inputs['hash']}) - self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) - - if 'location' in self.req.http.header.lower(): - self.link = re.search(r'location: (\S+)', self.req.http.header, re.I).group(1) - self.correctCaptcha() - break - else: - self.invalidCaptcha() - - - def downloadLink(self, link): - if link and isinstance(link, basestring): - self.download(urljoin("http://filer.net/", link), disposition=True) + recaptcha = ReCaptcha(self) + response, challenge = recaptcha.challenge() + + #@NOTE: Work-around for v0.4.9 just_header issue + #@TODO: Check for v0.4.10 + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) + self.load(pyfile.url, post={'recaptcha_challenge_field': challenge, + 'recaptcha_response_field' : response, + 'hash' : inputs['hash']}) + self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) + + if 'location' in self.req.http.header.lower(): + self.link = re.search(r'location: (\S+)', self.req.http.header, re.I).group(1) + self.correctCaptcha() + break + else: + self.invalidCaptcha() getInfo = create_getInfo(FilerNet) -- cgit v1.2.3 From 95a72c40b34e2facb2aa693f164abd83e55b31ce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 27 Jan 2015 01:21:11 +0100 Subject: [FilerNet] Fix typo --- module/plugins/hoster/FilerNet.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hoster/FilerNet.py') diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index 53fa2bda1..c5007e945 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -16,7 +16,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -67,7 +67,6 @@ class FilerNet(SimpleHoster): if 'location' in self.req.http.header.lower(): self.link = re.search(r'location: (\S+)', self.req.http.header, re.I).group(1) self.correctCaptcha() - break else: self.invalidCaptcha() -- cgit v1.2.3