From 8c9ae3f167642debe488437b3cefff3adaa560b2 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Sun, 28 Sep 2014 17:05:40 +0200 Subject: New hoster Dev-Host --- module/plugins/hoster/DevhostSt.py | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 module/plugins/hoster/DevhostSt.py (limited to 'module/plugins/hoster/DevhostSt.py') diff --git a/module/plugins/hoster/DevhostSt.py b/module/plugins/hoster/DevhostSt.py new file mode 100644 index 000000000..fbeb883e1 --- /dev/null +++ b/module/plugins/hoster/DevhostSt.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# +# Test links: +# http://d-h.st/mM8 + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class DevhostSt(SimpleHoster): + __name__ = "Devhost" + __type__ = "hoster" + __version__ = "0.01" + + __pattern__ = r'http://(?:www\.)?d-h\.st/\w+' + + __description__ = """d-h.st hoster plugin""" + __author_name__ = "zapp-brannigan" + __author_mail__ = "fuerst.reinje@web.de" + + + FILE_NAME_PATTERN = r'>Filename:
Size: (?P[\d.]+) (?P\w+)' + + OFFLINE_PATTERN = r'>File Not Found<' + LINK_PATTERN = r'id="downloadfile" href="(.+?)"' + + + def setup(self): + self.multiDL = True + self.chunkLimit = 1 + + + def handleFree(self): + m = re.search(self.LINK_PATTERN, self.html) + if m is None: + self.parseError("Download link not found") + + dl_url = m.group(1) + self.logDebug("Download URL = " + dl_url) + self.download(dl_url, disposition=True) + + if self.checkDownload({'is_html': re.compile("html")}) == "is_html": + self.parseError("The downloaded file is html, something went wrong") + + +getInfo = create_getInfo(DevhostSt) -- cgit v1.2.3 From 59f743bbfde24d94a16c9fc60095014d66a2cb70 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 28 Sep 2014 19:14:58 +0200 Subject: [SpeedyshareCom] Code cleanup --- module/plugins/hoster/DevhostSt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/DevhostSt.py') diff --git a/module/plugins/hoster/DevhostSt.py b/module/plugins/hoster/DevhostSt.py index fbeb883e1..088ace93a 100644 --- a/module/plugins/hoster/DevhostSt.py +++ b/module/plugins/hoster/DevhostSt.py @@ -41,8 +41,9 @@ class DevhostSt(SimpleHoster): self.logDebug("Download URL = " + dl_url) self.download(dl_url, disposition=True) - if self.checkDownload({'is_html': re.compile("html")}) == "is_html": - self.parseError("The downloaded file is html, something went wrong") + check = self.checkDownload({'is_html': re.compile("html")}) + if check == "is_html": + self.parseError("Downloaded file is an html file") getInfo = create_getInfo(DevhostSt) -- cgit v1.2.3