From a72688b208ed4ba3e98234e995f7bc1eb4afec42 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Mon, 16 Jan 2012 20:44:19 +0100 Subject: merge in plugin updates --- module/plugins/hoster/MegauploadCom.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/MegauploadCom.py') diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index 100553ebf..81d528668 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -65,7 +65,7 @@ class MegauploadCom(Hoster): __name__ = "MegauploadCom" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?(megaupload)\.com/.*?(\?|&)d=(?P[0-9A-Za-z]+)" - __version__ = "0.28" + __version__ = "0.31" __description__ = """Megaupload.com Download Hoster""" __author_name__ = ("spoob") __author_mail__ = ("spoob@pyload.org") @@ -74,6 +74,7 @@ class MegauploadCom(Hoster): API_STATUS_MAPPING = {"0": statusMap['online'], "1": statusMap['offline'], "3": statusMap['temp. offline']} FILE_URL_PATTERN = r'' def init(self): self.html = [None, None] @@ -125,12 +126,12 @@ class MegauploadCom(Hoster): if e.args and e.args[0] == 33: # undirect download and resume , not a good idea page = self.load(pyfile.url) - self.download(re.search(r'href=\"(http://[^\"]*?)\" class=\"down_ad_butt1\">', page).group(1)) + self.download(re.search(self.PREMIUM_URL_PATTERN, page).group(1)) return else: raise - check = self.checkDownload({"dllink": re.compile(r'href=\"(http://[^\"]*?)\" class=\"down_ad_butt1\">')}) + check = self.checkDownload({"dllink": re.compile(self.PREMIUM_URL_PATTERN)}) if check == "dllink": self.log.warning(_("You should enable direct Download in your Megaupload Account settings")) @@ -171,7 +172,7 @@ 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' in self.html[0]: + if re.search(r']*name="filepassword"', self.html[0]): pw = self.getPassword() if not pw: self.fail(_("The file is password protected, enter a password and restart.")) @@ -270,4 +271,4 @@ class MegauploadCom(Hoster): if re.search("The password you have entered is not correct", self.html[1]): self.fail(_("Wrong password for download link.")) - return True \ No newline at end of file + return True -- cgit v1.2.3 From 0d2d6daef850ac6bcc7fafccd230e52d2a862c2c Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 3 Jun 2012 17:45:10 +0200 Subject: updates for database + api --- module/plugins/hoster/MegauploadCom.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'module/plugins/hoster/MegauploadCom.py') diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index 336cbfb58..8693e4303 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -2,17 +2,13 @@ # -*- coding: utf-8 -*- import re -from time import sleep from module.plugins.Hoster import Hoster from module.network.RequestFactory import getURL -from module.network.HTTPRequest import BadHeader from module.utils import html_unescape -from module.PyFile import statusMap - -from pycurl import error +from datatypes.PyFile import statusMap def getInfo(urls): yield [(url, 0, 1, url) for url in urls] -- cgit v1.2.3