diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-10 20:16:14 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-10-10 20:16:14 +0200 |
commit | c880a3b8e048b4f9fea5413f09d3745d5b37609f (patch) | |
tree | c19fe4efd71e2e8bd286bbaf551cb0ffe7172f6c /module/plugins/hoster | |
parent | workaround (diff) | |
download | pyload-c880a3b8e048b4f9fea5413f09d3745d5b37609f.tar.xz |
several fixes
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/MegauploadCom.py | 7 | ||||
-rw-r--r-- | module/plugins/hoster/RapidshareCom.py | 41 |
2 files changed, 17 insertions, 31 deletions
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py index 0380f5fe9..17b07b584 100644 --- a/module/plugins/hoster/MegauploadCom.py +++ b/module/plugins/hoster/MegauploadCom.py @@ -79,7 +79,10 @@ class MegauploadCom(Hoster): check = self.checkDownload({"limit": "Download limit exceeded"}) if check == "limit": wait = self.load("http://www.megaupload.com/?c=premium&l=1") - wait = re.search(r"Please wait (\d+) minutes", wait).group(1) + try: + wait = re.search(r"Please wait (\d+) minutes", wait).group(1) + except: + wait = 1 self.log.info(_("Megaupload: waiting %d minues") % int(wait)) self.setWait(int(wait)*60, True) self.wait() @@ -122,8 +125,6 @@ class MegauploadCom(Hoster): if re.search(r"Waiting time before each download begins", self.html[1]) is not None: break - print self.html[0] - def download_api(self): url = "http://megaupload.com/mgr_linkcheck.php" diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 0e3d2e74d..f96e5cd85 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -119,34 +119,19 @@ class RapidshareCom(Hoster): tmp = "#!download|%(server)s|%(id)s|%(name)s|%(size)s" download = "http://%(host)s/cgi-bin/rsapi.cgi?sub=download_v1&editparentlocation=1&bin=1&fileid=%(id)s&filename=%(name)s&dlauth=%(auth)s" % self.dl_dict - dl = self.download(download, ref=False) - - self.postCheck(dl) - - def postCheck(self, dl): - - size = stat(dl) - size = size.st_size - - if (size < int(self.api_data["size"]) and size < 10000): - f = open(dl, "rb") - content = f.read() - f.close() - self.no_download = True - if "You need RapidPro to download more files from your IP address" in content: - remove(dl) - self.setWait(60) - self.log.info(_("Already downloading from this ip address, waiting 60 seconds")) - self.wait() - self.handleFree() - elif "Download auth invalid" in content: - remove(dl) - self.log.info(_("Invalid Auth Code, download will be restarted")) - self.offset += 5 - self.handleFree() - - + self.download(download, ref=False) + check = self.checkDownload({"ip" : "You need RapidPro to download more files from your IP address", + "auth" : "Download auth invalid"}) + if check == "ip": + self.setWait(60) + self.log.info(_("Already downloading from this ip address, waiting 60 seconds")) + self.wait() + self.handleFree() + elif check == "auth": + self.log.info(_("Invalid Auth Code, download will be restarted")) + self.offset += 5 + self.handleFree() def handlePremium(self): info = self.account.getAccountInfo(self.user, True) @@ -189,7 +174,7 @@ class RapidshareCom(Hoster): self.api_data["mirror"] = "http://rs%(serverid)s%(shorthost)s.rapidshare.com/files/%(fileid)s/%(filename)s" % self.api_data def freeWait(self): - """downloads html with the important informations + """downloads html with the important information """ self.html = self.load("http://rapidshare.com/files/%s/%s" % (self.id, self.name),ref=False) |