From 50913488f5c67d1f8cb6bb5285b586ec7bdc643e Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 28 Sep 2010 16:33:16 +0200 Subject: rs fix no. 3 --- module/plugins/hoster/RapidshareCom.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 446d5ad3c..1a11dcf2a 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -4,7 +4,7 @@ import re from os import stat, remove -from os.path import join +from time import sleep from module.network.Request import getURL from module.plugins.Hoster import Hoster @@ -59,6 +59,7 @@ class RapidshareCom(Hoster): self.api_data = None self.multiDL = False self.offset = 0 + self.dl_dict = {} self.id = None self.name = None @@ -113,9 +114,9 @@ class RapidshareCom(Hoster): def handleFree(self): while self.no_download: - dl_dict = self.freeWait() + self.dl_dict = self.freeWait() - download = "http://%(host)s/cgi-bin/rsapi.cgi?sub=download_v1&editparentlocation=1&bin=1&fileid=%(id)s&filename=%(name)s&dlauth=%(auth)s#!download|%(server)s|%(id)s|%(name)s|%(size)s" % dl_dict + download = "http://%(host)s/cgi-bin/rsapi.cgi?sub=download_v1&editparentlocation=1&bin=1&fileid=%(id)s&filename=%(name)s&dlauth=%(auth)s#!download|%(server)s|%(id)s|%(name)s|%(size)s" % self.dl_dict dl = self.download(download) @@ -130,8 +131,8 @@ class RapidshareCom(Hoster): 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: + self.no_download = True remove(dl) self.setWait(60) self.log.info(_("Already downloading from this ip address, waiting 60 seconds")) @@ -140,7 +141,7 @@ class RapidshareCom(Hoster): elif "Download auth invalid" in content: remove(dl) self.log.info(_("Invalid Auth Code, download will be restarted")) - self.offset += 5 + sleep(5) self.handleFree() -- cgit v1.2.3