diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-03 00:34:14 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-03 00:34:14 +0100 |
commit | d9f78924cdff65e2791be4bc0eeb6861566b5a11 (patch) | |
tree | 07f3088249b00992f7f930a509ca95af33d0a2a6 /module/plugins | |
parent | Use method pop to remove item from dict (diff) | |
download | pyload-d9f78924cdff65e2791be4bc0eeb6861566b5a11.tar.xz |
[AndroidfilehostCom] Cleanup
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hoster/AndroidfilehostCom.py | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/module/plugins/hoster/AndroidfilehostCom.py b/module/plugins/hoster/AndroidfilehostCom.py index d0b6af8bb..9793dd795 100644 --- a/module/plugins/hoster/AndroidfilehostCom.py +++ b/module/plugins/hoster/AndroidfilehostCom.py @@ -15,16 +15,18 @@ class AndroidfilehostCom(SimpleHoster): __pattern__ = r'https?://(?:www\.)?androidfilehost\.com/\?fid=\d+' - __description__ = """androidfilehost.com hoster plugin""" + __description__ = """Androidfilehost.com hoster plugin""" __license__ = "GPLv3" __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] NAME_PATTERN = r'<br />(?P<N>.*?)</h1>' SIZE_PATTERN = r'<h4>size</h4>\s*<p>(?P<S>[\d.,]+)(?P<U>[\w^_]+)</p>' + HASHSUM_PATTERN = r'<h4>(?P<T>.*?)</h4>\s*<p><code>(?P<H>.*?)</code></p>' + OFFLINE_PATTERN = r'404 not found' + WAIT_PATTERN = r'users must wait <strong>(\d+) secs' - HASHSUM_PATTERN = r'<h4>(?P<T>.*?)</h4>\s*<p><code>(?P<H>.*?)</code></p>' def setup(self): @@ -34,32 +36,30 @@ class AndroidfilehostCom(SimpleHoster): def handleFree(self, pyfile): - wait = re.search(self.WAIT_PATTERN,self.html) - self.logDebug("Waitingtime: %s seconds" %wait.group(1)) - - fid = re.search(r'id="fid" value="(\d+)" />',self.html) - self.logDebug("fid: %s" %fid.group(1)) - + wait = re.search(self.WAIT_PATTERN, self.html) + self.logDebug("Waiting time: %s seconds" % wait.group(1)) + + fid = re.search(r'id="fid" value="(\d+)" />', self.html).group(1) + self.logDebug("fid: %s" % fid) + html = self.load("https://www.androidfilehost.com/libs/otf/mirrors.otf.php", - cookies = True, - decode = True, - post = {'submit':'submit', - 'action':'getdownloadmirrors', - 'fid' :fid.group(1)}) + post={'submit': 'submit', + 'action': 'getdownloadmirrors', + 'fid' : fid}, + decode=True) - mirror = re.findall('"url":"(.*?)"',html)[0].replace("\\","") + mirror = re.findall('"url":"(.*?)"', html)[0].replace("\\", "") mirror_host = mirror.split("/")[2] - self.logDebug("DL-URL: %s" %mirror) - self.logDebug("Mirror Host: %s" %mirror_host) - + self.logDebug("DL-URL: %s" % mirror) + self.logDebug("Mirror Host: %s" % mirror_host) + html = self.load("https://www.androidfilehost.com/libs/otf/stats.otf.php", - cookies = True, - decode = True, - get = {'fid' : fid.group(1), - 'w' : 'download', - 'mirror' : mirror_host}) - - self.download(mirror,cookies=True,disposition=True) + get={'fid' : fid, + 'w' : 'download', + 'mirror': mirror_host}, + decode=True) + + self.download(mirror, disposition=True) getInfo = create_getInfo(AndroidfilehostCom) |