summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-02-27 23:53:39 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-02-27 23:53:39 +0100
commit752760ce6ddf8a5c980b8c84c2f196a975ab7666 (patch)
tree741d832a367c9a31b109a5a15e0508c24fc8c42f /module
parentfix extabit.com (diff)
downloadpyload-752760ce6ddf8a5c980b8c84c2f196a975ab7666.tar.xz
closed #548
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hoster/UploadedTo.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py
index 656977426..00ffeae94 100644
--- a/module/plugins/hoster/UploadedTo.py
+++ b/module/plugins/hoster/UploadedTo.py
@@ -84,10 +84,10 @@ class UploadedTo(Hoster):
__name__ = "UploadedTo"
__type__ = "hoster"
__pattern__ = r"(http://[\w\.-]*?uploaded\.to/.*?(file/|\?id=|&id=)[\w]+/?)|(http://[\w\.]*?ul\.to/(\?id=|&id=)?[\w\-]+/.+)|(http://[\w\.]*?ul\.to/(\?id=|&id=)?[\w\-]+/?)"
- __version__ = "0.54"
+ __version__ = "0.55"
__description__ = """Uploaded.to Download Hoster"""
- __author_name__ = ("spoob", "mkaay")
- __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de")
+ __author_name__ = ("spoob", "mkaay", "zoidberg")
+ __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz")
FILE_INFO_PATTERN = r'<a href="file/(?P<ID>\w+)" id="filename">(?P<N>[^<]+)</a> &nbsp;\s*<small[^>]*>(?P<S>[^<]+)</small>'
FILE_OFFLINE_PATTERN = r'<small class="cL">Error: 404</small>'
@@ -157,8 +157,20 @@ class UploadedTo(Hoster):
self.resetAccount()
self.fail(_("Traffic exceeded"))
- self.download("http://uploaded.to/file/%s/ddl" % self.fileID)
-
+ header = self.load("http://uploaded.to/file/%s" % self.fileID, just_header=True)
+ if "location" in header:
+ #Direct download
+ print "Direct Download: " + header['location']
+ self.download(header['location'])
+ else:
+ #Indirect download
+ self.html = self.load("http://uploaded.to/file/%s" % self.fileID)
+ found = re.search(r'<div class="tfree".*\s*<form method="post" action="(.*?)"', self.html)
+ if not found:
+ self.fail("Download URL not found. Try to enable direct downloads.")
+ url = found.group(1)
+ print "Premium URL: " + url
+ self.download(url, post={})
def handleFree(self):
self.html = self.load(self.pyfile.url, decode=True)