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