From 4d2aae75e639c3fb78fe1ec454cafea5617ffd4e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 6 Oct 2014 01:50:55 +0200 Subject: [DevhostStFolder] Folder-in-folder support --- module/plugins/crypter/DevhostStFolder.py | 33 ++++++++++++++++++++++++++----- module/plugins/hoster/DevhostSt.py | 6 +++--- 2 files changed, 31 insertions(+), 8 deletions(-) (limited to 'module') diff --git a/module/plugins/crypter/DevhostStFolder.py b/module/plugins/crypter/DevhostStFolder.py index 1986f9fd0..049f1dabc 100644 --- a/module/plugins/crypter/DevhostStFolder.py +++ b/module/plugins/crypter/DevhostStFolder.py @@ -13,16 +13,39 @@ from module.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\w+)(/\?fld_id=(?P\d+))?' __description__ = """d-h.st folder decrypter plugin""" - __author_name_ = "zapp-brannigan" - __author_mail_ = "fuerst.reinje@web.de" + __author_name_ = ("zapp-brannigan", "Walter Purcaro") + __author_mail_ = ("fuerst.reinje@web.de", "vuolter@gmail.com") - LINK_PATTERN = r';">)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): diff --git a/module/plugins/hoster/DevhostSt.py b/module/plugins/hoster/DevhostSt.py index b50257238..f64519209 100644 --- a/module/plugins/hoster/DevhostSt.py +++ b/module/plugins/hoster/DevhostSt.py @@ -9,11 +9,11 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DevhostSt(SimpleHoster): - __name__ = "Devhost" + __name__ = "DevhostSt" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" - __pattern__ = r'http://(?:www\.)?d-h\.st/\w+' + __pattern__ = r'http://(?:www\.)?d-h\.st/(?!users/)\w{3}' __description__ = """d-h.st hoster plugin""" __author_name__ = "zapp-brannigan" -- cgit v1.2.3