diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-06 01:50:55 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-06 01:50:55 +0200 |
commit | 4d2aae75e639c3fb78fe1ec454cafea5617ffd4e (patch) | |
tree | 3276b6863a012d52f92f46af5c421456927abde4 | |
parent | Spare code cosmetics (diff) | |
download | pyload-4d2aae75e639c3fb78fe1ec454cafea5617ffd4e.tar.xz |
[DevhostStFolder] Folder-in-folder support
-rw-r--r-- | module/plugins/crypter/DevhostStFolder.py | 33 | ||||
-rw-r--r-- | module/plugins/hoster/DevhostSt.py | 6 |
2 files changed, 31 insertions, 8 deletions
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<USER>\w+)(/\?fld_id=(?P<ID>\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';"><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): 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" |