From 32fa7cd3638684605195d3a879d9c5adfe42d50f Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Sat, 21 Apr 2012 01:14:51 +0200 Subject: fix freakshare with python < 2.7 --- module/plugins/hoster/FreakshareCom.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/hoster/FreakshareCom.py') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index a36fe7207..cd939b177 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -9,7 +9,7 @@ class FreakshareCom(Hoster): __name__ = "FreakshareCom" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?freakshare\.(net|com)/files/\S*?/" - __version__ = "0.34" + __version__ = "0.35" __description__ = """Freakshare.com Download Hoster""" __author_name__ = ("sitacuisses","spoob","mkaay") __author_mail__ = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de") @@ -37,14 +37,17 @@ class FreakshareCom(Hoster): check = self.checkDownload({"bad": "bad try", - "paralell": "> Sorry, you cant download more then 1 files at time. <"}) + "paralell": "> Sorry, you cant download more then 1 files at time. <", + "empty": "Warning: Unknown: Filename cannot be empty"}) if check == "bad": self.fail("Bad Try.") if check == "paralell": self.setWait(300, True) self.wait() - self.retry() + self.retry() + if check == "empty": + self.fail("File not downloadable") def prepare(self): pyfile = self.pyfile @@ -116,10 +119,7 @@ class FreakshareCom(Hoster): if re.search(r"This file does not exist!", self.html) is not None: self.offline() - timestring = re.search('\s*var\sdownloadWait\s=\s(\d*);', self.html) - if timestring: - return int(timestring.group(1)) + 1 #add 1 sec as tenths of seconds are cut off - timestring = re.search('\s*var\stime\s=\s(\d*)[.0];', 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: @@ -139,7 +139,7 @@ class FreakshareCom(Hoster): 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 to_sort = re.findall(r"", re_envelope) - request_options = {n: v for v, n in to_sort} + request_options = dict((n, v) for (v, n) in to_sort) herewego = self.load(self.pyfile.url, None, request_options) # the actual download-Page @@ -148,7 +148,7 @@ class FreakshareCom(Hoster): # fp.write(herewego) to_sort = re.findall(r"", herewego) - request_options = {n: v for v, n in to_sort} + 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]) -- cgit v1.2.3