diff options
author | Jeix <devnull@localhost> | 2010-09-04 14:00:26 +0200 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-09-04 14:00:26 +0200 |
commit | d13089d6d6ed13cd008a785aec0f12999ba8d5e8 (patch) | |
tree | 94f6eac3fe2ee255b3fef1cbb55f43cf44b8a82f /module | |
parent | new js engine for cnl (diff) | |
download | pyload-d13089d6d6ed13cd008a785aec0f12999ba8d5e8.tar.xz |
megaupload fix 2
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hoster/MegauploadCom.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index aee6ec3b2..a4a577c04 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -71,6 +71,19 @@ class MegauploadCom(Hoster): def download_html(self): for i in range(5): self.html[0] = self.load(self.pyfile.url) + count = 0 + while re.search("document.location='http://www.megaupload.com/?c=msg", self.html[0]) != None: + # megaupload.com/?c=msg usually says: Please check back in 2 minutes, + # so we can spare that http request + self.setWait(120) + self.wantReconnect = True + self.wait() + + self.html[0] = self.load(self.pyfile.url) + count ++ + if count > 5: + self.fail(_("%s: Megaupload is currently blocking your IP. Try again later, manually."% self.__name__)) + try: url_captcha_html = re.search('(http://[\w\.]*?megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1) except: |