From be28952d0328539918a079a3625bf01d679769ed Mon Sep 17 00:00:00 2001 From: Jeix Date: Wed, 13 Oct 2010 20:34:19 +0200 Subject: work and reap, work and sleep, freakshare, shareonline, shragle --- module/plugins/hoster/FreakshareCom.py | 10 ++++++- module/plugins/hoster/ShareonlineBiz.py | 33 +++++++++++++++-------- module/plugins/hoster/ShragleCom.py | 48 ++++++++++++++++++--------------- 3 files changed, 58 insertions(+), 33 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py index bbc22ac98..441bdcd8f 100644 --- a/module/plugins/hoster/FreakshareCom.py +++ b/module/plugins/hoster/FreakshareCom.py @@ -21,6 +21,7 @@ class FreakshareCom(Hoster): self.req_opts = [] def process(self, pyfile): + self.pyfile = pyfile pyfile.url = pyfile.url.replace("freakshare.net/","freakshare.com/") if self.account: @@ -54,7 +55,7 @@ class FreakshareCom(Hoster): return True def download_html(self): - self.html = self.load(url, cookies=True) + self.html = self.load(self.pyfile.url, cookies=True) def get_file_url(self): """ returns the absolute downloadable filepath @@ -112,9 +113,16 @@ class FreakshareCom(Hoster): herewego = self.load(self.pyfile.url, None, request_options, cookies=True) # the actual download-Page + # comment this in, when it doesnt work + # with open("DUMP__FS_.HTML", "w") as fp: + # fp.write(herewego) + to_sort = re.findall(r"", herewego) request_options = [] + # comment this in, when it doesnt work as well + #print "\n\n%s\n\n" % ";".join(["%s=%s" % x for x in to_sort]) + for item in to_sort: #Same as above request_options.append((item[1], item[0])) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 77bc24182..a01dd86a3 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -16,7 +16,7 @@ def getInfo(urls): api_url_base = "http://www.share-online.biz/linkcheck/linkcheck.php" for chunk in chunks(urls, 90): - api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/","") for x in chunk)} #api only supports old style links + api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/","").rstrip("/") for x in chunk)} #api only supports old style links src = getURL(api_url_base, post=api_param_file) result = [] for i, res in enumerate(src.split("\n")): @@ -82,20 +82,30 @@ class ShareonlineBiz(Hoster): self.log.info("%s: no free slots, waiting 120 seconds" % (self.__name__)) self.wait() self.retry() - captcha = self.decryptCaptcha("http://www.share-online.biz/captcha.php", get={"rand":"0.%s" % random.randint(10**15,10**16)}, cookies=True) - self.log.debug("%s Captcha: %s" % (self.__name__, captcha)) - sleep(3) + return True + + + # captcha = self.decryptCaptcha("http://www.share-online.biz/captcha.php", get={"rand":"0.%s" % random.randint(10**15,10**16)}, cookies=True) + + # self.log.debug("%s Captcha: %s" % (self.__name__, captcha)) + # sleep(3) - html = self.load(self.pyfile.url, post={"captchacode": captcha}, cookies=True) - if re.search(r"Der Download ist Ihnen zu langsam", html): - #m = re.search("var timeout='(\d+)';", self.html[1]) - #self.waitUntil = time() + int(m.group(1)) if m else 30 - return True + # html = self.load(self.pyfile.url, post={"captchacode": captcha}, cookies=True) + # return True + + + #m = re.search("var timeout='(\d+)';", self.html[1]) + #self.waitUntil = time() + int(m.group(1)) if m else 30 + # if r"Der Download ist Ihnen zu langsam" in html: + # return True + # if r"The download is too slow for you" in html: + # return True + self.retry() else: - if r"Die Nummer ist leider nicht richtig oder ausgelaufen!" in html: + if r"Die Nummer ist leider nicht richtig oder ausgelaufen!" in self.html: self.retry() return True @@ -106,13 +116,14 @@ class ShareonlineBiz(Hoster): else: self.pyfile.url = self.pyfile.url.replace("http://www.share-online.biz/download.php?id=", "http://www.share-online.biz/dl/") self.pyfile.url = self.pyfile.url.replace("http://share-online.biz/download.php?id=", "http://www.share-online.biz/dl/") + def getFileUrl(self): """ returns the absolute downloadable filepath """ if self.account: return re.search('The following link contains a ticket to a valid mirror for your desired file\..*?