diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-28 15:31:41 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-05-28 15:31:41 +0200 |
commit | c6c9904590e8b184af34cedb38d2f63f2cfff2f4 (patch) | |
tree | 0a136a036939ea2aad28aa97f383d2c09cad2639 | |
parent | time shedule fix (diff) | |
download | pyload-c6c9904590e8b184af34cedb38d2f63f2cfff2f4.tar.xz |
rapidshare premium support
-rw-r--r-- | Plugins/Plugin.py | 10 | ||||
-rw-r--r-- | Plugins/RapidshareCom.py | 27 | ||||
-rw-r--r-- | Plugins/UploadedTo.py | 3 | ||||
-rw-r--r-- | Plugins/YoutubeCom.py | 8 |
4 files changed, 29 insertions, 19 deletions
diff --git a/Plugins/Plugin.py b/Plugins/Plugin.py index 0345d7b1d..7b7bd1d7e 100644 --- a/Plugins/Plugin.py +++ b/Plugins/Plugin.py @@ -13,6 +13,7 @@ class Plugin(): self.plugin_pattern = None self.plugin_type = "hoster" self.parser = ConfigParser.SafeConfigParser() + self.config = {} props = {} props['name'] = "Base Plugin" props['version'] = "0.1" @@ -68,5 +69,12 @@ class Plugin(): self.parser.read("pluginconfig") return self.parser.get(self.props['name'], value) + def read_config(self): + self.parser.read("pluginconfig") + + if self.parser.has_section(self.props['name']): + for option in self.parser.options(self.props['name']): + self.config[option] = self.parser.get(self.props['name'], option) + def __call__(self): - return self.plugin_name + return self.props['name'] diff --git a/Plugins/RapidshareCom.py b/Plugins/RapidshareCom.py index 8f774937b..0f4f0528c 100644 --- a/Plugins/RapidshareCom.py +++ b/Plugins/RapidshareCom.py @@ -26,6 +26,12 @@ class RapidshareCom(Plugin): self.time_plus_wait = None #time() + wait in seconds self.want_reconnect = False self.multi_dl = False + + self.read_config() + + if self.config['premium']: + self.multi_dl = True + def set_parent_status(self): """ sets all available Statusinfos about a File in self.parent.status @@ -62,6 +68,10 @@ class RapidshareCom(Plugin): def get_wait_time(self): + if self.config['premium'] == "True": + self.time_plus_wait = 0 + return True + if self.html[1] == None: self.download_serverhtml(self) @@ -94,6 +104,9 @@ class RapidshareCom(Plugin): def get_file_url(self): """ returns the absolute downloadable filepath """ + if self.config['premium'] == True: + return self.parent.url + if self.html[1] == None: self.download_serverhtml() if (self.html_old + 5 * 60) < time(): # nach einiger zeit ist die file_url nicht mehr aktuell @@ -114,10 +127,10 @@ class RapidshareCom(Plugin): else: return self.parent.url - def wait_until(self): - if self.html == None: - self.download_html() - return self.time_plus_wait - - def __call__(self): - return self.props['name'] + def proceed(self, url, location): + + if self.config['premium'] == True: + self.req.add_auth(self.config['user'], self.config['pw']) + + + self.req.download(url, location) diff --git a/Plugins/UploadedTo.py b/Plugins/UploadedTo.py index 29817e992..aeda42f1c 100644 --- a/Plugins/UploadedTo.py +++ b/Plugins/UploadedTo.py @@ -80,6 +80,3 @@ class UploadedTo(Plugin): if self.html == None: self.download_html() return self.time_plus_wait - - def __call__(self): - return self.props['name'] diff --git a/Plugins/YoutubeCom.py b/Plugins/YoutubeCom.py index c1ad22102..a21f75518 100644 --- a/Plugins/YoutubeCom.py +++ b/Plugins/YoutubeCom.py @@ -62,11 +62,3 @@ class YoutubeCom(Plugin): return False else: return True - - def wait_until(self): - if self.html == None: - self.download_html() - return self.time_plus_wait - - def __call__(self): - return self.props['name'] |