From 8d7b0c34334418fd182cc64141953d6c0bf3c6e8 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Mon, 2 Feb 2015 10:22:41 +0100 Subject: [New Hoster] androidfilehost.com Another plugin for downloading android-stuff. --- module/plugins/hoster/AndroidfilehostCom.py | 64 +++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 module/plugins/hoster/AndroidfilehostCom.py (limited to 'module/plugins/hoster/AndroidfilehostCom.py') 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'
(?P.*?)' + SIZE_PATTERN = r'

size

\s*

(?P[\d.,]+)(?P[\w^_]+)

' + OFFLINE_PATTERN = r'404 not found' + WAIT_PATTERN = r'users must wait (\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) -- cgit v1.2.3 From 308cdbcf98b07967cee6e873af2a73c535b90c18 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Mon, 2 Feb 2015 11:20:18 +0100 Subject: Update AndroidfilehostCom.py Added HASHSUM_PATTERN --- module/plugins/hoster/AndroidfilehostCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/AndroidfilehostCom.py') diff --git a/module/plugins/hoster/AndroidfilehostCom.py b/module/plugins/hoster/AndroidfilehostCom.py index d68a7c9ab..d0b6af8bb 100644 --- a/module/plugins/hoster/AndroidfilehostCom.py +++ b/module/plugins/hoster/AndroidfilehostCom.py @@ -24,6 +24,7 @@ class AndroidfilehostCom(SimpleHoster): SIZE_PATTERN = r'

size

\s*

(?P[\d.,]+)(?P[\w^_]+)

' OFFLINE_PATTERN = r'404 not found' WAIT_PATTERN = r'users must wait (\d+) secs' + HASHSUM_PATTERN = r'

(?P.*?)

\s*

(?P.*?)

' def setup(self): -- cgit v1.2.3 From d9f78924cdff65e2791be4bc0eeb6861566b5a11 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 3 Feb 2015 00:34:14 +0100 Subject: [AndroidfilehostCom] Cleanup --- module/plugins/hoster/AndroidfilehostCom.py | 48 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'module/plugins/hoster/AndroidfilehostCom.py') 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'
(?P.*?)' SIZE_PATTERN = r'

size

\s*

(?P[\d.,]+)(?P[\w^_]+)

' + HASHSUM_PATTERN = r'

(?P.*?)

\s*

(?P.*?)

' + OFFLINE_PATTERN = r'404 not found' + WAIT_PATTERN = r'users must wait (\d+) secs' - HASHSUM_PATTERN = r'

(?P.*?)

\s*

(?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) -- cgit v1.2.3 From 6616c00ba1c40f5d56959bd0e4725f26250e1292 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 9 Feb 2015 17:42:31 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/AndroidfilehostCom.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/AndroidfilehostCom.py') diff --git a/module/plugins/hoster/AndroidfilehostCom.py b/module/plugins/hoster/AndroidfilehostCom.py index 9793dd795..b6e43d632 100644 --- a/module/plugins/hoster/AndroidfilehostCom.py +++ b/module/plugins/hoster/AndroidfilehostCom.py @@ -48,9 +48,9 @@ class AndroidfilehostCom(SimpleHoster): 'fid' : fid}, decode=True) - mirror = re.findall('"url":"(.*?)"', html)[0].replace("\\", "") - mirror_host = mirror.split("/")[2] - self.logDebug("DL-URL: %s" % mirror) + self.link = re.findall('"url":"(.*?)"', html)[0].replace("\\", "") + mirror_host = self.link.split("/")[2] + self.logDebug("Mirror Host: %s" % mirror_host) html = self.load("https://www.androidfilehost.com/libs/otf/stats.otf.php", @@ -59,7 +59,5 @@ class AndroidfilehostCom(SimpleHoster): 'mirror': mirror_host}, decode=True) - self.download(mirror, disposition=True) - getInfo = create_getInfo(AndroidfilehostCom) -- cgit v1.2.3 From 7d90803262ccbb4fc5296a4dc3ce30fe98f55631 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 25 Mar 2015 23:10:07 +0100 Subject: __config__ cosmetics --- module/plugins/hoster/AndroidfilehostCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/AndroidfilehostCom.py') diff --git a/module/plugins/hoster/AndroidfilehostCom.py b/module/plugins/hoster/AndroidfilehostCom.py index b6e43d632..08005de0f 100644 --- a/module/plugins/hoster/AndroidfilehostCom.py +++ b/module/plugins/hoster/AndroidfilehostCom.py @@ -14,6 +14,7 @@ class AndroidfilehostCom(SimpleHoster): __version__ = "0.01" __pattern__ = r'https?://(?:www\.)?androidfilehost\.com/\?fid=\d+' + __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """Androidfilehost.com hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3