From 64a3d2b06ab4929c1df3d832ef9a12b8228ffc7c Mon Sep 17 00:00:00 2001 From: mkaay Date: Fri, 13 Nov 2009 22:06:22 +0100 Subject: tried to fix rapidshare free slot problem --- module/plugins/RapidshareCom.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'module/plugins/RapidshareCom.py') diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 5044c2e00..73424696e 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -14,7 +14,7 @@ class RapidshareCom(Plugin): props = {} props['name'] = "RapidshareCom" props['type'] = "hoster" - props['pattern'] = r"http://(?:www\.)?(?:rs\d*\.)?rapidshare.com/files/(\d*?)/(.*)" + props['pattern'] = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)" props['version'] = "0.5" props['description'] = """Rapidshare.com Download Plugin""" props['author_name'] = ("spoob", "RaNaN", "mkaay") @@ -25,6 +25,7 @@ class RapidshareCom(Plugin): self.html_old = None #time() where loaded the HTML self.time_plus_wait = None #time() + wait in seconds self.want_reconnect = False + self.no_slots = False self.read_config() if self.config['premium']: self.multi_dl = True @@ -64,8 +65,13 @@ class RapidshareCom(Plugin): pyfile.status.want_reconnect = self.want_reconnect thread.wait(self.parent) + if self.no_slots: + self.download_serverhtml() pyfile.status.url = self.get_file_url() + + if self.no_slots: + raise Exception, "No free slots!" tries += 1 if tries > 5: @@ -113,20 +119,21 @@ class RapidshareCom(Plugin): """ gets the url from self.parent.url saves html in self.html and parses """ url = self.parent.url - self.html[0] = self.req.load(url) + self.html[0] = self.req.load(url, cookies=True) self.html_old = time() def download_serverhtml(self): """downloads html with the important informations """ file_server_url = re.search(r"