summaryrefslogtreecommitdiffstats
path: root/Plugins/RapidshareCom.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-08-04 23:42:55 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2009-08-04 23:42:55 +0200
commitd68d287450054e42a2c6be76316e5e00b2d4cd27 (patch)
treec3a36c7de38a3e31a4c847a6f440b5c88efa8f88 /Plugins/RapidshareCom.py
parentrapidshare fix (diff)
downloadpyload-d68d287450054e42a2c6be76316e5e00b2d4cd27.tar.xz
another rs fix
Diffstat (limited to 'Plugins/RapidshareCom.py')
-rw-r--r--Plugins/RapidshareCom.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/Plugins/RapidshareCom.py b/Plugins/RapidshareCom.py
index ce79a2a36..6bd96cf78 100644
--- a/Plugins/RapidshareCom.py
+++ b/Plugins/RapidshareCom.py
@@ -30,35 +30,36 @@ class RapidshareCom(Plugin):
if self.config['premium']:
self.multi_dl = True
+ self.start_dl = False
+
def prepare(self, thread):
pyfile = self.parent
self.want_reconnect = False
- self.download_html()
- pyfile.status.filename = self.get_file_name()
-
- pyfile.status.exists = self.file_exists()
+ tries = 0
- if not pyfile.status.exists:
- raise Exception, "The file was not found on the server."
+ while not self.start_dl:
+ self.download_html()
+ pyfile.status.filename = self.get_file_name()
- self.download_serverhtml()
- pyfile.status.waituntil = self.time_plus_wait
+ pyfile.status.exists = self.file_exists()
- pyfile.status.want_reconnect = self.want_reconnect
- thread.wait(self.parent)
+ if not pyfile.status.exists:
+ raise Exception, "The file was not found on the server."
- while self.want_reconnect:
- self.download_html()
self.download_serverhtml()
pyfile.status.waituntil = self.time_plus_wait
pyfile.status.want_reconnect = self.want_reconnect
thread.wait(self.parent)
- pyfile.status.url = self.get_file_url()
+ pyfile.status.url = self.get_file_url()
+
+ tries += 1
+ if tries > 5:
+ break
return True
@@ -139,6 +140,7 @@ class RapidshareCom(Plugin):
file_url_pattern = r".*name=\"dlf\" action=\"(.*)\" method=.*"
else:
file_url_pattern = '(http://rs.*)\';" /> %s<br />' % self.config['server']
+ self.start_dl = True
return re.search(file_url_pattern, self.html[1]).group(1)
else:
print self.html[1] #test print