summaryrefslogtreecommitdiffstats
path: root/Plugins/RapidshareCom.py
diff options
context:
space:
mode:
authorGravatar cp1 <christopherpool1@googlemail.com> 2009-06-11 16:50:48 +0200
committerGravatar cp1 <christopherpool1@googlemail.com> 2009-06-11 16:50:48 +0200
commitfd6e286ee089cf75276f2581471aba254d69fcb5 (patch)
tree1f91e2063f3182d172d7c7f70c4fdb98b407a60b /Plugins/RapidshareCom.py
parentadd wxversion selector to ensure wxWidgets 2.8 is used (diff)
downloadpyload-fd6e286ee089cf75276f2581471aba254d69fcb5.tar.xz
correcting false identation (tabs to spaces)
Diffstat (limited to 'Plugins/RapidshareCom.py')
-rw-r--r--Plugins/RapidshareCom.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/Plugins/RapidshareCom.py b/Plugins/RapidshareCom.py
index 362c2cf73..f7b981e37 100644
--- a/Plugins/RapidshareCom.py
+++ b/Plugins/RapidshareCom.py
@@ -8,7 +8,7 @@ from time import time
from Plugin import Plugin
class RapidshareCom(Plugin):
-
+
def __init__(self, parent):
Plugin.__init__(self, parent)
props = {}
@@ -41,10 +41,10 @@ class RapidshareCom(Plugin):
self.parent.status.filename = self.get_file_name()
self.parent.status.url = self.get_file_url()
self.parent.status.waituntil = self.wait_until()
-
+
def download_html(self):
""" gets the url from self.parent.url saves html in self.html and parses
- """
+ """
url = self.parent.url
html = self.req.load(url)
self.html[0] = html
@@ -59,7 +59,7 @@ class RapidshareCom(Plugin):
self.download_html()
if self.config['premium']:
- return False
+ return False
file_server_url = re.search(r"<form action=\"(.*?)\"", self.html[0]).group(1)
#free user
@@ -67,7 +67,7 @@ class RapidshareCom(Plugin):
self.html[1] = self.req.load(file_server_url, None, {"dl.start": "Free"})
self.html_old = time()
self.get_wait_time()
-
+
def get_wait_time(self):
if self.config['premium']:
@@ -76,7 +76,7 @@ class RapidshareCom(Plugin):
if self.html[1] == None:
self.download_serverhtml(self)
-
+
if re.search(r".*is already downloading.*", self.html[1]) != None:
self.time_plus_wait = time() + 10 * 60
try:
@@ -88,9 +88,9 @@ class RapidshareCom(Plugin):
self.time_plus_wait = time() + 2 * 60
wait_seconds = re.search(r"var c=(.*);.*", self.html[1]).group(1)
self.time_plus_wait = time() + int(wait_seconds) + 5
-
+
def file_exists(self):
- """ returns True or False
+ """ returns True or False
"""
if self.html[0] == None:
self.download_html()
@@ -98,8 +98,8 @@ class RapidshareCom(Plugin):
re.search(r"(<p>This limit is reached.</p>)", self.html[0]) or \
re.search(r"(.*is momentarily not available.*)", self.html[0]) or \
re.search(r"(.*The uploader has removed this file from the server.*)", self.html[0]) or \
- re.search(r"(.*This file is suspected to contain illegal content.*)", self.html[0]):
- return False
+ re.search(r"(.*This file is suspected to contain illegal content.*)", self.html[0]):
+ return False
else:
return True
@@ -120,17 +120,17 @@ class RapidshareCom(Plugin):
return re.search(file_url_pattern, self.html[1]).group(1)
else:
return False
-
+
def get_file_name(self):
if self.html[0] == None:
self.download_html()
file_name_pattern = r"<p class=\"downloadlink\">.+/(.+)<font"
return re.findall(file_name_pattern, self.html[0])[0]
-
+
def proceed(self, url, location):
if self.config['premium']:
self.req.add_auth(self.config['username'], self.config['password'])
- self.req.download(url, location)
+ self.req.download(url, location) \ No newline at end of file