diff options
author | zapp-brannigan <zapp-brannigan@users.noreply.github.com> | 2015-02-02 10:22:41 +0100 |
---|---|---|
committer | zapp-brannigan <zapp-brannigan@users.noreply.github.com> | 2015-02-02 10:22:41 +0100 |
commit | 8d7b0c34334418fd182cc64141953d6c0bf3c6e8 (patch) | |
tree | 9917b23c251271eac2c1274009bb6c1ac9027dca /module/plugins | |
parent | Captcha9Kw should be initialized activated false (diff) | |
download | pyload-8d7b0c34334418fd182cc64141953d6c0bf3c6e8.tar.xz |
[New Hoster] androidfilehost.com
Another plugin for downloading android-stuff.
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hoster/AndroidfilehostCom.py | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/module/plugins/hoster/AndroidfilehostCom.py b/module/plugins/hoster/AndroidfilehostCom.py new file mode 100644 index 000000000..d68a7c9ab --- /dev/null +++ b/module/plugins/hoster/AndroidfilehostCom.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -* +# +# Test links: +# https://www.androidfilehost.com/?fid=95916177934518197 + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class AndroidfilehostCom(SimpleHoster): + __name__ = "AndroidfilehostCom" + __type__ = "hoster" + __version__ = "0.01" + + __pattern__ = r'https?://(?:www\.)?androidfilehost\.com/\?fid=\d+' + + __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>' + OFFLINE_PATTERN = r'404 not found' + WAIT_PATTERN = r'users must wait <strong>(\d+) secs' + + + def setup(self): + self.multiDL = True + self.resumeDownload = True + self.chunkLimit = 1 + + + 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)) + + 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)}) + + 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) + + 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) + + +getInfo = create_getInfo(AndroidfilehostCom) |