From 84174e2ce29422b44b8b134bf2813445891bc61c Mon Sep 17 00:00:00 2001 From: Jeix Date: Sat, 18 Dec 2010 12:05:29 +0100 Subject: closed #160 fixed Megaupload, Uploading --- module/plugins/hoster/MegauploadCom.py | 10 ++++++++-- module/plugins/hoster/UploadingCom.py | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index 92daedec2..d176e996a 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -108,8 +108,11 @@ class MegauploadCom(Hoster): if "The file that you're trying to download is larger than 1 GB" in self.html[0]: self.fail(_("You need premium to download files larger than 1 GB")) - if r'Please enter the password below to proceed' in self.html[0]: + if r'Please enter the password below' in self.html[0]: pw = self.pyfile.package().password + if not pw: + self.fail(_("The file is password protected, enter a password and restart.")) + self.html[1] = self.load(self.pyfile.url, post={"filepassword":pw}) break # looks like there is no captcha for pw protected files @@ -125,7 +128,7 @@ class MegauploadCom(Hoster): self.html[0] = self.load(self.pyfile.url) count += 1 if count > 5: - self.fail(_("%s: Megaupload is currently blocking your IP. Try again later, manually."% self.__name__)) + self.fail(_("Megaupload is currently blocking your IP. Try again later, manually.")) try: url_captcha_html = re.search('(http://[\w\.]*?megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1) @@ -199,4 +202,7 @@ class MegauploadCom(Hoster): if re.search("The file you are trying to access is temporarily unavailable", self.html[0]) is not None: self.fail(_("Looks like the file is still not available. Retry downloading later, manually.")) + if re.search("The password you have entered is not correct", self.html[1]): + self.fail(_("Wrong password for download link.")) + return True diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 70c54e7ce..dec184abf 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -1,4 +1,21 @@ +#!/usr/bin/env python # -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + @author: jeix +""" import re -- cgit v1.2.3