diff options
Diffstat (limited to 'module/plugins/hoster/FreakshareCom.py')
-rw-r--r-- | module/plugins/hoster/FreakshareCom.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index ad9abeb96..1b042bde3 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -1,19 +1,24 @@ # -*- 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 class FreakshareCom(Hoster): __name__ = "FreakshareCom" __type__ = "hoster" + __version__ = "0.39" + __pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/' - __version__ = "0.38" + __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 = [] @@ -80,7 +85,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 @@ -90,7 +95,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"<h1\sclass=\"box_heading\"\sstyle=\"text-align:center;\">([^ ]+)", self.html) @@ -104,7 +109,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( @@ -117,12 +122,12 @@ 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: 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: @@ -133,7 +138,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 @@ -162,7 +167,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 |