diff options
author | mkaay <mkaay@mkaay.de> | 2010-08-25 16:48:55 +0200 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-08-25 16:48:55 +0200 |
commit | 3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea (patch) | |
tree | c5b2b1bfeb7eb8df2b97be118f6cbcec4e29cb3b /module/plugins/hoster/FileserveCom.py | |
parent | ul.to fetching, so.biz expire (diff) | |
download | pyload-3c9f55270a83b0e88ec0dc516f9d9921e4d7b6ea.tar.xz |
merged gui
Diffstat (limited to 'module/plugins/hoster/FileserveCom.py')
-rw-r--r-- | module/plugins/hoster/FileserveCom.py | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py deleted file mode 100644 index ff09d9a0a..000000000 --- a/module/plugins/hoster/FileserveCom.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*-
-
-import re
-from module.plugins.Hoster import Hoster
-from module.plugins.ReCaptcha import ReCaptcha - -from module.network.Request import getURL
- -def getInfo(urls): - result = [] - - for url in urls: - html = getURL(url)
- if re.search(r'<h1>File not available</h1>', html):
- result.append((url, 0, 1, url)) - continue - - size = re.search(r"<span><strong>(.*?) MB</strong>", html).group(1)
- size = int(float(size)*1024*1024) -
- name = re.search('<h1>(.*?)<br/></h1>', html).group(1) - result.append((name, size, 2, url)) - - yield result -
-class FileserveCom(Hoster):
- __name__ = "FileserveCom"
- __type__ = "hoster"
- __pattern__ = r"http://(www\.)?fileserve\.com/file/.*?(/.*)?"
- __version__ = "0.2"
- __description__ = """Fileserve.Com File Download Hoster"""
- __author_name__ = ("jeix", "mkaay")
- __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de")
-
- def setup(self):
- self.req.canContinue = self.multiDL = True if self.account else False
-
- def process(self, pyfile):
-
- self.html = self.load(self.pyfile.url, cookies=False if self.account else True)
- if re.search(r'<h1>File not available</h1>', self.html) != None:
- self.offline
-
- self.pyfile.name = re.search('<h1>(.*?)<br/></h1>', self.html).group(1)
- - if self.account: - self.handlePremium() - else: - self.handleFree() - - def handlePremium(self): - self.download(self.pyfile.url, post={"download":"premium"}, cookies=True) - - def handleFree(self): -
- if r'<div id="captchaArea" style="display:none;">' in self.html or \
- r'/showCaptcha\(\);' in self.html:
- # we got a captcha
- id = re.search(r"var reCAPTCHA_publickey='(.*?)';", self.html).group(1)
- recaptcha = ReCaptcha(self)
- challenge, code = recaptcha.challenge(id)
-
- shortencode = re.search(r'name="recaptcha_shortencode_field" value="(.*?)"', self.html).group(1)
-
- self.html = self.load(r'http://www.fileserve.com/checkReCaptcha.php', post={'recaptcha_challenge_field':challenge,
- 'recaptcha_response_field':code, 'recaptcha_shortencode_field': shortencode})
-
- if r'incorrect-captcha-sol' in self.html:
- self.retry()
-
- html = self.load(self.pyfile.url, post={"downloadLink":"wait"})
-
- wait_time = 30
- m = re.search(r'<span>(.*?)\sSekunden</span>', html)
- if m != None:
- wait_time = int( m.group(1).split('.')[0] ) + 1
-
- m = re.search(r'You need to wait (.*?) seconds to start another download.', html)
- if m != None:
- wait_time = int( m.group(1) )
- self.wantReconnect = True
-
- if r'Your download link has expired.' in html:
- self.retry()
-
- self.log.debug("%s: Waiting %d seconds." % (self.__name__, wait_time))
- self.setWait(wait_time)
- self.wait()
-
- self.load(self.pyfile.url, post={"downloadLink":"show"})
-
- self.download(self.pyfile.url, post={"download":"normal"})
|