summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter
diff options
context:
space:
mode:
authorGravatar fragonib <devnull@localhost> 2012-12-26 20:42:42 +0100
committerGravatar fragonib <devnull@localhost> 2012-12-26 20:42:42 +0100
commit022e7c6e15a05afd15e8f859ec4ca5e45c682d1c (patch)
treecfb000bea2eec40c520850b7ce21598e70e4c53a /module/plugins/crypter
parentLinkSaveIn: FIX compiler warnings (diff)
downloadpyload-022e7c6e15a05afd15e8f859ec4ca5e45c682d1c.tar.xz
ShareLinksBiz: FIX package info retrieval
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r--module/plugins/crypter/ShareLinksBiz.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py
index 0009253e1..1ffa5d41a 100644
--- a/module/plugins/crypter/ShareLinksBiz.py
+++ b/module/plugins/crypter/ShareLinksBiz.py
@@ -12,7 +12,7 @@ class ShareLinksBiz(Crypter):
__name__ = "ShareLinksBiz"
__type__ = "crypter"
__pattern__ = r"(?P<base>http://[\w\.]*?(share-links|s2l)\.biz)/(?P<id>_?[0-9a-z]+)(/.*)?"
- __version__ = "1.11"
+ __version__ = "1.12"
__description__ = """Share-Links.biz Crypter"""
__author_name__ = ("fragonib")
__author_mail__ = ("fragonib[AT]yahoo[DOT]es")
@@ -152,16 +152,24 @@ class ShareLinksBiz(Crypter):
self.correctCaptcha()
def getPackageInfo(self):
+ name = folder = None
+
+ # Extract from web package header
title_re = r'<h2><img.*?/>(.*)</h2>'
m = re.search(title_re, self.html, re.DOTALL)
if m is not None:
title = m.group(1).strip()
- name = folder = title
- self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder))
- else:
+ if 'unnamed' not in title:
+ name = folder = title
+ self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder))
+
+ # Fallback to defaults
+ if not name or not folder:
name = self.package.name
folder = self.package.folder
self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder))
+
+ # Return package info
return name, folder
def handleWebLinks(self):