summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/RapidshareCom.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-10-10 20:16:14 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-10-10 20:16:14 +0200
commitc880a3b8e048b4f9fea5413f09d3745d5b37609f (patch)
treec19fe4efd71e2e8bd286bbaf551cb0ffe7172f6c /module/plugins/hoster/RapidshareCom.py
parentworkaround (diff)
downloadpyload-c880a3b8e048b4f9fea5413f09d3745d5b37609f.tar.xz
several fixes
Diffstat (limited to 'module/plugins/hoster/RapidshareCom.py')
-rw-r--r--module/plugins/hoster/RapidshareCom.py41
1 files changed, 13 insertions, 28 deletions
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)