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 --- config | 4 ++-- module/plugins/RapidshareCom.py | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/config b/config index 60249b162..ac998ff83 100644 --- a/config +++ b/config @@ -1,5 +1,5 @@ [remote] -port = 7272 +port = 7270 password = pwhere [webinterface] @@ -22,7 +22,7 @@ use_reconnect = False link_file = links.txt failed_file = failed_links.txt reconnect_method = reconnect_method -debug_mode = False +debug_mode = True max_download_time = 18000 [updates] 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"