# -*- coding: utf-8 -*- import re from module.plugins.internal.Hoster import Hoster from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import seconds_to_midnight class FreakshareCom(Hoster): __name__ = "FreakshareCom" __type__ = "hoster" __version__ = "0.46" __status__ = "testing" __pattern__ = r'http://(?:www\.)?freakshare\.(net|com)/files/\S*?/' __config__ = [("activated", "bool", "Activated", True)] __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")] def setup(self): self.multiDL = False self.req_opts = [] def process(self, pyfile): self.pyfile = pyfile pyfile.url = pyfile.url.replace("freakshare.net/", "freakshare.com/") if self.account: self.data = self.load(pyfile.url, cookies=False) pyfile.name = self.get_file_name() self.download(pyfile.url) else: self.prepare() self.get_file_url() self.download(pyfile.url, post=self.req_opts) check = self.check_file({ 'bad' : "bad try", 'paralell' : "> Sorry, you cant download more then 1 files at time. <", 'empty' : "Warning: Unknown: Filename cannot be empty", 'wrong_captcha' : "Wrong Captcha!", 'downloadserver': "No Downloadserver. Please try again later!" }) if check == "bad": self.fail(_("Bad Try")) elif check == "paralell": self.wait(300, True) self.retry() elif check == "empty": self.fail(_("File not downloadable")) elif check == "wrong_captcha": self.retry_captcha() elif check == "downloadserver": self.retry(5, 15 * 60, _("No Download server")) def prepare(self): pyfile = self.pyfile self.download_html() if not self.file_exists(): self.offline() self.set_wait(self.get_waiting_time()) pyfile.name = self.get_file_name() pyfile.size = self.get_file_size() self.wait() return True def download_html(self): self.load("http://freakshare.com/index.php", {'language': "EN"}) #: Set english language in server session self.data = self.load(self.pyfile.url) def get_file_url(self): """ Returns the absolute downloadable filepath """ if not self.data: self.download_html() if not self.wantReconnect: self.req_opts = self.get_download_options() #: Get the Post options for the Request # file_url = self.pyfile.url # return file_url else: self.offline() def get_file_name(self): if not self.data: self.download_html() if not self.wantReconnect: m = re.search(r"