From 0072668fd976f9ce4dbaac7e807791f21cbe07ed Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 6 Jul 2014 18:57:55 +0200 Subject: Compute wait time using secondsToMidnight --- module/plugins/hoster/FreakshareCom.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index ad9abeb96..5b043d53d 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- import re + from module.plugins.Hoster import Hoster +from module.plugins.hoster.UnrestrictLi import secondsToMidnight from module.plugins.internal.CaptchaService import ReCaptcha @@ -9,7 +11,7 @@ class FreakshareCom(Hoster): __name__ = "FreakshareCom" __type__ = "hoster" __pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/' - __version__ = "0.38" + __version__ = "0.39" __description__ = """Freakshare.com hoster plugin""" __author_name__ = ("sitacuisses", "spoob", "mkaay", "Toilal") __author_mail__ = ("sitacuisses@yahoo.de", "spoob@pyload.org", "mkaay@mkaay.de", "toilal.dev@gmail.com") @@ -122,7 +124,7 @@ class FreakshareCom(Hoster): if "Your Traffic is used up for today" in self.html: self.wantReconnect = True - return 24 * 60 * 60 + return secondsToMidnight(gmt=2) timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[.\d]*;', self.html) if timestring: -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/hoster/FreakshareCom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 5b043d53d..ddb5a9ec0 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -82,7 +82,7 @@ class FreakshareCom(Hoster): def get_file_url(self): """ returns the absolute downloadable filepath """ - if self.html is None: + if not self.html: self.download_html() if not self.wantReconnect: self.req_opts = self.get_download_options() # get the Post options for the Request @@ -92,7 +92,7 @@ class FreakshareCom(Hoster): self.offline() def get_file_name(self): - if self.html is None: + if not self.html: self.download_html() if not self.wantReconnect: file_name = re.search(r"([^ ]+)", self.html) @@ -106,7 +106,7 @@ class FreakshareCom(Hoster): def get_file_size(self): size = 0 - if self.html is None: + if not self.html: self.download_html() if not self.wantReconnect: file_size_check = re.search( @@ -119,7 +119,7 @@ class FreakshareCom(Hoster): return size def get_waiting_time(self): - if self.html is None: + if not self.html: self.download_html() if "Your Traffic is used up for today" in self.html: @@ -135,7 +135,7 @@ class FreakshareCom(Hoster): def file_exists(self): """ returns True or False """ - if self.html is None: + if not self.html: self.download_html() if re.search(r"This file does not exist!", self.html) is not None: return False -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/FreakshareCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index ddb5a9ec0..ff1056c9f 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -164,7 +164,7 @@ class FreakshareCom(Hoster): if challenge: re_captcha = ReCaptcha(self) - (request_options["recaptcha_challenge_field"], - request_options["recaptcha_response_field"]) = re_captcha.challenge(challenge.group(1)) + (request_options['recaptcha_challenge_field'], + request_options['recaptcha_response_field']) = re_captcha.challenge(challenge.group(1)) return request_options -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/FreakshareCom.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index ff1056c9f..1b042bde3 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -10,12 +10,15 @@ from module.plugins.internal.CaptchaService import ReCaptcha class FreakshareCom(Hoster): __name__ = "FreakshareCom" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/' __version__ = "0.39" + + __pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/' + __description__ = """Freakshare.com hoster plugin""" __author_name__ = ("sitacuisses", "spoob", "mkaay", "Toilal") __author_mail__ = ("sitacuisses@yahoo.de", "spoob@pyload.org", "mkaay@mkaay.de", "toilal.dev@gmail.com") + def setup(self): self.multiDL = False self.req_opts = [] @@ -164,7 +167,7 @@ class FreakshareCom(Hoster): if challenge: re_captcha = ReCaptcha(self) - (request_options['recaptcha_challenge_field'], + (request_options['recaptcha_challenge_field'], request_options['recaptcha_response_field']) = re_captcha.challenge(challenge.group(1)) return request_options -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/FreakshareCom.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 1b042bde3..51c1b5907 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -15,8 +15,10 @@ class FreakshareCom(Hoster): __pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/' __description__ = """Freakshare.com hoster plugin""" - __author_name__ = ("sitacuisses", "spoob", "mkaay", "Toilal") - __author_mail__ = ("sitacuisses@yahoo.de", "spoob@pyload.org", "mkaay@mkaay.de", "toilal.dev@gmail.com") + __authors__ = [("sitacuisses", "sitacuisses@yahoo.de"), + ("spoob", "spoob@pyload.org"), + ("mkaay", "mkaay@mkaay.de"), + ("Toilal", "toilal.dev@gmail.com")] def setup(self): -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/FreakshareCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 51c1b5907..808ca1ab0 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -15,6 +15,7 @@ class FreakshareCom(Hoster): __pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/' __description__ = """Freakshare.com hoster plugin""" + __license__ = "GPLv3" __authors__ = [("sitacuisses", "sitacuisses@yahoo.de"), ("spoob", "spoob@pyload.org"), ("mkaay", "mkaay@mkaay.de"), -- cgit v1.2.3 From f76e5c2336718dca9da8033ba22cd83c72c7b3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:14:28 +0200 Subject: Pattern update 1 --- module/plugins/hoster/FreakshareCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 808ca1ab0..df06f2e74 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -132,7 +132,7 @@ class FreakshareCom(Hoster): self.wantReconnect = True return secondsToMidnight(gmt=2) - timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[.\d]*;', self.html) + timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[\d.]*;', self.html) if timestring: return int(timestring.group(1)) + 1 # add 1 sec as tenths of seconds are cut off else: @@ -166,7 +166,7 @@ class FreakshareCom(Hoster): # comment this in, when it doesnt work as well #print "\n\n%s\n\n" % ";".join(["%s=%s" % x for x in to_sort]) - challenge = re.search(r"http://api\.recaptcha\.net/challenge\?k=([0-9A-Za-z]+)", herewego) + challenge = re.search(r"http://api\.recaptcha\.net/challenge\?k=(\w+)", herewego) if challenge: re_captcha = ReCaptcha(self) -- cgit v1.2.3 From 0eb6e7ec4a1144dcca824d8add049787d3da1762 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Oct 2014 19:44:59 +0200 Subject: Two space before function declaration --- module/plugins/hoster/FreakshareCom.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index df06f2e74..6287545cb 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -26,6 +26,7 @@ class FreakshareCom(Hoster): self.multiDL = False self.req_opts = [] + def process(self, pyfile): self.pyfile = pyfile @@ -62,6 +63,7 @@ class FreakshareCom(Hoster): elif check == "downloadserver": self.retry(5, 15 * 60, "No Download server") + def prepare(self): pyfile = self.pyfile @@ -81,10 +83,12 @@ class FreakshareCom(Hoster): return True + def download_html(self): self.load("http://freakshare.com/index.php", {"language": "EN"}) # Set english language in server session self.html = self.load(self.pyfile.url) + def get_file_url(self): """ returns the absolute downloadable filepath """ @@ -97,6 +101,7 @@ class FreakshareCom(Hoster): else: self.offline() + def get_file_name(self): if not self.html: self.download_html() @@ -110,6 +115,7 @@ class FreakshareCom(Hoster): else: return self.pyfile.url + def get_file_size(self): size = 0 if not self.html: @@ -124,6 +130,7 @@ class FreakshareCom(Hoster): return size + def get_waiting_time(self): if not self.html: self.download_html() @@ -138,6 +145,7 @@ class FreakshareCom(Hoster): else: return 60 + def file_exists(self): """ returns True or False """ @@ -148,6 +156,7 @@ class FreakshareCom(Hoster): else: return True + def get_download_options(self): re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?", self.html).group(0) # get the whole request -- cgit v1.2.3 From 9f2ebe486a3e155fb6a60e07cccb77ab6a772eb2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:31:54 +0200 Subject: Extend translation support in plugins + a lot of code cosmetics and typo fixes --- module/plugins/hoster/FreakshareCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 6287545cb..529b107d3 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -50,13 +50,13 @@ class FreakshareCom(Hoster): "downloadserver": "No Downloadserver. Please try again later!"}) if check == "bad": - self.fail("Bad Try.") + self.fail(_("Bad Try")) elif check == "paralell": self.setWait(300, True) self.wait() self.retry() elif check == "empty": - self.fail("File not downloadable") + self.fail(_("File not downloadable")) elif check == "wrong_captcha": self.invalidCaptcha() self.retry() -- cgit v1.2.3 From 146fe1e309c33ab149bfaf58ad86c0dd4fb9b156 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 27 Oct 2014 01:18:45 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/FreakshareCom.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 529b107d3..35c7aa253 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -172,9 +172,6 @@ class FreakshareCom(Hoster): to_sort = re.findall(r"", herewego) request_options = dict((n, v) for (v, n) in to_sort) - # comment this in, when it doesnt work as well - #print "\n\n%s\n\n" % ";".join(["%s=%s" % x for x in to_sort]) - challenge = re.search(r"http://api\.recaptcha\.net/challenge\?k=(\w+)", herewego) if challenge: -- cgit v1.2.3 From 8b3589dd394d81177bf4680dddb5bdb9506b89ea Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:04:10 +0100 Subject: Update plugins to last changes --- module/plugins/hoster/FreakshareCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 35c7aa253..5d69f0a1b 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -61,7 +61,7 @@ class FreakshareCom(Hoster): self.invalidCaptcha() self.retry() elif check == "downloadserver": - self.retry(5, 15 * 60, "No Download server") + self.retry(5, 15 * 60, _("No Download server")) def prepare(self): @@ -141,7 +141,7 @@ class FreakshareCom(Hoster): timestring = re.search('\s*var\s(?:downloadWait|time)\s=\s(\d*)[\d.]*;', self.html) if timestring: - return int(timestring.group(1)) + 1 # add 1 sec as tenths of seconds are cut off + return int(timestring.group(1)) else: return 60 -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/FreakshareCom.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 5d69f0a1b..9d5efbf7d 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -8,18 +8,18 @@ from module.plugins.internal.CaptchaService import ReCaptcha class FreakshareCom(Hoster): - __name__ = "FreakshareCom" - __type__ = "hoster" + __name__ = "FreakshareCom" + __type__ = "hoster" __version__ = "0.39" __pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/' __description__ = """Freakshare.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("sitacuisses", "sitacuisses@yahoo.de"), - ("spoob", "spoob@pyload.org"), - ("mkaay", "mkaay@mkaay.de"), - ("Toilal", "toilal.dev@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("sitacuisses", "sitacuisses@yahoo.de"), + ("spoob", "spoob@pyload.org"), + ("mkaay", "mkaay@mkaay.de"), + ("Toilal", "toilal.dev@gmail.com")] def setup(self): -- cgit v1.2.3 From 77269c8c78fcf7bd7a8ddbdbfc972043263fea46 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 6 Nov 2014 03:33:31 +0100 Subject: Code cosmetics --- module/plugins/hoster/FreakshareCom.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 9d5efbf7d..1a811b007 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -67,8 +67,6 @@ class FreakshareCom(Hoster): def prepare(self): pyfile = self.pyfile - self.wantReconnect = False - self.download_html() if not self.file_exists(): -- cgit v1.2.3 From 52664e6fe8dd99fc9bb78ea8cf158c17705b6ded Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 5 Dec 2014 19:18:11 +0100 Subject: Fix with statement on old env like python 2.5 (2) --- module/plugins/hoster/FreakshareCom.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 1a811b007..00c31c528 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -163,10 +163,6 @@ class FreakshareCom(Hoster): herewego = self.load(self.pyfile.url, None, request_options) # the actual download-Page - # comment this in, when it doesnt work - # with open("DUMP__FS_.HTML", "w") as fp: - # fp.write(herewego) - to_sort = re.findall(r"", herewego) request_options = dict((n, v) for (v, n) in to_sort) -- cgit v1.2.3 From b6a2bd53628bd2824bac1dafc7b4eafdf3c815dd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:48:03 +0100 Subject: Update plugins after SimpleHoster changes --- module/plugins/hoster/FreakshareCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 00c31c528..2238f07ef 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -3,14 +3,14 @@ import re from module.plugins.Hoster import Hoster -from module.plugins.hoster.UnrestrictLi import secondsToMidnight from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.SimpleHoster import secondsToMidnight class FreakshareCom(Hoster): __name__ = "FreakshareCom" __type__ = "hoster" - __version__ = "0.39" + __version__ = "0.40" __pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/' -- cgit v1.2.3