diff options
Diffstat (limited to 'pyload/plugins/account/DevhostStFolder.py')
-rw-r--r-- | pyload/plugins/account/DevhostStFolder.py | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/pyload/plugins/account/DevhostStFolder.py b/pyload/plugins/account/DevhostStFolder.py index 1c9bd3889..59d293182 100644 --- a/pyload/plugins/account/DevhostStFolder.py +++ b/pyload/plugins/account/DevhostStFolder.py @@ -13,16 +13,39 @@ from pyload.plugins.internal.SimpleCrypter import SimpleCrypter class DevhostStFolder(SimpleCrypter): __name__ = "DevhostStFolder" __type__ = "crypter" - __version__ = "0.01" + __version__ = "0.02" - __pattern__ = r'http://(?:www\.)?d-h\.st/users/\w+/\?fld_id=\d+' + __pattern__ = r'http://(?:www\.)?d-h\.st/users/(?P<USER>\w+)(/\?fld_id=(?P<ID>\d+))?' - __description__ = """d-h.st decrypter plugin""" - __author_name_ = "zapp-brannigan" - __author_mail_ = "fuerst.reinje@web.de" + __description__ = """d-h.st folder decrypter plugin""" + __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de"), + ("Walter Purcaro", "vuolter@gmail.com")] - LINK_PATTERN = r';"><a href="/(\w+)' + LINK_PATTERN = r'(?:/> |;">)<a href="(.+?)"(?!>Back to \w+<)' + OFFLINE_PATTERN = r'"/cHP">test\.png<' + + + def getPackageNameAndFolder(self): + try: + id = re.match(self.__pattern__, self.pyfile.url).group('ID') + if id == "0": + raise + + p = r'href="(.+?)">Back to \w+<' + m = re.search(p, self.html) + html = self.load(urljoin("http://d-h.st", m.group(1)), + cookies=False) + + p = '\?fld_id=%s.*?">(.+?)<' % id + m = re.search(p, html) + name = folder = m.group(1) + + except Exception, e: + self.logDebug(str(e)) + name = folder = re.match(self.__pattern__, self.pyfile.url).group('USER') + + return name, folder def getLinks(self): |