diff options
Diffstat (limited to 'module/plugins/hoster/FreakshareCom.py')
-rw-r--r-- | module/plugins/hoster/FreakshareCom.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index 53fc839ad..e32264fae 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -35,7 +35,7 @@ class FreakshareCom(Hoster): pyfile.url = pyfile.url.replace("freakshare.net/", "freakshare.com/") if self.account: - self.html = self.load(pyfile.url, cookies=False) + self.data = self.load(pyfile.url, cookies=False) pyfile.name = self.get_file_name() self.download(pyfile.url) @@ -90,14 +90,14 @@ class FreakshareCom(Hoster): 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) + self.data = self.load(self.pyfile.url) def get_file_url(self): """ Returns the absolute downloadable filepath """ - if not self.html: + 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 @@ -108,11 +108,11 @@ class FreakshareCom(Hoster): def get_file_name(self): - if not self.html: + if not self.data: self.download_html() if not self.wantReconnect: - m = re.search(r"<h1\sclass=\"box_heading\"\sstyle=\"text-align:center;\">([^ ]+)", self.html) + m = re.search(r"<h1\sclass=\"box_heading\"\sstyle=\"text-align:center;\">([^ ]+)", self.data) if m is not None: file_name = m.group(1) else: @@ -125,11 +125,11 @@ class FreakshareCom(Hoster): def get_file_size(self): size = 0 - if not self.html: + if not self.data: self.download_html() if not self.wantReconnect: - m = re.search(r"<h1\sclass=\"box_heading\"\sstyle=\"text-align:center;\">[^ ]+ - ([^ ]+) (\w\w)yte", self.html) + m = re.search(r"<h1\sclass=\"box_heading\"\sstyle=\"text-align:center;\">[^ ]+ - ([^ ]+) (\w\w)yte", self.data) if m is not None: units = float(m.group(1).replace(",", "")) pow = {'KB': 1, 'MB': 2, 'GB': 3}[m.group(2)] @@ -139,14 +139,14 @@ class FreakshareCom(Hoster): def get_waiting_time(self): - if not self.html: + if not self.data: self.download_html() - if "Your Traffic is used up for today" in self.html: + if "Your Traffic is used up for today" in self.data: self.wantReconnect = True return seconds_to_midnight() - 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.data) if timestring: return int(timestring.group(1)) else: @@ -157,9 +157,9 @@ class FreakshareCom(Hoster): """ Returns True or False """ - if not self.html: + if not self.data: self.download_html() - if re.search(r"This file does not exist!", self.html): + if re.search(r"This file does not exist!", self.data): return False else: return True @@ -167,7 +167,7 @@ class FreakshareCom(Hoster): def get_download_options(self): re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?</form>", - self.html).group(0) #: Get the whole request + self.data).group(0) #: Get the whole request to_sort = re.findall(r"<input\stype=\"hidden\"\svalue=\"(.*?)\"\sname=\"(.*?)\"\s\/>", re_envelope) request_options = dict((n, v) for (v, n) in to_sort) |