From 8368a9a74d998b314f3864dcc8ce25c513d85cf9 Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 7 Mar 2013 16:41:25 +0100 Subject: Various fixes in 24 plugins --- module/plugins/hoster/X7To.py | 74 +++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'module/plugins/hoster/X7To.py') diff --git a/module/plugins/hoster/X7To.py b/module/plugins/hoster/X7To.py index 2ba534cff..51f8e6cd4 100644 --- a/module/plugins/hoster/X7To.py +++ b/module/plugins/hoster/X7To.py @@ -13,7 +13,7 @@ class X7To(Hoster): __name__ = "X7To" __type__ = "hoster" __pattern__ = r"http://(?:www.)?x7.to/" - __version__ = "0.2" + __version__ = "0.3" __description__ = """X7.To File Download Hoster""" __author_name__ = ("ernieb") __author_mail__ = ("ernieb") @@ -54,40 +54,40 @@ class X7To(Hoster): # find file id file_id = re.search(r"var dlID = '(.*?)'", self.html) if not file_id: - self.fail("Free download id not found") + self.fail("Free download id not found") - file_url = "http://x7.to/james/ticket/dl/" + file_id.group(1) - self.logDebug("download id %s" % file_id.group(1)) - - self.html = self.load(file_url, ref=False, decode=True) - - # deal with errors - if "limit-dl" in self.html: - self.logDebug("Limit reached ... waiting") - self.setWait(900,True) - self.wait() - self.retry() - - if "limit-parallel" in self.html: - self.fail("Cannot download in parallel") - - # no waiting required, go to download - waitCheck = re.search(r"wait:(\d*),", self.html) - if waitCheck: - waitCheck = int(waitCheck.group(1)) - self.setWait(waitCheck) - self.wait() - - urlCheck = re.search(r"url:'(.*?)'", self.html) - url = None - if urlCheck: - url = urlCheck.group(1) - self.logDebug("free url found %s" % url) - - if url: - try: - self.download(url) - except: - self.logDebug("downloading url failed: %s" % url) - else: - self.fail("Free download url found") + file_url = "http://x7.to/james/ticket/dl/" + file_id.group(1) + self.logDebug("download id %s" % file_id.group(1)) + + self.html = self.load(file_url, ref=False, decode=True) + + # deal with errors + if "limit-dl" in self.html: + self.logDebug("Limit reached ... waiting") + self.setWait(900,True) + self.wait() + self.retry() + + if "limit-parallel" in self.html: + self.fail("Cannot download in parallel") + + # no waiting required, go to download + waitCheck = re.search(r"wait:(\d*),", self.html) + if waitCheck: + waitCheck = int(waitCheck.group(1)) + self.setWait(waitCheck) + self.wait() + + urlCheck = re.search(r"url:'(.*?)'", self.html) + url = None + if urlCheck: + url = urlCheck.group(1) + self.logDebug("free url found %s" % url) + + if url: + try: + self.download(url) + except: + self.logDebug("downloading url failed: %s" % url) + else: + self.fail("Free download url found") -- cgit v1.2.3