summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-01-10 02:01:53 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-01-10 02:01:53 +0100
commit10a945f94ddf44486f8d876aa355ba75cb8b7d46 (patch)
tree3495e5083d59628e49317ddfac3233f0c283f748 /module
parentadd premium4.me (diff)
downloadpyload-10a945f94ddf44486f8d876aa355ba75cb8b7d46.tar.xz
closed #491 mf, fix mu password
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hoster/MediafireCom.py50
-rw-r--r--module/plugins/hoster/MegauploadCom.py4
2 files changed, 32 insertions, 22 deletions
diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py
index 14180ff3d..f970512ab 100644
--- a/module/plugins/hoster/MediafireCom.py
+++ b/module/plugins/hoster/MediafireCom.py
@@ -58,12 +58,12 @@ class MediafireCom(SimpleHoster):
__name__ = "MediafireCom"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)*mediafire\.com/[^?].*"
- __version__ = "0.71"
+ __version__ = "0.72"
__description__ = """Mediafire.com plugin - free only"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
- DOWNLOAD_LINK_PATTERN = r'<div class="download_link"[^>]*z-index:(?P<zindex>\d+)[^>]*>\s*<a href="(?P<href>[^"]+)"'
+ DOWNLOAD_LINK_PATTERN = r'<div class="download_link"[^>]*(?:z-index:(?P<zindex>\d+))?[^>]*>\s*<a href="(?P<href>http://[^"]+)"'
JS_KEY_PATTERN = r"DoShow\('mfpromo1'\);[^{]*{((\w+)='';.*?)eval\(\2\);"
JS_ZMODULO_PATTERN = r"\('z-index'\)\) \% (\d+)\)\);"
RECAPTCHA_PATTERN = r'src="http://(?:api.recaptcha.net|www.google.com/recaptcha/api)/challenge\?k=([^"]+)">'
@@ -101,25 +101,35 @@ class MediafireCom(SimpleHoster):
else:
self.fail("No or incorrect password")
- found = re.search(self.JS_KEY_PATTERN, self.html)
- try:
- result = self.js.eval(found.group(1))
- zmodulo = int(re.search(self.JS_ZMODULO_PATTERN, result).group(1))
- self.logDebug("ZMODULO: %d" % zmodulo)
- except Exception, e:
- self.logDebug(e)
- self.retry(3, 0, "Parse error (MODULO)")
+ links = re.findall(self.DOWNLOAD_LINK_PATTERN, self.html)
+ link_count = len(links)
+ self.logDebug('LINKS ', links)
- vlink = {'zindex': 0, 'href': ''}
- for found in re.finditer(self.DOWNLOAD_LINK_PATTERN, self.html):
- dlink = found.groupdict()
- #self.logDebug(dlink)
- dlink['zindex'] = int(dlink['zindex']) % zmodulo
- if dlink['zindex'] >= vlink['zindex']:
- vlink = dlink
-
- self.logDebug("DOWNLOAD LINK:", vlink)
- self.download(vlink['href'])
+ if link_count == 0:
+ self.retry(3, 0, "No links found")
+
+ elif link_count > 1:
+ found = re.search(self.JS_KEY_PATTERN, self.html)
+ try:
+ result = self.js.eval(found.group(1))
+ zmodulo = int(re.search(self.JS_ZMODULO_PATTERN, result).group(1))
+ self.logDebug("ZMODULO: %d" % zmodulo)
+ except Exception, e:
+ self.logDebug(e)
+ self.parseError("ZMODULO")
+
+ max_index = 0
+ for index, url in links:
+ index = int(index) % zmodulo
+ if index >= max_index:
+ download_url = url
+
+ self.logDebug("DOWNLOAD LINK:", download_url)
+
+ else:
+ zindex, download_url = links[0]
+
+ self.download(download_url)
def checkCaptcha(self):
for i in range(5):
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py
index 6b5d10729..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<id>[0-9A-Za-z]+)"
- __version__ = "0.3"
+ __version__ = "0.31"
__description__ = """Megaupload.com Download Hoster"""
__author_name__ = ("spoob")
__author_mail__ = ("spoob@pyload.org")
@@ -172,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'<input[^>]*name="filepassword"', self.html[0]):
pw = self.getPassword()
if not pw:
self.fail(_("The file is password protected, enter a password and restart."))