summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-03-14 13:21:13 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-03-14 13:21:13 +0100
commit91042996f7291c5cf01afdb7ce47ca84b75a1ebb (patch)
tree48ec251c5a7a746a4c20c2ad0595a19a15b556a7 /module
parentnew ul plugin (diff)
downloadpyload-91042996f7291c5cf01afdb7ce47ca84b75a1ebb.tar.xz
ul direct download
Diffstat (limited to 'module')
-rw-r--r--module/plugins/accounts/UploadedTo.py3
-rw-r--r--module/plugins/hoster/UploadedTo.py16
2 files changed, 13 insertions, 6 deletions
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py
index e0782e3e4..63092a3cb 100644
--- a/module/plugins/accounts/UploadedTo.py
+++ b/module/plugins/accounts/UploadedTo.py
@@ -31,7 +31,6 @@ class UploadedTo(Account):
def loadAccountInfo(self, user, req):
html = req.load("http://uploaded.to/me", cookies=True)
- open("ul.html", "wb").write(html)
premium = '<a href="me#premium"><em>Premium</em>' in html
@@ -54,4 +53,4 @@ class UploadedTo(Account):
self.wrongPassword()
req.load("http://uploaded.to/language/en")
- req.cj.setCookie(".uploaded.to", "lang", "en")
+ req.cj.setCookie("uploaded.to", "lang", "en")
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):