From c74f4eefd414769b380ffd8ae9fe8cd2f50fc34f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 7 Feb 2015 23:25:27 +0100 Subject: [BasketbuildCom] Cleanup --- module/plugins/hoster/BasketbuildCom.py | 39 +++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/BasketbuildCom.py b/module/plugins/hoster/BasketbuildCom.py index 651470e54..f3d430c5b 100644 --- a/module/plugins/hoster/BasketbuildCom.py +++ b/module/plugins/hoster/BasketbuildCom.py @@ -12,17 +12,17 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class BasketbuildCom(SimpleHoster): __name__ = "BasketbuildCom" __type__ = "hoster" - __version__ = "0.01" + __version__ = "0.02" - __pattern__ = r'https?://(?:www\.)?\w.basketbuild.com/filedl/.+' + __pattern__ = r'https?://(?:www\.)?\w\.basketbuild\.com/filedl/.+' __description__ = """basketbuild.com hoster plugin""" __license__ = "GPLv3" __authors__ = [("zapp-brannigan", "fuerst.reinje@web.de")] - NAME_PATTERN = r'File Name: (?P.*?)
' - SIZE_PATTERN = r'File Size: (?P[\d.,]+) (?P[\w^_]+)
' + NAME_PATTERN = r'File Name: (?P.+?)
' + SIZE_PATTERN = r'File Size: (?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'404 - Page Not Found' @@ -33,27 +33,34 @@ class BasketbuildCom(SimpleHoster): def handleFree(self, pyfile): - link1 = re.search(r'href="(.+dlgate/.+)"',self.html) try: - self.logDebug("Next hop: %s" % link1.group(1)) - self.html = self.load(link1.group(1), cookies=True) + link1 = re.search(r'href="(.+dlgate/.+)"', self.html).group(1) + self.html = self.load(link1) + except AttributeError: self.error(_("Hop #1 not found")) - - wait = re.search(r'var sec = (\d+);',self.html) + + else: + self.logDebug("Next hop: %s" % link1) + try: - self.logDebug("Wait %s seconds" % wait.group(1)) - self.wait(wait.group(1)) + wait = re.search(r'var sec = (\d+)', self.html).group(1) + self.logDebug("Wait %s seconds" % wait) + self.wait(wait) + except AttributeError: self.logDebug("No wait time found") - - link2 = re.search(r'id="dlLink">\s*\s*