From 6b5d39a18461a45e53fd4048e1ac6a5cbd075b8c Mon Sep 17 00:00:00 2001 From: spoob Date: Fri, 4 Sep 2009 15:13:57 +0200 Subject: clean root folder --- Plugins/BluehostTo.py | 71 ------------------ Plugins/CCF.py | 60 --------------- Plugins/DLC.pyc | Bin 3692 -> 0 bytes Plugins/DepositfilesCom.py | 62 --------------- Plugins/FourChan.py | 41 ---------- Plugins/GigasizeCom.py | 84 --------------------- Plugins/HoerbuchIn.py | 48 ------------ Plugins/LixIn.py | 36 --------- Plugins/MegauploadCom.py | 77 ------------------- Plugins/MyvideoDe.py | 65 ---------------- Plugins/NetloadIn.py | 146 ------------------------------------ Plugins/OneKhDe.py | 38 ---------- Plugins/Plugin.py | 123 ------------------------------ Plugins/RSDF.py | 59 --------------- Plugins/RSLayerCom.py | 39 ---------- Plugins/RapidshareCom.py | 152 ------------------------------------- Plugins/RelinkUs.py | 39 ---------- Plugins/ShareonlineBiz.py | 75 ------------------- Plugins/ShragleCom.py | 72 ------------------ Plugins/StealthTo.py | 47 ------------ Plugins/UploadedTo.py | 97 ------------------------ Plugins/XupIn.py | 69 ----------------- Plugins/YoupornCom.py | 62 --------------- Plugins/YoutubeChannel.py | 49 ------------ Plugins/YoutubeCom.py | 63 ---------------- Plugins/ZippyshareCom.py | 62 --------------- Plugins/ZshareNet.py | 72 ------------------ Plugins/__init__.py | 1 - config | 4 +- module/network/Request.py | 1 - module/plugins/BluehostTo.py | 71 ++++++++++++++++++ module/plugins/CCF.py | 60 +++++++++++++++ module/plugins/DLC.pyc | Bin 0 -> 3692 bytes module/plugins/DepositfilesCom.py | 62 +++++++++++++++ module/plugins/FourChan.py | 41 ++++++++++ module/plugins/GigasizeCom.py | 84 +++++++++++++++++++++ module/plugins/HoerbuchIn.py | 48 ++++++++++++ module/plugins/LixIn.py | 36 +++++++++ module/plugins/MegauploadCom.py | 77 +++++++++++++++++++ module/plugins/MyvideoDe.py | 65 ++++++++++++++++ module/plugins/NetloadIn.py | 136 +++++++++++++++++++++++++++++++++ module/plugins/OneKhDe.py | 38 ++++++++++ module/plugins/Plugin.py | 123 ++++++++++++++++++++++++++++++ module/plugins/RSDF.py | 59 +++++++++++++++ module/plugins/RSLayerCom.py | 39 ++++++++++ module/plugins/RapidshareCom.py | 153 ++++++++++++++++++++++++++++++++++++++ module/plugins/RelinkUs.py | 39 ++++++++++ module/plugins/ShareonlineBiz.py | 75 +++++++++++++++++++ module/plugins/ShragleCom.py | 72 ++++++++++++++++++ module/plugins/StealthTo.py | 47 ++++++++++++ module/plugins/UploadedTo.py | 97 ++++++++++++++++++++++++ module/plugins/XupIn.py | 69 +++++++++++++++++ module/plugins/YoupornCom.py | 62 +++++++++++++++ module/plugins/YoutubeChannel.py | 49 ++++++++++++ module/plugins/YoutubeCom.py | 63 ++++++++++++++++ module/plugins/ZippyshareCom.py | 62 +++++++++++++++ module/plugins/ZshareNet.py | 72 ++++++++++++++++++ module/plugins/__init__.py | 1 + pyLoadCore.py | 9 +-- 59 files changed, 1806 insertions(+), 1817 deletions(-) delete mode 100644 Plugins/BluehostTo.py delete mode 100644 Plugins/CCF.py delete mode 100644 Plugins/DLC.pyc delete mode 100644 Plugins/DepositfilesCom.py delete mode 100644 Plugins/FourChan.py delete mode 100644 Plugins/GigasizeCom.py delete mode 100644 Plugins/HoerbuchIn.py delete mode 100644 Plugins/LixIn.py delete mode 100644 Plugins/MegauploadCom.py delete mode 100644 Plugins/MyvideoDe.py delete mode 100644 Plugins/NetloadIn.py delete mode 100644 Plugins/OneKhDe.py delete mode 100644 Plugins/Plugin.py delete mode 100644 Plugins/RSDF.py delete mode 100644 Plugins/RSLayerCom.py delete mode 100644 Plugins/RapidshareCom.py delete mode 100644 Plugins/RelinkUs.py delete mode 100644 Plugins/ShareonlineBiz.py delete mode 100644 Plugins/ShragleCom.py delete mode 100644 Plugins/StealthTo.py delete mode 100644 Plugins/UploadedTo.py delete mode 100644 Plugins/XupIn.py delete mode 100644 Plugins/YoupornCom.py delete mode 100644 Plugins/YoutubeChannel.py delete mode 100644 Plugins/YoutubeCom.py delete mode 100644 Plugins/ZippyshareCom.py delete mode 100644 Plugins/ZshareNet.py delete mode 100644 Plugins/__init__.py create mode 100644 module/plugins/BluehostTo.py create mode 100644 module/plugins/CCF.py create mode 100644 module/plugins/DLC.pyc create mode 100644 module/plugins/DepositfilesCom.py create mode 100644 module/plugins/FourChan.py create mode 100644 module/plugins/GigasizeCom.py create mode 100644 module/plugins/HoerbuchIn.py create mode 100644 module/plugins/LixIn.py create mode 100644 module/plugins/MegauploadCom.py create mode 100644 module/plugins/MyvideoDe.py create mode 100644 module/plugins/NetloadIn.py create mode 100644 module/plugins/OneKhDe.py create mode 100644 module/plugins/Plugin.py create mode 100644 module/plugins/RSDF.py create mode 100644 module/plugins/RSLayerCom.py create mode 100644 module/plugins/RapidshareCom.py create mode 100644 module/plugins/RelinkUs.py create mode 100644 module/plugins/ShareonlineBiz.py create mode 100644 module/plugins/ShragleCom.py create mode 100644 module/plugins/StealthTo.py create mode 100644 module/plugins/UploadedTo.py create mode 100644 module/plugins/XupIn.py create mode 100644 module/plugins/YoupornCom.py create mode 100644 module/plugins/YoutubeChannel.py create mode 100644 module/plugins/YoutubeCom.py create mode 100644 module/plugins/ZippyshareCom.py create mode 100644 module/plugins/ZshareNet.py create mode 100644 module/plugins/__init__.py diff --git a/Plugins/BluehostTo.py b/Plugins/BluehostTo.py deleted file mode 100644 index 1ecd47122..000000000 --- a/Plugins/BluehostTo.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import time - -from Plugin import Plugin - -class BluehostTo(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "BluehostTo" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www.)?bluehost.to/file/" - props['version'] = "0.1" - props['description'] = """Bluehost Download PLugin""" - props['author_name'] = ("RaNaN") - props['author_mail'] = ("RaNaN@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - time.sleep(1.5) - self.html = self.req.load(url, cookies=True) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - - inputs = re.findall(r"(<(input|form)[^>]+)", self.html) - for i in inputs: - if re.search(r"name=\"BluehostVers2dl\"",i[0]): - self.BluehostVers2dl = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"PHPSESSID\"",i[0]): - self.PHPSESSID = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"DownloadV2Hash\"",i[0]): - self.DownloadV2Hash = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"access\"",i[0]): - self.access = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"download\"",i[0]): - url = re.search(r"action=\"([^\"]+)", i[0]).group(1) - - return url - - def get_file_name(self): - if self.html == None: - self.download_html() - file_name_pattern = r"
.+: (.+)<\/b><\/center>" - return re.search(file_name_pattern, self.html).group(1) - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - - if re.search(r"html", self.html) == None: - return False - else: - return True - - def proceed(self, url, location): - self.req.download(url, location, {'BluehostVers2dl': self.BluehostVers2dl, 'DownloadV2Hash': self.DownloadV2Hash, 'PHPSESSID': self.PHPSESSID, 'access': self.access}) diff --git a/Plugins/CCF.py b/Plugins/CCF.py deleted file mode 100644 index d7792dce4..000000000 --- a/Plugins/CCF.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os.path -import random -import re -import tempfile -import urllib2 - -from Plugin import Plugin -from module.network.MultipartPostHandler import MultipartPostHandler - -class CCF(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "CCF" - props['type'] = "container" - props['pattern'] = r".*\.ccf" - props['version'] = "0.1" - props['description'] = """CCF Container Convert Plugin""" - props['author_name'] = ("Willnix") - props['author_mail'] = ("Willnix@pyload.org") - self.props = props - self.parent = parent - self.multi_dl = True - self.links = [] - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - infile = url.replace("\n", "") - - opener = urllib2.build_opener(MultipartPostHandler) - params = {"src": "ccf", - "filename": "test.ccf", - "upload": open(infile, "rb")} - tempdlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', params).read() - - random.seed() - tempdir = tempfile.gettempdir() - if tempdir[0] == '/': - delim = '/' - else: - delim = '\\' - tempdlc_name = tempdir + delim + str(random.randint(0, 100)) + '-tmp.dlc' - while os.path.exists(tempdlc_name): - tempdlc_name = tempfile.gettempdir() + '/' + str(random.randint(0, 100)) + '-tmp.dlc' - - tempdlc = open(tempdlc_name, "w") - tempdlc.write(re.search(r'(.*)', tempdlc_content, re.DOTALL).group(1)) - tempdlc.close - - self.links.append(tempdlc_name) - - return True \ No newline at end of file diff --git a/Plugins/DLC.pyc b/Plugins/DLC.pyc deleted file mode 100644 index 5d4809178..000000000 Binary files a/Plugins/DLC.pyc and /dev/null differ diff --git a/Plugins/DepositfilesCom.py b/Plugins/DepositfilesCom.py deleted file mode 100644 index b2f6db29c..000000000 --- a/Plugins/DepositfilesCom.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import urllib -from Plugin import Plugin - -class DepositfilesCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "DepositfilesCom" - props['type'] = "hoster" - props['pattern'] = r"http://depositfiles.com/.{2,}/files/" - props['version'] = "0.1" - props['description'] = """Depositfiles.com Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.want_reconnect = False - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_url = urllib.unquote(re.search('
', self.html).group(1) - return file_name - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: - return False - else: - return True - - def proceed(self, url, location): - - self.req.download(url, location, cookies=True) diff --git a/Plugins/FourChan.py b/Plugins/FourChan.py deleted file mode 100644 index 840274457..000000000 --- a/Plugins/FourChan.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from Plugin import Plugin - -class FourChan(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "FourChan" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?(img\.)?(zip\.)?4chan.org/\w+/(res/|imgboard\.html)" - props['version'] = "0.1" - props['description'] = """4chan.org Thread Download Plugin""" - props['author_name'] = ("Spoob") - props['author_mail'] = ("Spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - url = self.parent.url - html = self.req.load(url) - link_pattern = "" - temp_links = [] - if "imagebord.html" in url: - link_pattern = '[Reply]' - temp_links = re.findall(link_pattern, html) - for link in re.findall(link_pattern, html): - temp_links.append(link) - else: - temp_links = re.findall('File : " + container + ":(.*?)
", self.html).group(1) - tmp = re.findall('
Part \d+', download_content) - if tmp == []: continue - for link in tmp: - link_html = self.req.load(link, cookies=True) - temp_links.append(re.search('', self.html[0]).group(1) - self.html[1] = self.req.load(url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar}, cookies=True) - if re.search(r"Waiting time before each download begins", self.html[1]) != None: - break - - os.remove(captcha_image) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_url_pattern = 'id="downloadlink">", self.html).group(1) - file_url = videoServer + videoId + ".flv" - print videoId - print videoServer - print file_url - return file_url - - def get_file_name(self): - if self.html == None: - self.download_html() - file_name_pattern = r"

(.*)

" - return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.flv' - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"(.* Das angeforderte Video ist nicht.*)", self.html) != None: - return False - else: - return True diff --git a/Plugins/NetloadIn.py b/Plugins/NetloadIn.py deleted file mode 100644 index 8bff067de..000000000 --- a/Plugins/NetloadIn.py +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import re -import tempfile -from time import time -from time import sleep - -from Plugin import Plugin - -class NetloadIn(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "NetloadIn" - props['type'] = "hoster" - props['pattern'] = r"http://.*netload\.in/" - props['version'] = "0.1" - props['description'] = """Netload.in Download Plugin""" - props['author_name'] = ("spoob", "RaNaN") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = [None, None, None] - self.want_reconnect = False - self.init_ocr() - self.multi_dl = False - - def prepare(self, thread): - pyfile = self.parent - - self.want_reconnect = False - - tries = 0 - - while not pyfile.status.url: - - self.req.clear_cookies() - self.download_html() - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - - pyfile.status.filename = self.get_file_name() - - if self.config['premium']: - pyfile.status.url = self.parent.url - return True - - self.download_html2() - - self.get_wait_time() - - 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() - - tries += 1 - if tries > 3: - raise Exception, "Error while preparing DL, HTML dump: %s %s" % (self.html[0], self.html[1]) - - - return True - - - def download_html(self): - url = self.parent.url - self.html[0] = self.req.load(url, cookies=True) - - def download_html2(self): - url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") - - for i in range(6): - - self.html[1] = self.req.load(url_captcha_html, cookies=True) - - try: - captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) - except: - url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[1]).group(1).replace("amp;", "") - self.html[1] = self.req.load(url_captcha_html, cookies=True) - captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) - - file_id = re.search('', self.html[1]).group(1) - - captcha_image = tempfile.NamedTemporaryFile(suffix=".png").name - - self.req.download(captcha_url, captcha_image, cookies=True) - captcha = self.ocr.get_captcha(captcha_image) - self.logger.debug("Captcha %s: %s" % (i, captcha)) - sleep(5) - self.html[2] = self.req.load("http://netload.in/index.php?id=10", post={"file_id": file_id, "captcha_check": captcha}, cookies=True) - - os.remove(captcha_image) - - if re.search(r"(We will prepare your download..|We had a reqeust with the IP)", self.html[2]) != None: - return True - - raise Exception, "Captcha reading failed" - - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - try: - file_url_pattern = r"
Click here" - search = re.search(file_url_pattern, self.html[2]) - return search.group(1) - except: - return None - - def get_wait_time(self): - wait = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) - self.time_plus_wait = time() + wait / 100 - - if re.search(r"We had a reqeust with the IP", self.html[2]): - self.want_reconnect = True - - def get_file_name(self): - try: - file_name_pattern = '\t\t\t(.+)' - return re.search(file_name_pattern, self.html[0]).group(1) - except: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if re.search(r"The file has been deleted", self.html[0]) != None: - return False - else: - return True - - def proceed(self, url, location): - - if self.config['premium']: - self.req.add_auth(self.config['username'], self.config['password']) - - self.req.download(url, location, cookies=True) diff --git a/Plugins/OneKhDe.py b/Plugins/OneKhDe.py deleted file mode 100644 index 15c3a6872..000000000 --- a/Plugins/OneKhDe.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.unescape import unescape -from Plugin import Plugin - -class OneKhDe(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "OneKhDe" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?1kh.de/f/" - props['version'] = "0.1" - props['description'] = """1kh.de Container Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - url = self.parent.url - self.html = self.req.load(url) - temp_links = [] - link_ids = re.findall(r"", self.req.load("http://1kh.de/l/" + id)).group(1)) - temp_links.append(new_link) - self.links = temp_links diff --git a/Plugins/Plugin.py b/Plugins/Plugin.py deleted file mode 100644 index 0a7b3ecb2..000000000 --- a/Plugins/Plugin.py +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -#Copyright (C) 2009 kingzero, RaNaN -# -#This program is free software; you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 3 of the License, -#or (at your option) any later version. -# -#This program is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -#See the GNU General Public License for more details. -# -#You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -### -import ConfigParser -import logging -import re - -from module.network.Request import Request - -class Plugin(): - - def __init__(self, parent): - self.parser = ConfigParser.SafeConfigParser() - self.config = {} - props = {} - props['name'] = "BasePlugin" - props['version'] = "0.1" - props['pattern'] = None - props['type'] = "hoster" - props['description'] = """Base Plugin""" - props['author_name'] = ("RaNaN", "spoob") - props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") - self.props = props - self.parent = parent - self.req = Request() - self.html = 0 - self.time_plus_wait = 0 #time() + wait in seconds - self.want_reconnect = False - self.multi_dl = True - self.ocr = None #captcha reader instance - self.logger = logging.getLogger("log") - - def prepare(self, thread): - pyfile = self.parent - - self.want_reconnect = False - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - return False - - pyfile.status.filename = self.get_file_name() - - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.url = self.get_file_url() - pyfile.status.want_reconnect = self.want_reconnect - - thread.wait(self.parent) - - return True - - def set_parent_status(self): - """ sets all available Statusinfos about a File in self.parent.status - """ - pass - - def download_html(self): - """ gets the url from self.parent.url saves html in self.html and parses - """ - html = "" - self.html = html - - 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 get_file_name(self): - 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 set_config(self): - pass - - def get_config(self, value): - 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, raw=True) - self.config[option] = False if self.config[option].lower() == 'false' else self.config[option] - - def init_ocr(self): - modul = __import__("captcha." + self.props['name'], fromlist=['captcha']) - captchaClass = getattr(modul, self.props['name']) - self.ocr = captchaClass() - - def __call__(self): - return self.props['name'] diff --git a/Plugins/RSDF.py b/Plugins/RSDF.py deleted file mode 100644 index c2406d6e0..000000000 --- a/Plugins/RSDF.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import base64 -import binascii - -from Plugin import Plugin - -class RSDF(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "RSDF" - props['type'] = "container" - props['pattern'] = r".*\.rsdf" - props['version'] = "0.2" - props['description'] = """RSDF Container Decode Plugin""" - props['author_name'] = ("RaNaN", "spoob") - props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") - self.props = props - self.parent = parent - self.multi_dl = True - self.links = [] - - def file_exists(self): - """ returns True or False - """ - return True - - 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() - - except: - print "Kein Crypto installiert, RSDF Plugin kann nicht genutzt werden" diff --git a/Plugins/RSLayerCom.py b/Plugins/RSLayerCom.py deleted file mode 100644 index e470c1748..000000000 --- a/Plugins/RSLayerCom.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.unescape import unescape -from Plugin import Plugin - -class RSLayerCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "RSLayerCom" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?rs-layer.com/directory-" - props['version'] = "0.1" - props['description'] = """RS-Layer.com Container Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - url = self.parent.url - self.html = self.req.load(url) - temp_links = [] - link_ids = re.findall(r"onclick=\"getFile\(\'([0-9]{7}-.{8})\'\);changeBackgroundColor", self.html) - for id in link_ids: - new_link = unescape(re.search(r"name=\"file\" src=\"(.*)\">", self.req.load("http://rs-layer.com/link-" + id + ".html")).group(1)) - print new_link - temp_links.append(new_link) - self.links = temp_links diff --git a/Plugins/RapidshareCom.py b/Plugins/RapidshareCom.py deleted file mode 100644 index 731554f87..000000000 --- a/Plugins/RapidshareCom.py +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import time - -from Plugin import Plugin - -class RapidshareCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "RapidshareCom" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www.)?(rs\d*.)?rapidshare.com/files/" - props['version'] = "0.4" - props['description'] = """Rapidshare.com Download Plugin""" - props['author_name'] = ("spoob", "RaNaN") - props['author_mail'] = ("spoob@pyload.org", "ranan@pyload.org") - self.props = props - self.parent = parent - self.html = [None, 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.read_config() - if self.config['premium']: - self.multi_dl = True - - self.start_dl = False - - def prepare(self, thread): - pyfile = self.parent - - self.want_reconnect = False - - tries = 0 - - while not self.start_dl or not pyfile.status.url: - - self.req.clear_cookies() - - self.download_html() - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - - pyfile.status.filename = self.get_file_name() - - if self.config['premium']: - pyfile.status.url = self.parent.url - return True - - 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() - - tries += 1 - if tries > 5: - raise Exception, "Error while preparing, HTML dump:"+ str(self.html[0]) + str(self.html[1]) - - return True - - def download_html(self): - """ gets the url from self.parent.url saves html in self.html and parses - """ - url = self.parent.url - self.html[0] = self.req.load(url) - self.html_old = time() - - self.download_serverhtml() - - def download_serverhtml(self): - """downloads html with the important informations - """ - file_server_url = re.search(r"This limit is reached.

)", 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 - else: - return True - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.config['premium']: - self.start_dl = True - return self.parent.url - - #if (self.html_old + 5 * 60) < time(): # nach einiger zeit ist die file_url nicht mehr aktuell - # self.download_serverhtml() - - - try: - if self.config['server'] == "": - file_url_pattern = r".*name=\"dlf\" action=\"(.*)\" method=.*" - else: - file_url_pattern = '(http://rs.*)\';" /> %s
' % self.config['server'] - - self.start_dl = True - return re.search(file_url_pattern, self.html[1]).group(1) - except Exception, e: - self.start_dl = False - return False - #print self.html[1] #test print - #raise Exception, "Error when retrieving download url" - - def get_file_name(self): - - file_name_pattern = r"

.+/(.+) ", self.req.load("http://relink.us/f/%s/1/%i" % (container_id, number))).group(1) - temp_links.append(new_link) - print temp_links - self.links = temp_links diff --git a/Plugins/ShareonlineBiz.py b/Plugins/ShareonlineBiz.py deleted file mode 100644 index d42ef9302..000000000 --- a/Plugins/ShareonlineBiz.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import re -import tempfile -from time import time -from base64 import b64decode - -from Plugin import Plugin - -class ShareonlineBiz(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "ShareonlineBiz" - props['type'] = "hoster" - props['pattern'] = r"(?:http://)?(?:www.)?share-online.biz/download.php\?id=" - props['version'] = "0.1" - props['description'] = """Shareonline.biz Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = [None, None] - self.want_reconnect = False - self.init_ocr() - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html[0] = self.req.load(url, cookies=True) - - captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name - - for i in range(5): - self.req.download("http://www.share-online.biz/captcha.php", captcha_image, cookies=True) - captcha = self.ocr.get_captcha(captcha_image) - self.html[1] = self.req.load(url, post={"captchacode": captcha}, cookies=True) - if re.search(r"Der Download ist Ihnen zu langsam?", self.html[1]) != None: - self.time_plus_wait = time() + 15 - break - - os.remove(captcha_image) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_url_pattern = 'loadfilelink\.decode\("(.*==)"\);' - return b64decode(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() - if not self.want_reconnect: - file_name_pattern = 'class="locatedActive">Download (.*)' - return re.search(file_name_pattern, self.html[1]).group(1) - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html[0] == None: - self.download_html() - if re.search(r"nicht zum Download bereitgestellt werden", self.html[0]) != None: - return False - else: - return True diff --git a/Plugins/ShragleCom.py b/Plugins/ShragleCom.py deleted file mode 100644 index bcf650d69..000000000 --- a/Plugins/ShragleCom.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import time - -from Plugin import Plugin - -class ShragleCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "ShragleCom" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www.)?shragle.com/files/" - props['version'] = "0.1" - props['description'] = """Shragle Download PLugin""" - props['author_name'] = ("RaNaN") - props['author_mail'] = ("RaNaN@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.multi_dl = False - - def set_parent_status(self): - """ sets all available Statusinfos about a File in self.parent.status - """ - if self.html == None: - self.download_html() - self.parent.status.filename = self.get_file_name() - self.parent.status.url = self.get_file_url() - self.parent.status.wait = self.wait_until() - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - self.time_plus_wait = time.time() + 10 - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - - self.fileID = re.search(r"name=\"fileID\" value=\"([^\"]+)", self.html).group(1) - self.dlSession = re.search(r"name=\"dlSession\" value=\"([^\"]+)", self.html).group(1) - self.userID = "" - self.password = "" - self.lang = "de" - return "http://srv4.shragle.com/download.php" - - def get_file_name(self): - if self.html == None: - self.download_html() - - file_name_pattern = r"<\/div>

(.+)<\/h2" - return re.search(file_name_pattern, self.html).group(1) - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - - if re.search(r"html", self.html) == None: - return False - else: - return True - - def proceed(self, url, location): - self.req.download(url, location, {'fileID': self.fileID, 'dlSession': self.dlSession, 'userID': self.userID, 'password': self.password, 'lang': self.lang}) \ No newline at end of file diff --git a/Plugins/StealthTo.py b/Plugins/StealthTo.py deleted file mode 100644 index c904a07c3..000000000 --- a/Plugins/StealthTo.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from Plugin import Plugin - -class StealthTo(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "StealthTo" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?stealth.to/folder/" - props['version'] = "0.1" - props['description'] = """Stealth.to Container Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - url = self.parent.url - self.html = self.req.load(url, cookies=True) - temp_links = [] - ids = [] - ats = [] # authenticity_token - inputs = re.findall(r"(<(input|form)[^>]+)", self.html) - for input in inputs: - if re.search(r"name=\"authenticity_token\"",input[0]): - ats.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) - if re.search(r"name=\"id\"",input[0]): - ids.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) - - for i in range(0, len(ids)): - self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": ("download_" + str(ids[i]))}, cookies=True) - new_html = self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": "1"}, cookies=True) - temp_links.append(re.search(r"iframe src=\"(.*)\" frameborder", new_html).group(1)) - - self.links = temp_links diff --git a/Plugins/UploadedTo.py b/Plugins/UploadedTo.py deleted file mode 100644 index e65be789c..000000000 --- a/Plugins/UploadedTo.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import time -from Plugin import Plugin - -class UploadedTo(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "UploadedTo" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www\.)?u(?:p)?l(?:oaded)?\.to/" - props['version'] = "0.1" - props['description'] = """Uploaded.to Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - self.want_reconnect = None - self.multi_dl = False - - def prepare(self, thread): - pyfile = self.parent - - self.want_reconnect = False - tries = 0 - - while not pyfile.status.url: - - self.download_html() - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - - pyfile.status.filename = self.get_file_name() - - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.url = self.get_file_url() - pyfile.status.want_reconnect = self.want_reconnect - - thread.wait(self.parent) - - pyfile.status.filename = self.get_file_name() - - tries += 1 - if tries > 5: - raise Exception, "Error while preparing DL, HTML dump: %s" % self.html - - return True - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - - try: - wait_minutes = re.search(r"Or wait ([\d\-]+) minutes", self.html).group(1) - if int(wait_minutes) < 0: wait_minutes = 1 - self.time_plus_wait = time() + 60 * int(wait_minutes) - self.want_reconnect = True - except: - self.time_plus_wait = 0 - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - try: - file_url_pattern = r".*" - return re.search(file_url_pattern, self.html).group(1) - except: - return None - - def get_file_name(self): - try: - file_name = re.search(r"\s+(.+)\s", self.html).group(1) - file_suffix = re.search(r"(\..+)", self.html) - if not file_suffix: - return file_name - return file_name + file_suffix.group(1) - except: - self.parent.status.url = None - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if re.search(r"(File doesn't exist .*)", self.html) != None: - return False - else: - return True diff --git a/Plugins/XupIn.py b/Plugins/XupIn.py deleted file mode 100644 index 6b1f3be73..000000000 --- a/Plugins/XupIn.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from Plugin import Plugin - -class XupIn(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "XupIn" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www.)?xup.in/" - props['version'] = "0.1" - props['description'] = """Xup.in Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - self.posts = {} - self.want_reconnect = None - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - self.posts["vid"] = re.search('"hidden" value="(.*)" name="vid"', self.html).group(1) - self.posts["vtime"] = re.search('"hidden" value="(.*)" name="vtime"', self.html).group(1) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_url_pattern = r".*" - return re.search(file_url_pattern, self.html).group(1) - else: - return False - - def get_file_name(self): - if self.html == None: - self.download_html() - if not self.want_reconnect: - return self.parent.url.split('/')[-2] - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"(.*File does not exist.*)", self.html, re.I) != None: - return False - else: - return True - - def proceed(self, url, location): - self.req.download(url, location, self.posts) - - def wait_until(self): - if self.html == None: - self.download_html() - return self.time_plus_wait diff --git a/Plugins/YoupornCom.py b/Plugins/YoupornCom.py deleted file mode 100644 index fb0f4131d..000000000 --- a/Plugins/YoupornCom.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from Plugin import Plugin - -class YoupornCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "YoupornCom" - props['type'] = "hoster" - props['pattern'] = r"http://(www\.)?youporn\.com/watch/.+" - props['version'] = "0.1" - props['description'] = """Youporn.com Video Download Plugin""" - props['author_name'] = ("willnix") - props['author_mail'] = ("willnix@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - - def set_parent_status(self): - """ sets all available Statusinfos about a File in self.parent.status - """ - if self.html == None: - self.download_html() - self.parent.status.filename = self.get_file_name() - self.parent.status.url = self.get_file_url() - self.parent.status.wait = self.wait_until() - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - - file_url = re.search(r'(http://download.youporn.com/download/\d*/.*\?download=1&ll=1&t=dd)">', self.html).group(1) - print file_url - return file_url - - def get_file_name(self): - if self.html == None: - self.download_html() - file_name_pattern = r".*(.*) - Free Porn Videos - YouPorn.com Lite \(BETA\).*" - return re.search(file_name_pattern, self.html).group(1) + '.flv' - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"(.*invalid video_id.*)", self.html) != None: - return False - else: - return True \ No newline at end of file diff --git a/Plugins/YoutubeChannel.py b/Plugins/YoutubeChannel.py deleted file mode 100644 index 4958d1db5..000000000 --- a/Plugins/YoutubeChannel.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from Plugin import Plugin - -class YoutubeChannel(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "YoutubeChannel" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/user/*" - props['version'] = "0.3" - props['description'] = """Youtube.com Channel Download Plugin""" - props['author_name'] = ("RaNaN", "Spoob") - props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.read_config() - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - self.user = re.search(r"/user/(.+)", self.parent.url).group(1) - max_videos = self.config['max_videos'] - if not max_videos: - max_videos = 1000 #max video a user can upload - page = 0 - temp_links = [] - for start_index in range(1, int(max_videos), 50): - max_results = max_videos - page * 50 - if max_results > 50: - max_results = 50 - url = "http://gdata.youtube.com/feeds/api/users/" + self.user + "/uploads?max-results=" + str(max_results) + "&start-index=" + str(start_index) - rep = self.req.load(url) - new_links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep) - if new_links != []: - temp_links.extend(new_links) - else: - break - page += 1 - self.links = temp_links diff --git a/Plugins/YoutubeCom.py b/Plugins/YoutubeCom.py deleted file mode 100644 index 7428f532d..000000000 --- a/Plugins/YoutubeCom.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from Plugin import Plugin - -class YoutubeCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "YoutubeCom" - props['type'] = "hoster" - props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*" - props['version'] = "0.2" - props['description'] = """Youtube.com Video Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.read_config() - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - - videoId = self.parent.url.split("v=")[1].split("&")[0] - videoHash = re.search(r', "t": "([^"]+)"', self.html).group(1) - quality = "" - if self.config['high_quality']: - quality = "&fmt=18" - file_url = 'http://youtube.com/get_video?video_id=' + videoId + '&t=' + videoHash + quality - return file_url - - def get_file_name(self): - if self.html == None: - self.download_html() - - file_name_pattern = r"YouTube - (.*)" - file_suffix = ".flv" - if self.config['high_quality']: - file_suffix = ".mp4" - name = re.search(file_name_pattern, self.html).group(1).replace("/", "") + file_suffix - - name = name.replace("&", "&") - return name - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"(.*eine fehlerhafte Video-ID\.)", self.html) != None: - return False - else: - return True diff --git a/Plugins/ZippyshareCom.py b/Plugins/ZippyshareCom.py deleted file mode 100644 index 61408f925..000000000 --- a/Plugins/ZippyshareCom.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import urllib -from Plugin import Plugin - -class ZippyshareCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "ZippyshareCom" - props['type'] = "hoster" - props['pattern'] = r"(http://)?www?\d{0,2}\.zippyshare.com/v/" - props['version'] = "0.1" - props['description'] = """Zippyshare.com Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.want_reconnect = False - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url, cookies=True) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_url = urllib.unquote(re.search("var \w* = 'fck(.*)';", self.html).group(1)) - return file_url - else: - return False - - def get_file_name(self): - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_name = re.search("Name: (.*)
", self.html).group(1) - return file_name - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"HTTP Status 404", self.html) != None: - return False - else: - return True - - def proceed(self, url, location): - - self.req.download(url, location, cookies=True) diff --git a/Plugins/ZshareNet.py b/Plugins/ZshareNet.py deleted file mode 100644 index 33667605f..000000000 --- a/Plugins/ZshareNet.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from Plugin import Plugin - -class ZshareNet(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "ZshareNet" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www.)?zshare.net/" - props['version'] = "0.1" - props['description'] = """Zshare.net Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = [None, None] - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - self.posts = {} - self.want_reconnect = False - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html[0] = self.req.load(url) - if "/video/" in url: - url = url.replace("/video/", "/download/") - elif "/audio/" in url: - url = url.replace("/audio/", "/download/") - elif "/image/" in url: - url = url.replace("/image/", "/download/") - self.html[1] = self.req.load(url, None, {"download": "1"}) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_url = "".join(eval(re.search("var link_enc=new Array(.*);link", self.html[1]).group(1))) - return file_url - else: - return False - - def get_file_name(self): - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_name = re.search("(.*)", self.html[0]).group(1) - return file_name - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html[0] == None: - self.download_html() - if re.search(r"File Not Found", self.html[0]) != None: - return False - else: - return True - - def wait_until(self): - if self.html[0] == None: - self.download_html() - return self.time_plus_wait diff --git a/Plugins/__init__.py b/Plugins/__init__.py deleted file mode 100644 index 8d1c8b69c..000000000 --- a/Plugins/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/config b/config index 1982bf6ac..f408b2f22 100644 --- a/config +++ b/config @@ -3,7 +3,7 @@ port = 7272 password = pwhere [webinterface] -activated = True +activated = False port = 8080 username = User password = webpw @@ -24,7 +24,7 @@ reconnect_method = reconnect_method debug_mode = False [updates] -search_updates = asdf +search_updates = True install_updates = False [reconnectTime] diff --git a/module/network/Request.py b/module/network/Request.py index b2bac2d7b..084c84f95 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -244,7 +244,6 @@ class Request: if "..." in file_name: download_folder = dirname(file_name) + sep headers = self.get_header() - print headers file_name_search = re.search('filename=(?P\")?(.+)(?(quote)\")', headers) if file_name_search: file_name = file_name_search.group(2) diff --git a/module/plugins/BluehostTo.py b/module/plugins/BluehostTo.py new file mode 100644 index 000000000..1ecd47122 --- /dev/null +++ b/module/plugins/BluehostTo.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import time + +from Plugin import Plugin + +class BluehostTo(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "BluehostTo" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www.)?bluehost.to/file/" + props['version'] = "0.1" + props['description'] = """Bluehost Download PLugin""" + props['author_name'] = ("RaNaN") + props['author_mail'] = ("RaNaN@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + time.sleep(1.5) + self.html = self.req.load(url, cookies=True) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + + inputs = re.findall(r"(<(input|form)[^>]+)", self.html) + for i in inputs: + if re.search(r"name=\"BluehostVers2dl\"",i[0]): + self.BluehostVers2dl = re.search(r"value=\"([^\"]+)", i[0]).group(1) + elif re.search(r"name=\"PHPSESSID\"",i[0]): + self.PHPSESSID = re.search(r"value=\"([^\"]+)", i[0]).group(1) + elif re.search(r"name=\"DownloadV2Hash\"",i[0]): + self.DownloadV2Hash = re.search(r"value=\"([^\"]+)", i[0]).group(1) + elif re.search(r"name=\"access\"",i[0]): + self.access = re.search(r"value=\"([^\"]+)", i[0]).group(1) + elif re.search(r"name=\"download\"",i[0]): + url = re.search(r"action=\"([^\"]+)", i[0]).group(1) + + return url + + def get_file_name(self): + if self.html == None: + self.download_html() + file_name_pattern = r"
.+: (.+)<\/b><\/center>" + return re.search(file_name_pattern, self.html).group(1) + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + + if re.search(r"html", self.html) == None: + return False + else: + return True + + def proceed(self, url, location): + self.req.download(url, location, {'BluehostVers2dl': self.BluehostVers2dl, 'DownloadV2Hash': self.DownloadV2Hash, 'PHPSESSID': self.PHPSESSID, 'access': self.access}) diff --git a/module/plugins/CCF.py b/module/plugins/CCF.py new file mode 100644 index 000000000..d7792dce4 --- /dev/null +++ b/module/plugins/CCF.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os.path +import random +import re +import tempfile +import urllib2 + +from Plugin import Plugin +from module.network.MultipartPostHandler import MultipartPostHandler + +class CCF(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "CCF" + props['type'] = "container" + props['pattern'] = r".*\.ccf" + props['version'] = "0.1" + props['description'] = """CCF Container Convert Plugin""" + props['author_name'] = ("Willnix") + props['author_mail'] = ("Willnix@pyload.org") + self.props = props + self.parent = parent + self.multi_dl = True + self.links = [] + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + infile = url.replace("\n", "") + + opener = urllib2.build_opener(MultipartPostHandler) + params = {"src": "ccf", + "filename": "test.ccf", + "upload": open(infile, "rb")} + tempdlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', params).read() + + random.seed() + tempdir = tempfile.gettempdir() + if tempdir[0] == '/': + delim = '/' + else: + delim = '\\' + tempdlc_name = tempdir + delim + str(random.randint(0, 100)) + '-tmp.dlc' + while os.path.exists(tempdlc_name): + tempdlc_name = tempfile.gettempdir() + '/' + str(random.randint(0, 100)) + '-tmp.dlc' + + tempdlc = open(tempdlc_name, "w") + tempdlc.write(re.search(r'(.*)', tempdlc_content, re.DOTALL).group(1)) + tempdlc.close + + self.links.append(tempdlc_name) + + return True \ No newline at end of file diff --git a/module/plugins/DLC.pyc b/module/plugins/DLC.pyc new file mode 100644 index 000000000..5d4809178 Binary files /dev/null and b/module/plugins/DLC.pyc differ diff --git a/module/plugins/DepositfilesCom.py b/module/plugins/DepositfilesCom.py new file mode 100644 index 000000000..b2f6db29c --- /dev/null +++ b/module/plugins/DepositfilesCom.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib +from Plugin import Plugin + +class DepositfilesCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "DepositfilesCom" + props['type'] = "hoster" + props['pattern'] = r"http://depositfiles.com/.{2,}/files/" + props['version'] = "0.1" + props['description'] = """Depositfiles.com Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_url = urllib.unquote(re.search('', self.html).group(1) + return file_name + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: + return False + else: + return True + + def proceed(self, url, location): + + self.req.download(url, location, cookies=True) diff --git a/module/plugins/FourChan.py b/module/plugins/FourChan.py new file mode 100644 index 000000000..840274457 --- /dev/null +++ b/module/plugins/FourChan.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from Plugin import Plugin + +class FourChan(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FourChan" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?(img\.)?(zip\.)?4chan.org/\w+/(res/|imgboard\.html)" + props['version'] = "0.1" + props['description'] = """4chan.org Thread Download Plugin""" + props['author_name'] = ("Spoob") + props['author_mail'] = ("Spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + url = self.parent.url + html = self.req.load(url) + link_pattern = "" + temp_links = [] + if "imagebord.html" in url: + link_pattern = '[Reply]' + temp_links = re.findall(link_pattern, html) + for link in re.findall(link_pattern, html): + temp_links.append(link) + else: + temp_links = re.findall('File : " + container + ":(.*?)
", self.html).group(1) + tmp = re.findall('
Part \d+', download_content) + if tmp == []: continue + for link in tmp: + link_html = self.req.load(link, cookies=True) + temp_links.append(re.search('', self.html[0]).group(1) + self.html[1] = self.req.load(url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar}, cookies=True) + if re.search(r"Waiting time before each download begins", self.html[1]) != None: + break + + os.remove(captcha_image) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html[0] == None: + self.download_html() + if not self.want_reconnect: + file_url_pattern = 'id="downloadlink">", self.html).group(1) + file_url = videoServer + videoId + ".flv" + print videoId + print videoServer + print file_url + return file_url + + def get_file_name(self): + if self.html == None: + self.download_html() + file_name_pattern = r"

(.*)

" + return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.flv' + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"(.* Das angeforderte Video ist nicht.*)", self.html) != None: + return False + else: + return True diff --git a/module/plugins/NetloadIn.py b/module/plugins/NetloadIn.py new file mode 100644 index 000000000..789c84a2d --- /dev/null +++ b/module/plugins/NetloadIn.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import re +import tempfile +from time import time +from time import sleep + +from Plugin import Plugin + +class NetloadIn(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "NetloadIn" + props['type'] = "hoster" + props['pattern'] = r"http://.*netload\.in/" + props['version'] = "0.1" + props['description'] = """Netload.in Download Plugin""" + props['author_name'] = ("spoob", "RaNaN") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = [None, None, None] + self.want_reconnect = False + self.init_ocr() + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + + tries = 0 + + while not pyfile.status.url: + + self.req.clear_cookies() + self.download_html() + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + + pyfile.status.filename = self.get_file_name() + + self.download_html2() + + self.get_wait_time() + + 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() + + tries += 1 + if tries > 3: + raise Exception, "Error while preparing DL, HTML dump: %s %s" % (self.html[0], self.html[1]) + + return True + + + def download_html(self): + url = self.parent.url + self.html[0] = self.req.load(url, cookies=True) + + def download_html2(self): + + url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") + + for i in range(6): + self.html[1] = self.req.load(url_captcha_html, cookies=True) + + try: + captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) + except: + url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[1]).group(1).replace("amp;", "") + self.html[1] = self.req.load(url_captcha_html, cookies=True) + captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) + + file_id = re.search('', self.html[1]).group(1) + + captcha_image = tempfile.NamedTemporaryFile(suffix=".png").name + + self.req.download(captcha_url, captcha_image, cookies=True) + captcha = self.ocr.get_captcha(captcha_image) + self.logger.debug("Captcha %s: %s" % (i, captcha)) + sleep(5) + self.html[2] = self.req.load("http://netload.in/index.php?id=10", post={"file_id": file_id, "captcha_check": captcha}, cookies=True) + + os.remove(captcha_image) + + if re.search(r"(We will prepare your download..|We had a reqeust with the IP)", self.html[2]) != None: + return True + + raise Exception, "Captcha reading failed" + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + try: + file_url_pattern = r"
Click here" + search = re.search(file_url_pattern, self.html[2]) + return search.group(1) + except: + return None + + def get_wait_time(self): + wait = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) + self.time_plus_wait = time() + wait / 100 + + if re.search(r"We had a reqeust with the IP", self.html[2]): + self.want_reconnect = True + + def get_file_name(self): + try: + file_name_pattern = '\t\t\t(.+)' + return re.search(file_name_pattern, self.html[0]).group(1) + except: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if re.search(r"The file has been deleted", self.html[0]) != None: + return False + else: + return True + + def proceed(self, url, location): + + self.req.download(url, location, cookies=True) diff --git a/module/plugins/OneKhDe.py b/module/plugins/OneKhDe.py new file mode 100644 index 000000000..15c3a6872 --- /dev/null +++ b/module/plugins/OneKhDe.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.unescape import unescape +from Plugin import Plugin + +class OneKhDe(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "OneKhDe" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?1kh.de/f/" + props['version'] = "0.1" + props['description'] = """1kh.de Container Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + url = self.parent.url + self.html = self.req.load(url) + temp_links = [] + link_ids = re.findall(r"", self.req.load("http://1kh.de/l/" + id)).group(1)) + temp_links.append(new_link) + self.links = temp_links diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py new file mode 100644 index 000000000..5b3c7ee8c --- /dev/null +++ b/module/plugins/Plugin.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +#Copyright (C) 2009 kingzero, RaNaN +# +#This program is free software; you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation; either version 3 of the License, +#or (at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#See the GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +### +import ConfigParser +import logging +import re + +from module.network.Request import Request + +class Plugin(): + + def __init__(self, parent): + self.parser = ConfigParser.SafeConfigParser() + self.config = {} + props = {} + props['name'] = "BasePlugin" + props['version'] = "0.1" + props['pattern'] = None + props['type'] = "hoster" + props['description'] = """Base Plugin""" + props['author_name'] = ("RaNaN", "spoob") + props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") + self.props = props + self.parent = parent + self.req = Request() + self.html = 0 + self.time_plus_wait = 0 #time() + wait in seconds + self.want_reconnect = False + self.multi_dl = True + self.ocr = None #captcha reader instance + self.logger = logging.getLogger("log") + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + return False + + pyfile.status.filename = self.get_file_name() + + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.url = self.get_file_url() + pyfile.status.want_reconnect = self.want_reconnect + + thread.wait(self.parent) + + return True + + def set_parent_status(self): + """ sets all available Statusinfos about a File in self.parent.status + """ + pass + + def download_html(self): + """ gets the url from self.parent.url saves html in self.html and parses + """ + html = "" + self.html = html + + 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 get_file_name(self): + 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 set_config(self): + pass + + def get_config(self, value): + 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, raw=True) + self.config[option] = False if self.config[option].lower() == 'false' else self.config[option] + + def init_ocr(self): + modul = __import__("module.captcha." + self.props['name'], fromlist=['captcha']) + captchaClass = getattr(modul, self.props['name']) + self.ocr = captchaClass() + + def __call__(self): + return self.props['name'] diff --git a/module/plugins/RSDF.py b/module/plugins/RSDF.py new file mode 100644 index 000000000..c2406d6e0 --- /dev/null +++ b/module/plugins/RSDF.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import base64 +import binascii + +from Plugin import Plugin + +class RSDF(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "RSDF" + props['type'] = "container" + props['pattern'] = r".*\.rsdf" + props['version'] = "0.2" + props['description'] = """RSDF Container Decode Plugin""" + props['author_name'] = ("RaNaN", "spoob") + props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") + self.props = props + self.parent = parent + self.multi_dl = True + self.links = [] + + def file_exists(self): + """ returns True or False + """ + return True + + 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() + + except: + print "Kein Crypto installiert, RSDF Plugin kann nicht genutzt werden" diff --git a/module/plugins/RSLayerCom.py b/module/plugins/RSLayerCom.py new file mode 100644 index 000000000..e470c1748 --- /dev/null +++ b/module/plugins/RSLayerCom.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.unescape import unescape +from Plugin import Plugin + +class RSLayerCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "RSLayerCom" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?rs-layer.com/directory-" + props['version'] = "0.1" + props['description'] = """RS-Layer.com Container Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + url = self.parent.url + self.html = self.req.load(url) + temp_links = [] + link_ids = re.findall(r"onclick=\"getFile\(\'([0-9]{7}-.{8})\'\);changeBackgroundColor", self.html) + for id in link_ids: + new_link = unescape(re.search(r"name=\"file\" src=\"(.*)\">", self.req.load("http://rs-layer.com/link-" + id + ".html")).group(1)) + print new_link + temp_links.append(new_link) + self.links = temp_links diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py new file mode 100644 index 000000000..56a38fb9d --- /dev/null +++ b/module/plugins/RapidshareCom.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import time + +from Plugin import Plugin + +class RapidshareCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "RapidshareCom" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www.)?(rs\d*.)?rapidshare.com/files/" + props['version'] = "0.4" + props['description'] = """Rapidshare.com Download Plugin""" + props['author_name'] = ("spoob", "RaNaN") + props['author_mail'] = ("spoob@pyload.org", "ranan@pyload.org") + self.props = props + self.parent = parent + self.html = [None, None] + self.html_old = None #time() where loaded the HTML + self.time_plus_wait = None #time() + wait in seconds + self.want_reconnect = False + + self.read_config() + if self.config['premium']: + self.multi_dl = True + else: + self.multi_dl = False + + self.start_dl = False + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + + tries = 0 + + while not self.start_dl or not pyfile.status.url: + + self.req.clear_cookies() + + self.download_html() + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + + pyfile.status.filename = self.get_file_name() + + if self.config['premium']: + pyfile.status.url = self.parent.url + return True + + 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() + + tries += 1 + if tries > 5: + raise Exception, "Error while preparing, HTML dump:"+ str(self.html[0]) + str(self.html[1]) + + return True + + def download_html(self): + """ gets the url from self.parent.url saves html in self.html and parses + """ + url = self.parent.url + self.html[0] = self.req.load(url) + self.html_old = time() + + self.download_serverhtml() + + def download_serverhtml(self): + """downloads html with the important informations + """ + file_server_url = re.search(r"This limit is reached.

)", 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 + else: + return True + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.config['premium']: + self.start_dl = True + return self.parent.url + + #if (self.html_old + 5 * 60) < time(): # nach einiger zeit ist die file_url nicht mehr aktuell + # self.download_serverhtml() + + + try: + if self.config['server'] == "": + file_url_pattern = r".*name=\"dlf\" action=\"(.*)\" method=.*" + else: + file_url_pattern = '(http://rs.*)\';" /> %s
' % self.config['server'] + + self.start_dl = True + return re.search(file_url_pattern, self.html[1]).group(1) + except Exception, e: + self.start_dl = False + return False + #print self.html[1] #test print + #raise Exception, "Error when retrieving download url" + + def get_file_name(self): + + file_name_pattern = r"

.+/(.+) ", self.req.load("http://relink.us/f/%s/1/%i" % (container_id, number))).group(1) + temp_links.append(new_link) + print temp_links + self.links = temp_links diff --git a/module/plugins/ShareonlineBiz.py b/module/plugins/ShareonlineBiz.py new file mode 100644 index 000000000..d42ef9302 --- /dev/null +++ b/module/plugins/ShareonlineBiz.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import re +import tempfile +from time import time +from base64 import b64decode + +from Plugin import Plugin + +class ShareonlineBiz(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "ShareonlineBiz" + props['type'] = "hoster" + props['pattern'] = r"(?:http://)?(?:www.)?share-online.biz/download.php\?id=" + props['version'] = "0.1" + props['description'] = """Shareonline.biz Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = [None, None] + self.want_reconnect = False + self.init_ocr() + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html[0] = self.req.load(url, cookies=True) + + captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name + + for i in range(5): + self.req.download("http://www.share-online.biz/captcha.php", captcha_image, cookies=True) + captcha = self.ocr.get_captcha(captcha_image) + self.html[1] = self.req.load(url, post={"captchacode": captcha}, cookies=True) + if re.search(r"Der Download ist Ihnen zu langsam?", self.html[1]) != None: + self.time_plus_wait = time() + 15 + break + + os.remove(captcha_image) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html[0] == None: + self.download_html() + if not self.want_reconnect: + file_url_pattern = 'loadfilelink\.decode\("(.*==)"\);' + return b64decode(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() + if not self.want_reconnect: + file_name_pattern = 'class="locatedActive">Download (.*)' + return re.search(file_name_pattern, self.html[1]).group(1) + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html[0] == None: + self.download_html() + if re.search(r"nicht zum Download bereitgestellt werden", self.html[0]) != None: + return False + else: + return True diff --git a/module/plugins/ShragleCom.py b/module/plugins/ShragleCom.py new file mode 100644 index 000000000..bcf650d69 --- /dev/null +++ b/module/plugins/ShragleCom.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import time + +from Plugin import Plugin + +class ShragleCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "ShragleCom" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www.)?shragle.com/files/" + props['version'] = "0.1" + props['description'] = """Shragle Download PLugin""" + props['author_name'] = ("RaNaN") + props['author_mail'] = ("RaNaN@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.multi_dl = False + + def set_parent_status(self): + """ sets all available Statusinfos about a File in self.parent.status + """ + if self.html == None: + self.download_html() + self.parent.status.filename = self.get_file_name() + self.parent.status.url = self.get_file_url() + self.parent.status.wait = self.wait_until() + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + self.time_plus_wait = time.time() + 10 + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + + self.fileID = re.search(r"name=\"fileID\" value=\"([^\"]+)", self.html).group(1) + self.dlSession = re.search(r"name=\"dlSession\" value=\"([^\"]+)", self.html).group(1) + self.userID = "" + self.password = "" + self.lang = "de" + return "http://srv4.shragle.com/download.php" + + def get_file_name(self): + if self.html == None: + self.download_html() + + file_name_pattern = r"<\/div>

(.+)<\/h2" + return re.search(file_name_pattern, self.html).group(1) + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + + if re.search(r"html", self.html) == None: + return False + else: + return True + + def proceed(self, url, location): + self.req.download(url, location, {'fileID': self.fileID, 'dlSession': self.dlSession, 'userID': self.userID, 'password': self.password, 'lang': self.lang}) \ No newline at end of file diff --git a/module/plugins/StealthTo.py b/module/plugins/StealthTo.py new file mode 100644 index 000000000..c904a07c3 --- /dev/null +++ b/module/plugins/StealthTo.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from Plugin import Plugin + +class StealthTo(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "StealthTo" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?stealth.to/folder/" + props['version'] = "0.1" + props['description'] = """Stealth.to Container Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + temp_links = [] + ids = [] + ats = [] # authenticity_token + inputs = re.findall(r"(<(input|form)[^>]+)", self.html) + for input in inputs: + if re.search(r"name=\"authenticity_token\"",input[0]): + ats.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) + if re.search(r"name=\"id\"",input[0]): + ids.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) + + for i in range(0, len(ids)): + self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": ("download_" + str(ids[i]))}, cookies=True) + new_html = self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": "1"}, cookies=True) + temp_links.append(re.search(r"iframe src=\"(.*)\" frameborder", new_html).group(1)) + + self.links = temp_links diff --git a/module/plugins/UploadedTo.py b/module/plugins/UploadedTo.py new file mode 100644 index 000000000..e65be789c --- /dev/null +++ b/module/plugins/UploadedTo.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import time +from Plugin import Plugin + +class UploadedTo(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "UploadedTo" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www\.)?u(?:p)?l(?:oaded)?\.to/" + props['version'] = "0.1" + props['description'] = """Uploaded.to Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.html_old = None #time() where loaded the HTML + self.time_plus_wait = None #time() + wait in seconds + self.want_reconnect = None + self.multi_dl = False + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + tries = 0 + + while not pyfile.status.url: + + self.download_html() + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + + pyfile.status.filename = self.get_file_name() + + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.url = self.get_file_url() + pyfile.status.want_reconnect = self.want_reconnect + + thread.wait(self.parent) + + pyfile.status.filename = self.get_file_name() + + tries += 1 + if tries > 5: + raise Exception, "Error while preparing DL, HTML dump: %s" % self.html + + return True + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + + try: + wait_minutes = re.search(r"Or wait ([\d\-]+) minutes", self.html).group(1) + if int(wait_minutes) < 0: wait_minutes = 1 + self.time_plus_wait = time() + 60 * int(wait_minutes) + self.want_reconnect = True + except: + self.time_plus_wait = 0 + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + try: + file_url_pattern = r".*" + return re.search(file_url_pattern, self.html).group(1) + except: + return None + + def get_file_name(self): + try: + file_name = re.search(r"\s+(.+)\s", self.html).group(1) + file_suffix = re.search(r"(\..+)", self.html) + if not file_suffix: + return file_name + return file_name + file_suffix.group(1) + except: + self.parent.status.url = None + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if re.search(r"(File doesn't exist .*)", self.html) != None: + return False + else: + return True diff --git a/module/plugins/XupIn.py b/module/plugins/XupIn.py new file mode 100644 index 000000000..6b1f3be73 --- /dev/null +++ b/module/plugins/XupIn.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from Plugin import Plugin + +class XupIn(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "XupIn" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www.)?xup.in/" + props['version'] = "0.1" + props['description'] = """Xup.in Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.html_old = None #time() where loaded the HTML + self.time_plus_wait = None #time() + wait in seconds + self.posts = {} + self.want_reconnect = None + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + self.posts["vid"] = re.search('"hidden" value="(.*)" name="vid"', self.html).group(1) + self.posts["vtime"] = re.search('"hidden" value="(.*)" name="vtime"', self.html).group(1) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_url_pattern = r".*" + return re.search(file_url_pattern, self.html).group(1) + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + return self.parent.url.split('/')[-2] + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"(.*File does not exist.*)", self.html, re.I) != None: + return False + else: + return True + + def proceed(self, url, location): + self.req.download(url, location, self.posts) + + def wait_until(self): + if self.html == None: + self.download_html() + return self.time_plus_wait diff --git a/module/plugins/YoupornCom.py b/module/plugins/YoupornCom.py new file mode 100644 index 000000000..fb0f4131d --- /dev/null +++ b/module/plugins/YoupornCom.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from Plugin import Plugin + +class YoupornCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "YoupornCom" + props['type'] = "hoster" + props['pattern'] = r"http://(www\.)?youporn\.com/watch/.+" + props['version'] = "0.1" + props['description'] = """Youporn.com Video Download Plugin""" + props['author_name'] = ("willnix") + props['author_mail'] = ("willnix@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.html_old = None #time() where loaded the HTML + self.time_plus_wait = None #time() + wait in seconds + + def set_parent_status(self): + """ sets all available Statusinfos about a File in self.parent.status + """ + if self.html == None: + self.download_html() + self.parent.status.filename = self.get_file_name() + self.parent.status.url = self.get_file_url() + self.parent.status.wait = self.wait_until() + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + + file_url = re.search(r'(http://download.youporn.com/download/\d*/.*\?download=1&ll=1&t=dd)">', self.html).group(1) + print file_url + return file_url + + def get_file_name(self): + if self.html == None: + self.download_html() + file_name_pattern = r".*(.*) - Free Porn Videos - YouPorn.com Lite \(BETA\).*" + return re.search(file_name_pattern, self.html).group(1) + '.flv' + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"(.*invalid video_id.*)", self.html) != None: + return False + else: + return True \ No newline at end of file diff --git a/module/plugins/YoutubeChannel.py b/module/plugins/YoutubeChannel.py new file mode 100644 index 000000000..4958d1db5 --- /dev/null +++ b/module/plugins/YoutubeChannel.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from Plugin import Plugin + +class YoutubeChannel(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "YoutubeChannel" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/user/*" + props['version'] = "0.3" + props['description'] = """Youtube.com Channel Download Plugin""" + props['author_name'] = ("RaNaN", "Spoob") + props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.read_config() + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + self.user = re.search(r"/user/(.+)", self.parent.url).group(1) + max_videos = self.config['max_videos'] + if not max_videos: + max_videos = 1000 #max video a user can upload + page = 0 + temp_links = [] + for start_index in range(1, int(max_videos), 50): + max_results = max_videos - page * 50 + if max_results > 50: + max_results = 50 + url = "http://gdata.youtube.com/feeds/api/users/" + self.user + "/uploads?max-results=" + str(max_results) + "&start-index=" + str(start_index) + rep = self.req.load(url) + new_links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep) + if new_links != []: + temp_links.extend(new_links) + else: + break + page += 1 + self.links = temp_links diff --git a/module/plugins/YoutubeCom.py b/module/plugins/YoutubeCom.py new file mode 100644 index 000000000..7428f532d --- /dev/null +++ b/module/plugins/YoutubeCom.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from Plugin import Plugin + +class YoutubeCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "YoutubeCom" + props['type'] = "hoster" + props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*" + props['version'] = "0.2" + props['description'] = """Youtube.com Video Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.read_config() + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + + videoId = self.parent.url.split("v=")[1].split("&")[0] + videoHash = re.search(r', "t": "([^"]+)"', self.html).group(1) + quality = "" + if self.config['high_quality']: + quality = "&fmt=18" + file_url = 'http://youtube.com/get_video?video_id=' + videoId + '&t=' + videoHash + quality + return file_url + + def get_file_name(self): + if self.html == None: + self.download_html() + + file_name_pattern = r"YouTube - (.*)" + file_suffix = ".flv" + if self.config['high_quality']: + file_suffix = ".mp4" + name = re.search(file_name_pattern, self.html).group(1).replace("/", "") + file_suffix + + name = name.replace("&", "&") + return name + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"(.*eine fehlerhafte Video-ID\.)", self.html) != None: + return False + else: + return True diff --git a/module/plugins/ZippyshareCom.py b/module/plugins/ZippyshareCom.py new file mode 100644 index 000000000..61408f925 --- /dev/null +++ b/module/plugins/ZippyshareCom.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib +from Plugin import Plugin + +class ZippyshareCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "ZippyshareCom" + props['type'] = "hoster" + props['pattern'] = r"(http://)?www?\d{0,2}\.zippyshare.com/v/" + props['version'] = "0.1" + props['description'] = """Zippyshare.com Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_url = urllib.unquote(re.search("var \w* = 'fck(.*)';", self.html).group(1)) + return file_url + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search("Name: (.*)
", self.html).group(1) + return file_name + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"HTTP Status 404", self.html) != None: + return False + else: + return True + + def proceed(self, url, location): + + self.req.download(url, location, cookies=True) diff --git a/module/plugins/ZshareNet.py b/module/plugins/ZshareNet.py new file mode 100644 index 000000000..33667605f --- /dev/null +++ b/module/plugins/ZshareNet.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from Plugin import Plugin + +class ZshareNet(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "ZshareNet" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www.)?zshare.net/" + props['version'] = "0.1" + props['description'] = """Zshare.net Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = [None, None] + self.html_old = None #time() where loaded the HTML + self.time_plus_wait = None #time() + wait in seconds + self.posts = {} + self.want_reconnect = False + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html[0] = self.req.load(url) + if "/video/" in url: + url = url.replace("/video/", "/download/") + elif "/audio/" in url: + url = url.replace("/audio/", "/download/") + elif "/image/" in url: + url = url.replace("/image/", "/download/") + self.html[1] = self.req.load(url, None, {"download": "1"}) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html[0] == None: + self.download_html() + if not self.want_reconnect: + file_url = "".join(eval(re.search("var link_enc=new Array(.*);link", self.html[1]).group(1))) + return file_url + else: + return False + + def get_file_name(self): + if self.html[0] == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search("(.*)", self.html[0]).group(1) + return file_name + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html[0] == None: + self.download_html() + if re.search(r"File Not Found", self.html[0]) != None: + return False + else: + return True + + def wait_until(self): + if self.html[0] == None: + self.download_html() + return self.time_plus_wait diff --git a/module/plugins/__init__.py b/module/plugins/__init__.py new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/module/plugins/__init__.py @@ -0,0 +1 @@ + diff --git a/pyLoadCore.py b/pyLoadCore.py index 801eee9c6..c0d0bccce 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -47,7 +47,7 @@ class Core(object): """ def __init__(self): self.config = {} - self.config['plugin_folder'] = "plugins" + self.plugin_folder = "module" + sep + "plugins" self.plugins_avaible = {} self.read_config() @@ -73,7 +73,7 @@ class Core(object): self.logger.info(_("Downloadtime: %s") % self.is_dltime()) # debug only - path.append(self.config['plugin_folder']) + path.append(self.plugin_folder) self.create_plugin_index() self.init_server() @@ -106,9 +106,8 @@ class Core(object): return self.config def create_plugin_index(self): - plugin_folder = self.config['plugin_folder'] - for file_handler in glob(plugin_folder + sep + '*.py') + glob(plugin_folder + sep + 'DLC.pyc'): - if file_handler != plugin_folder + sep + "Plugin.py": + for file_handler in glob(self.plugin_folder + sep + '*.py') + glob(self.plugin_folder + sep + 'DLC.pyc'): + if file_handler != self.plugin_folder + sep + "Plugin.py": plugin_pattern = "" plugin_file = basename(file_handler).replace('.pyc', '').replace('.py', '') for line in open(file_handler, "r").readlines(): -- cgit v1.2.3