diff options
author | mkaay <mkaay@mkaay.de> | 2009-12-28 23:00:57 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2009-12-28 23:00:57 +0100 |
commit | 9908e7c4841b3a109ee28575052c489728d59f0f (patch) | |
tree | ada58d04b8e3ec0b9141f26722360c6352d4a109 /module | |
parent | checksum is now optional (diff) | |
download | pyload-9908e7c4841b3a109ee28575052c489728d59f0f.tar.xz |
UploadedTo indirect download fix
Diffstat (limited to 'module')
-rwxr-xr-x | module/network/Request.py | 1 | ||||
-rw-r--r-- | module/plugins/hoster/UploadedTo.py | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/module/network/Request.py b/module/network/Request.py index d1280f591..9155185fd 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -154,6 +154,7 @@ class Request: self.pycurl.setopt(pycurl.NOPROGRESS, 1) self.pycurl.setopt(pycurl.NOBODY, 1) self.pycurl.perform() + self.lastEffectiveURL = self.pycurl.getinfo(pycurl.EFFECTIVE_URL) self.pycurl.setopt(pycurl.NOPROGRESS, 0) self.pycurl.setopt(pycurl.NOBODY, 0) return self.header diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 0d487be46..6079003bf 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -125,10 +125,21 @@ class UploadedTo(Plugin): return False else: return True - + + def cleanUrl(self, url): + url = url.replace("ul.to/", "uploaded.to/file/") + url = url.replace("/?id=", "/file/") + url = url.replace("?id=", "file/") + url = re.sub("/\?(.*?)&id=", "/file/", url, 1) + return url + def proceed(self, url, location): if self.config['premium']: self.req.load("http://uploaded.to/login", None, { "email" : self.config['username'], "password" : self.config['password']}, cookies=True) + self.req.load(url, cookies=True, just_header=True) + if self.cleanUrl(self.req.lastEffectiveURL) == self.cleanUrl(url): + self.logger.info("UploadedTo indirect download") + url = self.cleanUrl(url)+"?redirect" self.req.download(url, location, cookies=True) else: self.req.download(url, location, cookies=False, post={"download_submit": "Free Download"}) |