From 022e7c6e15a05afd15e8f859ec4ca5e45c682d1c Mon Sep 17 00:00:00 2001 From: fragonib Date: Wed, 26 Dec 2012 20:42:42 +0100 Subject: ShareLinksBiz: FIX package info retrieval --- module/plugins/crypter/ShareLinksBiz.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'module/plugins/crypter/ShareLinksBiz.py') 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"(?Phttp://[\w\.]*?(share-links|s2l)\.biz)/(?P_?[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'

(.*)

' 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): -- cgit v1.2.3