diff options
Diffstat (limited to 'Plugins')
-rw-r--r-- | Plugins/Plugin.py | 18 | ||||
-rw-r--r-- | Plugins/RSDF.py | 77 | ||||
-rw-r--r-- | Plugins/RapidshareCom.py | 8 | ||||
-rw-r--r-- | Plugins/YoutubeCom.py | 10 |
4 files changed, 95 insertions, 18 deletions
diff --git a/Plugins/Plugin.py b/Plugins/Plugin.py index 1babd3686..90781f765 100644 --- a/Plugins/Plugin.py +++ b/Plugins/Plugin.py @@ -1,6 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- +import re from time import time from module.network.Request import Request @@ -11,11 +12,11 @@ class Plugin(): self.plugin_pattern = None self.plugin_type = "hoster" pluginProp = {} - pluginProp ['name'] = "Beispiel Plugin" + pluginProp ['name'] = "Base Plugin" pluginProp ['version'] = "0.1" pluginProp ['format'] = "*.py" pluginProp ['description'] = """bla""" - pluginProp ['author'] = "Author" + pluginProp ['author'] = "Spoob" pluginProp ['author_email'] = "nn@nn.de" self.pluginProp = pluginProp self.parent = parent @@ -23,7 +24,7 @@ class Plugin(): self.html = None self.time_plus_wait = None #time() + wait in seconds self.want_reconnect = None - self.multi_dl = True + self.multi_dl = True def set_parent_status(self): """ sets all available Statusinfos about a File in self.parent.status @@ -39,25 +40,26 @@ class Plugin(): def file_exists(self): """ returns True or False """ - if self.html != None: - self.download_html() + return True def get_file_url(self): """ returns the absolute downloadable filepath """ if self.html != None: self.download_html() - return self.parent.url + return self.parent.url def get_file_name(self): - raise NotImplementedError + return re.findall("([^\/=]+)",self.parent.url)[-1] def wait_until(self): if self.html != None: self.download_html() return self.time_plus_wait - + + def proceed(self, url, location): + self.req.download(url, location) def __call__(self): return self.plugin_name diff --git a/Plugins/RSDF.py b/Plugins/RSDF.py new file mode 100644 index 000000000..65f85edb4 --- /dev/null +++ b/Plugins/RSDF.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +import urllib2 +import urllib +import re +import time +import binascii +import base64 +import sys + +from Plugin import Plugin +from time import time + +class RSDF(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + self.plugin_name = "RSDF" + self.plugin_pattern = r".*\.rsdf" + self.plugin_type = "container" + self.plugin_config = {} + pluginProp = {} + pluginProp ['name'] = "RSDF" + pluginProp ['version'] = "0.1" + pluginProp ['format'] = "*.py" + pluginProp ['description'] = """RSDF Plugin""" + pluginProp ['author'] = "RaNaN" + pluginProp ['author_email'] = "RaNaN@pyload.org" + self.pluginProp = pluginProp + self.parent = parent + self.multi_dl = True + self.links = [] + + def file_exists(self): + """ returns True or False + """ + return True + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + return self.parent.url + + def __call__(self): + return self.plugin_name + + def proceed(self, url, location): + try: + from Crypto.Cipher import AES + + infile = url.replace("\n","") + Key = binascii.unhexlify('8C35192D964DC3182C6F84F3252239EB4A320D2500000000') + + IV = binascii.unhexlify('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF') + IV_Cipher = AES.new(Key,AES.MODE_ECB) + IV = IV_Cipher.encrypt(IV) + + obj = AES.new(Key,AES.MODE_CFB,IV) + + rsdf = open(infile,'r') + + data = rsdf.read() + data = binascii.unhexlify(''.join(data.split())) + data = data.splitlines() + + for link in data: + link = base64.b64decode(link) + link = obj.decrypt(link) + decryptedUrl = link.replace('CCF: ','') + self.links.append(decryptedUrl) + + rsdf.close() + print self.links + + except: + print "Kein Crypto installiert, RSDF Plugin kann nicht genutzt werden"
\ No newline at end of file diff --git a/Plugins/RapidshareCom.py b/Plugins/RapidshareCom.py index f512b2460..0579ac8f8 100644 --- a/Plugins/RapidshareCom.py +++ b/Plugins/RapidshareCom.py @@ -17,22 +17,20 @@ class RapidshareCom(Plugin): self.plugin_pattern = r"http://(?:www.)?rapidshare.com/files/" self.plugin_type = "hoster" self.plugin_config = {} - pluginProp = {} + pluginProp = {} pluginProp ['name'] = "RapidshareCom" pluginProp ['version'] = "0.1" pluginProp ['format'] = "*.py" pluginProp ['description'] = """Rapidshare Plugin""" pluginProp ['author'] = "spoob" pluginProp ['author_email'] = "nn@nn.de" - pluginProp ['multi_dl'] = False - self.pluginProp = pluginProp + self.pluginProp = pluginProp self.parent = parent self.html = [None, None] - self.prehtml = None self.html_old = None #time() where loaded the HTML self.time_plus_wait = None #time() + wait in seconds self.want_reconnect = False - self.multi_dl = False + self.multi_dl = False def set_parent_status(self): """ sets all available Statusinfos about a File in self.parent.status diff --git a/Plugins/YoutubeCom.py b/Plugins/YoutubeCom.py index 7224323bb..20a9bd7d1 100644 --- a/Plugins/YoutubeCom.py +++ b/Plugins/YoutubeCom.py @@ -13,14 +13,14 @@ class YoutubeCom(Plugin): self.plugin_pattern = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=(.*)" self.plugin_type = "hoster" self.plugin_config = {} - pluginProp = {} + pluginProp = {} pluginProp ['name'] = "YoutubeCom" pluginProp ['version'] = "0.1" pluginProp ['format'] = "*.py" pluginProp ['description'] = """Youtube Plugin""" pluginProp ['author'] = "spoob" pluginProp ['author_email'] = "spoob@pyload.org" - self.pluginProp = pluginProp + self.pluginProp = pluginProp self.parent = parent self.html = None self.html_old = None #time() where loaded the HTML @@ -54,9 +54,9 @@ class YoutubeCom(Plugin): def get_file_name(self): if self.html == None: self.download_html() - - file_name_pattern = r"<title>YouTube - (.*)</title>" - return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.mp4' + + file_name_pattern = r"<title>YouTube - (.*)</title>" + return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.mp4' def file_exists(self): """ returns True or False |