diff options
Diffstat (limited to 'Plugins/RapidshareCom.py')
-rw-r--r-- | Plugins/RapidshareCom.py | 26 |
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 |