From 91042996f7291c5cf01afdb7ce47ca84b75a1ebb Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 14 Mar 2011 13:21:13 +0100 Subject: ul direct download --- module/plugins/hoster/UploadedTo.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/UploadedTo.py') diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index a725bb980..17765e1d3 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -1,6 +1,9 @@ # -*- coding: utf-8 -*- import re + +from pycurl import error + from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL from module.plugins.Plugin import chunks @@ -75,10 +78,15 @@ class UploadedTo(Hoster): self.resetAccount() self.fail(_("Traffic exceeded")) - html = self.load(self.pyfile.url, utf8=True) - url = re.search(r'action="(http://.*\.uploaded.to/dl\?id=[^"]+)', html) - url = url.group(1) - self.download(url) + try: + html = self.load(self.pyfile.url, utf8=True) + except error, e: + if e.args and e.args[0] == 23: + self.download(self.pyfile.url) + else: + url = re.search(r'action="(http://.*\.uploaded.to/dl\?id=[^"]+)', html) + url = url.group(1) + self.download(url) def handleFree(self): -- cgit v1.2.3