summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-20 23:26:13 +0100
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-03-20 23:26:13 +0100
commit31850c215fa2a9ce741f2bc94a11897b2a375dbe (patch)
treee5361341f3d09d4c4f4f9e3ff9a4d3747d5b9f54 /module
parent[CatShareNet] getFileInfo -> checkErrors (diff)
downloadpyload-31850c215fa2a9ce741f2bc94a11897b2a375dbe.tar.xz
[DevhostStFolder] Fixup
Diffstat (limited to 'module')
-rw-r--r--module/plugins/crypter/DevhostStFolder.py30
1 files changed, 19 insertions, 11 deletions
diff --git a/module/plugins/crypter/DevhostStFolder.py b/module/plugins/crypter/DevhostStFolder.py
index 8779cae5e..2753ee389 100644
--- a/module/plugins/crypter/DevhostStFolder.py
+++ b/module/plugins/crypter/DevhostStFolder.py
@@ -13,7 +13,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo
class DevhostStFolder(SimpleCrypter):
__name__ = "DevhostStFolder"
__type__ = "crypter"
- __version__ = "0.04"
+ __version__ = "0.05"
__pattern__ = r'http://(?:www\.)?d-h\.st/users/(?P<USER>\w+)(/\?fld_id=(?P<ID>\d+))?'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
@@ -25,17 +25,18 @@ class DevhostStFolder(SimpleCrypter):
("Walter Purcaro", "vuolter@gmail.com")]
- LINK_PATTERN = r'(?:/> |;">)<a href="(.+?)"(?!>Back to \w+<)'
+ LINK_PATTERN = r'(?:/> |;">)<a href="(.+?)"(?!>Back to \w+<)'
OFFLINE_PATTERN = r'"/cHP">test\.png<'
- def getFileInfo(self):
- if re.search(self.OFFLINE_PATTERN, self.html):
- self.offline()
+ def checkNameSize(self, getinfo=True):
+ if not self.info or getinfo:
+ self.logDebug("File info (BEFORE): %s" % self.info)
+ self.info.update(self.getInfo(self.pyfile.url, self.html))
+ self.logDebug("File info (AFTER): %s" % self.info)
try:
- id = re.match(self.__pattern__, self.pyfile.url).group('ID')
- if id == "0":
+ if self.info['pattern']['ID'] == "0":
raise
p = r'href="(.+?)">Back to \w+<'
@@ -43,15 +44,22 @@ class DevhostStFolder(SimpleCrypter):
html = self.load(urljoin("http://d-h.st", m.group(1)),
cookies=False)
- p = '\?fld_id=%s.*?">(.+?)<' % id
+ p = '\?fld_id=%s.*?">(.+?)<' % self.info['pattern']['ID']
m = re.search(p, html)
- name = folder = m.group(1)
+ self.pyfile.name = m.group(1)
except Exception, e:
self.logDebug(e)
- name = folder = re.match(self.__pattern__, self.pyfile.url).group('USER')
+ self.pyfile.name = self.info['pattern']['USER']
- return {'name': name, 'folder': folder}
+ try:
+ folder = self.info['folder'] = self.pyfile.name
+
+ except Exception:
+ pass
+
+ self.logDebug("File name: %s" % self.pyfile.name,
+ "File folder: %s" % self.pyfile.name)
getInfo = create_getInfo(DevhostStFolder)