From 8e87787753b2e049917a5491727d285b1c5a7095 Mon Sep 17 00:00:00 2001 From: mkaay Date: Sun, 27 Dec 2009 00:20:21 +0100 Subject: closes #13 --- module/file_list.py | 8 +- module/plugins/BluehostTo.py | 71 ----------- module/plugins/CCF.py | 55 --------- module/plugins/DDLMusicOrg.py | 58 --------- module/plugins/DLC.pyc | Bin 5740 -> 0 bytes module/plugins/DepositfilesCom.py | 62 ---------- module/plugins/FilefactoryCom.py | 103 ---------------- module/plugins/FilesmonsterCom.py | 94 -------------- module/plugins/FourChanOrg.py | 41 ------- module/plugins/FreakshareNet.py | 144 ---------------------- module/plugins/GigasizeCom.py | 84 ------------- module/plugins/HoerbuchIn.py | 48 -------- module/plugins/HotfileCom.py | 110 ----------------- module/plugins/LinkList.py | 39 ------ module/plugins/LixIn.py | 36 ------ module/plugins/MegauploadCom.py | 83 ------------- module/plugins/MyvideoDe.py | 65 ---------- module/plugins/NetloadIn.py | 157 ------------------------ module/plugins/OneKhDe.py | 38 ------ module/plugins/RSDF.py | 50 -------- module/plugins/RSLayerCom.py | 39 ------ module/plugins/RapidshareCom.py | 191 ----------------------------- module/plugins/RelinkUs.py | 60 --------- module/plugins/ShareonlineBiz.py | 116 ------------------ module/plugins/ShragleCom.py | 72 ----------- module/plugins/StealthTo.py | 47 ------- module/plugins/StorageTo.py | 104 ---------------- module/plugins/UploadedTo.py | 150 ---------------------- module/plugins/XupIn.py | 69 ----------- module/plugins/YoupornCom.py | 62 ---------- module/plugins/YoutubeChannel.py | 49 -------- module/plugins/YoutubeCom.py | 63 ---------- module/plugins/ZippyshareCom.py | 59 --------- module/plugins/ZshareNet.py | 72 ----------- module/plugins/__init__.py | 1 - module/plugins/container/CCF.py | 55 +++++++++ module/plugins/container/DLC.pyc | Bin 0 -> 5740 bytes module/plugins/container/LinkList.py | 39 ++++++ module/plugins/container/RSDF.py | 50 ++++++++ module/plugins/container/__init__.py | 0 module/plugins/decrypter/DDLMusicOrg.py | 58 +++++++++ module/plugins/decrypter/FourChanOrg.py | 41 +++++++ module/plugins/decrypter/HoerbuchIn.py | 48 ++++++++ module/plugins/decrypter/LixIn.py | 36 ++++++ module/plugins/decrypter/OneKhDe.py | 38 ++++++ module/plugins/decrypter/RSLayerCom.py | 39 ++++++ module/plugins/decrypter/RelinkUs.py | 60 +++++++++ module/plugins/decrypter/StealthTo.py | 47 +++++++ module/plugins/decrypter/YoutubeChannel.py | 49 ++++++++ module/plugins/decrypter/__init__.py | 0 module/plugins/hoster/BluehostTo.py | 71 +++++++++++ module/plugins/hoster/DepositfilesCom.py | 62 ++++++++++ module/plugins/hoster/FilefactoryCom.py | 103 ++++++++++++++++ module/plugins/hoster/FilesmonsterCom.py | 94 ++++++++++++++ module/plugins/hoster/FreakshareNet.py | 144 ++++++++++++++++++++++ module/plugins/hoster/GigasizeCom.py | 84 +++++++++++++ module/plugins/hoster/HotfileCom.py | 110 +++++++++++++++++ module/plugins/hoster/MegauploadCom.py | 83 +++++++++++++ module/plugins/hoster/MyvideoDe.py | 65 ++++++++++ module/plugins/hoster/NetloadIn.py | 157 ++++++++++++++++++++++++ module/plugins/hoster/RapidshareCom.py | 191 +++++++++++++++++++++++++++++ module/plugins/hoster/ShareonlineBiz.py | 116 ++++++++++++++++++ module/plugins/hoster/ShragleCom.py | 72 +++++++++++ module/plugins/hoster/StorageTo.py | 104 ++++++++++++++++ module/plugins/hoster/UploadedTo.py | 150 ++++++++++++++++++++++ module/plugins/hoster/XupIn.py | 69 +++++++++++ module/plugins/hoster/YoupornCom.py | 62 ++++++++++ module/plugins/hoster/YoutubeCom.py | 63 ++++++++++ module/plugins/hoster/ZippyshareCom.py | 59 +++++++++ module/plugins/hoster/ZshareNet.py | 72 +++++++++++ module/plugins/hoster/__init__.py | 0 module/thread_list.py | 2 +- 72 files changed, 2498 insertions(+), 2495 deletions(-) delete mode 100644 module/plugins/BluehostTo.py delete mode 100644 module/plugins/CCF.py delete mode 100644 module/plugins/DDLMusicOrg.py delete mode 100644 module/plugins/DLC.pyc delete mode 100644 module/plugins/DepositfilesCom.py delete mode 100644 module/plugins/FilefactoryCom.py delete mode 100644 module/plugins/FilesmonsterCom.py delete mode 100644 module/plugins/FourChanOrg.py delete mode 100644 module/plugins/FreakshareNet.py delete mode 100644 module/plugins/GigasizeCom.py delete mode 100644 module/plugins/HoerbuchIn.py delete mode 100644 module/plugins/HotfileCom.py delete mode 100644 module/plugins/LinkList.py delete mode 100644 module/plugins/LixIn.py delete mode 100644 module/plugins/MegauploadCom.py delete mode 100644 module/plugins/MyvideoDe.py delete mode 100644 module/plugins/NetloadIn.py delete mode 100644 module/plugins/OneKhDe.py delete mode 100644 module/plugins/RSDF.py delete mode 100644 module/plugins/RSLayerCom.py delete mode 100644 module/plugins/RapidshareCom.py delete mode 100644 module/plugins/RelinkUs.py delete mode 100644 module/plugins/ShareonlineBiz.py delete mode 100644 module/plugins/ShragleCom.py delete mode 100644 module/plugins/StealthTo.py delete mode 100644 module/plugins/StorageTo.py delete mode 100644 module/plugins/UploadedTo.py delete mode 100644 module/plugins/XupIn.py delete mode 100644 module/plugins/YoupornCom.py delete mode 100644 module/plugins/YoutubeChannel.py delete mode 100644 module/plugins/YoutubeCom.py delete mode 100644 module/plugins/ZippyshareCom.py delete mode 100644 module/plugins/ZshareNet.py create mode 100644 module/plugins/container/CCF.py create mode 100644 module/plugins/container/DLC.pyc create mode 100644 module/plugins/container/LinkList.py create mode 100644 module/plugins/container/RSDF.py create mode 100644 module/plugins/container/__init__.py create mode 100644 module/plugins/decrypter/DDLMusicOrg.py create mode 100644 module/plugins/decrypter/FourChanOrg.py create mode 100644 module/plugins/decrypter/HoerbuchIn.py create mode 100644 module/plugins/decrypter/LixIn.py create mode 100644 module/plugins/decrypter/OneKhDe.py create mode 100644 module/plugins/decrypter/RSLayerCom.py create mode 100644 module/plugins/decrypter/RelinkUs.py create mode 100644 module/plugins/decrypter/StealthTo.py create mode 100644 module/plugins/decrypter/YoutubeChannel.py create mode 100644 module/plugins/decrypter/__init__.py create mode 100644 module/plugins/hoster/BluehostTo.py create mode 100644 module/plugins/hoster/DepositfilesCom.py create mode 100644 module/plugins/hoster/FilefactoryCom.py create mode 100644 module/plugins/hoster/FilesmonsterCom.py create mode 100644 module/plugins/hoster/FreakshareNet.py create mode 100644 module/plugins/hoster/GigasizeCom.py create mode 100644 module/plugins/hoster/HotfileCom.py create mode 100644 module/plugins/hoster/MegauploadCom.py create mode 100644 module/plugins/hoster/MyvideoDe.py create mode 100644 module/plugins/hoster/NetloadIn.py create mode 100644 module/plugins/hoster/RapidshareCom.py create mode 100644 module/plugins/hoster/ShareonlineBiz.py create mode 100644 module/plugins/hoster/ShragleCom.py create mode 100644 module/plugins/hoster/StorageTo.py create mode 100644 module/plugins/hoster/UploadedTo.py create mode 100644 module/plugins/hoster/XupIn.py create mode 100644 module/plugins/hoster/YoupornCom.py create mode 100644 module/plugins/hoster/YoutubeCom.py create mode 100644 module/plugins/hoster/ZippyshareCom.py create mode 100644 module/plugins/hoster/ZshareNet.py create mode 100644 module/plugins/hoster/__init__.py (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 9d7260889..bb04ae898 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -401,8 +401,12 @@ class PyLoadFile(): self.active = False pluginName = self._get_my_plugin() if pluginName: - self.modul = __import__(pluginName) - pluginClass = getattr(self.modul, self.modul.__name__) + for dir in ["hoster", "decrypter", "container"]: + try: + self.modul = __import__("%s.%s" % (dir, pluginName), globals(), locals(), [pluginName], -1) + except: + pass + pluginClass = getattr(self.modul, pluginName) else: self.modul = module.Plugin pluginClass = module.Plugin.Plugin diff --git a/module/plugins/BluehostTo.py b/module/plugins/BluehostTo.py deleted file mode 100644 index eff8ebcd8..000000000 --- a/module/plugins/BluehostTo.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import time - -from module.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 deleted file mode 100644 index 88b567904..000000000 --- a/module/plugins/CCF.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os.path -import random -import re -import tempfile -import urllib2 - -from module.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"(?!http://).*\.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 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 diff --git a/module/plugins/DDLMusicOrg.py b/module/plugins/DDLMusicOrg.py deleted file mode 100644 index c927d261c..000000000 --- a/module/plugins/DDLMusicOrg.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import sleep - -from module.Plugin import Plugin - -class DDLMusicOrg(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "DDLMusicOrg" - props['type'] = "container" - props['pattern'] = r"http://[\w\.]*?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+" - props['version'] = "0.1" - props['description'] = """ddl-music.org Container Plugin""" - props['author_name'] = ("mkaay") - props['author_mail'] = ("mkaay@mkaay.de") - 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, cookies=True) - - def file_exists(self): - """ returns True or False - """ - if not self.html: - self.download_html() - if re.search(r"Wer dies nicht rechnen kann", self.html) != None: - return True - return False - - def proceed(self, url, location): - for i in range(5): - self.download_html() - posturl = re.search(r"id=\"captcha\" action=\"(/captcha/ddlm_cr\d\.php)\"", self.html).group(1) - math = re.search(r"(\d+) ([\+-]) (\d+) =\s+", htmlwithlink) - if m: - self.links = [m.group(1)] - return - self.links = False diff --git a/module/plugins/DLC.pyc b/module/plugins/DLC.pyc deleted file mode 100644 index 235e46e1a..000000000 Binary files a/module/plugins/DLC.pyc and /dev/null differ diff --git a/module/plugins/DepositfilesCom.py b/module/plugins/DepositfilesCom.py deleted file mode 100644 index 6c5748096..000000000 --- a/module/plugins/DepositfilesCom.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import urllib -from module.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/FilefactoryCom.py b/module/plugins/FilefactoryCom.py deleted file mode 100644 index 5b7db301d..000000000 --- a/module/plugins/FilefactoryCom.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.Plugin import Plugin -from time import time - -class FilefactoryCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "FilefactoryCom" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www\.)?filefactory\.com/file/" - props['version'] = "0.1" - props['description'] = """Filefactory.com Download Plugin""" - props['author_name'] = ("sitacuisses","spoob","mkaay") - props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de") - self.props = props - self.parent = parent - self.html = None - self.want_reconnect = False - self.multi_dl = False - self.htmlwithlink = None - - def prepare(self, thread): - pyfile = self.parent - - self.want_reconnect = False - - self.download_html() - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - return False - - self.get_waiting_time() - - 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 download_html(self): - url = self.parent.url - self.html = self.req.load(url, cookies=True) - tempurl = re.search('a href=\"(.*?)\".*?button\.basic\.jpg', self.html).group(1) - self.htmlwithlink = self.req.load("http://www.filefactory.com"+tempurl, 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 = re.search('a href=\"(.*?)\".*?button\.basic\.jpg', self.htmlwithlink).group(1) - #print file_url - 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('content=\"Download\ (\S*?)\ for\ free\.', self.html).group(1) - return file_name - else: - return self.parent.url - - def get_waiting_time(self): - if self.html == None: - self.download_html() - countdown_re = re.compile("countdown.*?>(\d+)") - m = countdown_re.search(self.htmlwithlink) - if m: - sec = int(m.group(1)) - else: - sec = 0 - self.time_plus_wait = time() + sec - - 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/FilesmonsterCom.py b/module/plugins/FilesmonsterCom.py deleted file mode 100644 index 27c687363..000000000 --- a/module/plugins/FilesmonsterCom.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Plugin for www.filesmonster.com -# this plugin isn't fully implemented yet,but it does download -# todo: -# detect, if reconnect is necessary -# download-error handling -# postpone download, if speed is below a set limit -# implement premium-access -# optional replace blanks in filename with underscores - -import re -import urllib -import time -from Plugin import Plugin - -class FilesmonsterCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "FilesmonsterCom" - props['type'] = "hoster" - props['pattern'] = r"http://(www.)??filesmonster.com/download.php" - props['version'] = "0.1" - props['description'] = """Filesmonster.com Download Plugin""" - props['author_name'] = ("sitacuisses","spoob") - props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.want_reconnect = False - self.multi_dl = False - self.htmlwithlink = None - self.url = None - self.filerequest = None - - def download_html(self): - self.url = self.parent.url - self.html = self.req.load(self.url) # get the start page - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - self.get_download_page() # the complex work is done here - file_url = self.htmlwithlink - 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(r"File\sname:\s(.*?)", 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 get_download_page(self): - herewego = re.findall(r"\s*\n\s*", self.html) - the_download_page = self.req.load("http://filesmonster.com/get/free/", None, herewego) - temporary_filtered = re.search(r"\s*\n(\s*\s*\n)*?\s*", the_download_page).group(0) - all_the_tuples = re.findall(r"(.*?)<\/h1>", self.html).group(1) - return file_name - else: - return self.parent.url - - def get_waiting_time(self): - if self.html == None: - self.download_html() - timestring = re.search('\s*var\stime\s=\s(\d*?)\.\d*;', self.html).group(1) - if timestring: - sec = int(timestring) + 1 #add 1 sec as tenths of seconds are cut off - else: - sec = 0 - self.time_plus_wait = time() + sec - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"Sorry, this Download doesnt exist anymore", self.html) != None: - return False - else: - return True - - def get_download_options(self): - re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?", self.html).group(0) #get the whole request - to_sort = re.findall(r"", re_envelope) - request_options = list() - for item in to_sort: #Name value pairs are output reversed from regex, so we reorder them - request_options.append((item[1], item[0])) - herewego = self.req.load(self.parent.url, None, request_options, cookies=True) # the actual download-Page - to_sort = None - to_sort = re.findall(r"", herewego) - request_options = list() - for item in to_sort: #Same as above - request_options.append((item[1], item[0])) - return request_options - - def proceed(self, url, location): - """ - request.download doesn't handle the 302 redirect correctly - that's why the data are posted "manually" via httplib - and the redirect-url is read from the header. - Important: The cookies may not be posted to the download-url - otherwise the downloaded file only contains "bad try" - Need to come up with a better idea to handle the redirect, - help is appreciated. - """ - temp_options = urllib.urlencode(self.req_opts) - temp_url = re.match(r"http://(.*?)/.*", url).group(1) # get the server name - temp_extended = re.match(r"http://.*?(/.*)", url).group(1) # get the url relative to serverroot - cookie_list = "" - for temp_cookie in self.req.cookies: #prepare cookies - cookie_list += temp_cookie.name + "=" + temp_cookie.value +";" - temp_headers = [ #create the additional header fields - ["Content-type", "application/x-www-form-urlencoded"], #this is very important - ["User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.10"], - ["Accept-Encoding", "deflate"], - ["Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"], - ["Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"], - ["Connection", "keep-alive"], - ["Keep-Alive", "300"], - ["Referer", self.req.lastURL], - ["Cookie", cookie_list]] - temp_conn = httplib.HTTPConnection(temp_url) - temp_conn.request("POST", temp_extended, temp_options, dict(temp_headers)) - temp_response = temp_conn.getresponse() - new_url = temp_response.getheader("Location") # we need the Location-header - temp_conn.close - self.req.download(new_url, location, None, None, cookies=False) diff --git a/module/plugins/GigasizeCom.py b/module/plugins/GigasizeCom.py deleted file mode 100644 index e22fe8593..000000000 --- a/module/plugins/GigasizeCom.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import re -import tempfile -from time import time - -from module.Plugin import Plugin - -class GigasizeCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "GigasizeCom" - props['type'] = "hoster" - props['pattern'] = r"(?:http://)?(?:www.)?gigasize.com/get.php\?d=" - props['version'] = "0.1" - props['description'] = """Gigasize.com 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.gigasize.com/randomImage.php", captcha_image, cookies=True) - captcha = self.ocr.get_captcha(captcha_image) - self.html[1] = self.req.load("http://www.gigasize.com/formdownload.php", None, {"txtNumber": captcha}, cookies=True) - - if re.search(r"Package features", self.html[1]) != None: - if re.search(r"YOU HAVE REACHED YOUR HOURLY LIMIT", self.html[1]) != None: - self.time_plus_wait = time() + 3600 #one hour - #self.time_plus_wait = time() + 60 - 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 = '
' - search = re.search(file_url_pattern, self.html[1]) - if search: - return "http://gigazise.com" + search.group(1) - return "" - else: - return False - - def get_file_name(self): - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_name_pattern = "

Name: (.*)

" - return re.search(file_name_pattern, self.html[0]).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"The file has been deleted", self.html[0]) != None: - return False - else: - return True - - def proceed(self, url, location): - print url - print self.req.load(url, cookies=True) diff --git a/module/plugins/HoerbuchIn.py b/module/plugins/HoerbuchIn.py deleted file mode 100644 index ae7ae9774..000000000 --- a/module/plugins/HoerbuchIn.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.Plugin import Plugin - -class HoerbuchIn(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "HoerbuchIn" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?hoerbuch\.in/blog\.php\?id=" - props['version'] = "0.3" - props['description'] = """Hoerbuch.in Container Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - - def file_exists(self): - """ returns True or False - """ - self.download_html() - if re.search(r"Download", self.html) != None: - return True - return False - - def proceed(self, url, location): - temp_links = [] - download_container = ("Download", "Mirror #1", "Mirror #2", "Mirror #3") - for container in download_container: - download_content = re.search("
" + 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).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 get_wait_time(self): - free_limit_pattern = re.compile(r"timerend=d\.getTime\(\)\+(\d+);") - matches = free_limit_pattern.findall(self.html) - if matches: - for match in matches: - if int(match) == 60000: - continue - if int(match) == 0: - continue - else: - self.time_plus_wait = time() + int(match)/1000 + 65 - self.want_reconnect = True - return True - self.time_plus_wait = time() + 65 - - def get_download_page(self): - herewego = re.search(r"\s*)*?\n", self.html).group(0) - all_the_tuples = re.findall(r"", herewego) - - self.htmlwithlink = self.req.load(self.url, None, all_the_tuples) - - def proceed(self, url, location): - - self.req.download(url, location) - diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py deleted file mode 100644 index 92508ce29..000000000 --- a/module/plugins/LinkList.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - - -from module.Plugin import Plugin - -class LinkList(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "LinkList" - props['type'] = "container" - props['pattern'] = r"(?!http://).*\.txt" - props['version'] = "0.1" - props['description'] = """Read Link Lists in txt format""" - props['author_name'] = ("Spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.read_config() - - def proceed(self, linkList, location): - tmpLinks = [] - txt = open(linkList, 'r') - links = txt.readlines() - for link in links: - if link != "\n": - tmpLinks.append(link.replace("\n", "")) - txt.close() - - if not self.parent.core.config['general']['debug_mode']: - txt = open(linkList, 'w') - txt.write("") - txt.close() - #@TODO: maybe delete read txt file? - - self.links = tmpLinks diff --git a/module/plugins/LixIn.py b/module/plugins/LixIn.py deleted file mode 100644 index d7ef6521d..000000000 --- a/module/plugins/LixIn.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.Plugin import Plugin - -class LixIn(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "LixIn" - props['type'] = "container" - props['pattern'] = r"http://(www.)?lix.in/" - props['version'] = "0.1" - props['description'] = """Lix.in 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) - new_link = "" - if not re.search("captcha_img.php", self.html): - new_link = re.search(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/RSDF.py b/module/plugins/RSDF.py deleted file mode 100644 index 0b6a63722..000000000 --- a/module/plugins/RSDF.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import base64 -import binascii - -from module.Plugin import Plugin - -class RSDF(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "RSDF" - props['type'] = "container" - props['pattern'] = r"(?!http://).*\.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 proceed(self, url, location): - 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() diff --git a/module/plugins/RSLayerCom.py b/module/plugins/RSLayerCom.py deleted file mode 100644 index 20cadbe18..000000000 --- a/module/plugins/RSLayerCom.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.unescape import unescape -from module.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 deleted file mode 100644 index 973e28470..000000000 --- a/module/plugins/RapidshareCom.py +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import time - -from module.Plugin import Plugin -import hashlib - -class RapidshareCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "RapidshareCom" - props['type'] = "hoster" - props['pattern'] = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)" - props['version'] = "1.0" - props['description'] = """Rapidshare.com Download Plugin""" - props['author_name'] = ("spoob", "RaNaN", "mkaay") - props['author_mail'] = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de") - 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.no_slots = True - self.api_data = None - self.url = self.parent.url - 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.req.clear_cookies() - - self.download_api_data() - if self.api_data["status"] == "1": - pyfile.status.filename = self.get_file_name() - - if self.config["premium"]: - self.logger.info("Rapidshare: Use Premium Account (%sGB left)" % (self.props["premkbleft"]/1000000)) - pyfile.status.url = self.parent.url - return True - - self.download_html() - while self.no_slots: - self.get_wait_time() - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.want_reconnect = self.want_reconnect - thread.wait(pyfile) - - pyfile.status.url = self.get_file_url() - - return True - elif self.api_data["status"] == "2": - self.logger.info("Rapidshare: Traffic Share (direct download)") - pyfile.status.filename = self.get_file_name() - pyfile.status.url = self.parent.url - return True - else: - raise Exception, "The file was not found on the server." - - def download_api_data(self): - """ - http://images.rapidshare.com/apidoc.txt - """ - api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" - api_param_file = {"sub": "checkfiles_v1", "files": "", "filenames": "", "incmd5": "1"} - m = re.compile(self.props['pattern']).search(self.url) - if m: - api_param_file["files"] = m.group(1) - api_param_file["filenames"] = m.group(2) - src = self.req.load(api_url_base, cookies=False, get=api_param_file) - if src.startswith("ERROR"): - return - fields = src.split(",") - self.api_data = {} - self.api_data["fileid"] = fields[0] - self.api_data["filename"] = fields[1] - self.api_data["size"] = fields[2] # in bytes - self.api_data["serverid"] = fields[3] - self.api_data["status"] = fields[4] - """ - status codes: - 0=File not found - 1=File OK (Downloading possible without any logging) - 2=File OK (TrafficShare direct download without any logging) - 3=Server down - 4=File marked as illegal - 5=Anonymous file locked, because it has more than 10 downloads already - 6=File OK (TrafficShare direct download with enabled logging) - """ - self.api_data["shorthost"] = fields[5] - self.api_data["checksum"] = fields[6].strip().lower() # md5 - - self.api_data["mirror"] = "http://rs%(serverid)s%(shorthost)s.rapidshare.com/files/%(fileid)s/%(filename)s" % self.api_data - - if self.config["premium"]: - api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", \ - "login": self.config['username'], "password": self.config['password']} - src = self.req.load(api_url_base, cookies=False, get=api_param_prem) - if src.startswith("ERROR"): - self.config["premium"] = False - self.logger.info("Rapidshare: Login faild") - return - fields = src.split("\n") - premkbleft = int(fields[19].split("=")[1]) - if premkbleft < int(self.api_data["size"][0:-3]): - self.logger.info("Rapidshare: Not enough traffic left") - self.config["premium"] = False - else: - self.props["premkbleft"] = premkbleft - - def download_html(self): - """ gets the url from self.parent.url saves html in self.html and parses - """ - self.html[0] = self.req.load(self.url, cookies=True) - self.html_old = time() - - def get_wait_time(self): - """downloads html with the important informations - """ - file_server_url = re.search(r" %s
' % self.config['server'] - - return re.search(file_url_pattern, self.html[1]).group(1) - - def get_file_name(self): - if self.api_data["filename"]: - return self.api_data["filename"] - elif self.html[0]: - file_name_pattern = r"

.+/(.+) ", self.html) - for iframe in iframes: - self.req.load("http://relink.us/"+iframe[0], cookies=True) - - link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) - - for link_string in link_strings: - self.req.lastURL = url - - # Set Download File - framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) - - new_link = self.req.lastEffectiveURL - - if re.match(r"http://(www\.)?relink.us/",new_link): - # Find iframe - new_link = re.search("src=['\"]([^'\"]*)['\"](.*)>", framereq).group(1) - # Wait some secs for relink.us server... - time.sleep(5) - - temp_links.append(new_link) - - self.links = temp_links diff --git a/module/plugins/ShareonlineBiz.py b/module/plugins/ShareonlineBiz.py deleted file mode 100644 index b9a9accef..000000000 --- a/module/plugins/ShareonlineBiz.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import re -import tempfile -from time import time -from base64 import b64decode - -from module.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.url = self.parent.url - self.read_config() - if self.config['premium']: - self.multi_dl = True - else: - self.multi_dl = False - - def prepare(self, thread): - pyfile = self.parent - - self.download_api_data() - if self.api_data["status"]: - self.download_html() - pyfile.status.filename = self.api_data["filename"] - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.url = self.get_file_url() - pyfile.status.want_reconnect = self.want_reconnect - else: - raise Exception, "File not found" - return False - - def download_api_data(self): - """ - http://images.rapidshare.com/apidoc.txt - """ - api_url_base = "http://www.share-online.biz/linkcheck/linkcheck.php?md5=1" - api_param_file = {"links": self.url} - src = self.req.load(api_url_base, cookies=False, post=api_param_file) - - fields = src.split(";") - self.api_data = {} - self.api_data["fileid"] = fields[0] - self.api_data["status"] = fields[1] - if self.api_data["status"] == "NOTFOUND": - return - self.api_data["filename"] = fields[2] - self.api_data["size"] = fields[3] # in bytes - self.api_data["checksum"] = fields[4].strip().lower().replace("\n\n", "") # md5 - - def download_html(self): - if self.config['premium']: - post_vars = {"act": "login", - "location": "service.php", - "dieseid": "", - "user": self.config['username'], - "pass": self.config['password'], - "login":"Log+me+in", - "folder_autologin":"1"} - self.req.load("http://www.share-online.biz/login.php", cookies=True, post=post_vars) - url = self.parent.url - self.html[0] = self.req.load(url, cookies=True) - - if not self.config['premium']: - captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name - - for i in range(10): - self.req.download("http://www.share-online.biz/captcha.php", captcha_image, cookies=True) - captcha = self.ocr.get_captcha(captcha_image) - self.logger.debug("Captcha %s: %s" % (i, captcha)) - 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 not self.want_reconnect: - file_url_pattern = 'loadfilelink\.decode\("(.*)\); document' - return b64decode(re.search(file_url_pattern, self.html[1]).group(1)) - else: - return False - - def check_file(self, local_file): - if self.api_data and self.api_data["checksum"]: - h = hashlib.md5() - f = open(local_file, "rb") - h.update(f.read()) - f.close() - hexd = h.hexdigest() - if hexd == self.api_data["checksum"]: - return (True, 0) - else: - return (False, 1) - else: - return (True, 5) diff --git a/module/plugins/ShragleCom.py b/module/plugins/ShragleCom.py deleted file mode 100644 index c0cc9de72..000000000 --- a/module/plugins/ShragleCom.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import time - -from module.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}) diff --git a/module/plugins/StealthTo.py b/module/plugins/StealthTo.py deleted file mode 100644 index 855aae001..000000000 --- a/module/plugins/StealthTo.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.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/StorageTo.py b/module/plugins/StorageTo.py deleted file mode 100644 index dbff844ad..000000000 --- a/module/plugins/StorageTo.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import time - -from module.Plugin import Plugin - -class StorageTo(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "StorageTo" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www)?\.storage\.to/get/.*" - props['version'] = "0.1" - props['description'] = """Storage.to Download Plugin""" - props['author_name'] = ("mkaay") - props['author_mail'] = ("mkaay@mkaay.de") - self.props = props - self.parent = parent - self.time_plus_wait = None - self.want_reconnect = False - self.api_data = None - self.html = None - self.read_config() - self.multi_dl = False - - self.start_dl = False - - def prepare(self, thread): - pyfile = self.parent - - self.req.clear_cookies() - - 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() - - 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() - - return True - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url, cookies=True) - - def download_api_data(self): - url = self.parent.url - info_url = url.replace("/get/", "/getlink/") - src = self.req.load(info_url, cookies=True) - pattern = re.compile(r"'(\w+)' : (.*?)[,|\}]") - self.api_data = {} - for pair in pattern.findall(src): - self.api_data[pair[0]] = pair[1].strip("'") - print self.api_data - - def get_wait_time(self): - if not self.api_data: - self.download_api_data() - if self.api_data["state"] == "wait": - self.want_reconnect = True - self.time_plus_wait = time() + int(self.api_data["countdown"]) - - - - def file_exists(self): - """ returns True or False - """ - if not self.api_data: - self.download_api_data() - if self.api_data["state"] == "failed": - return False - else: - return True - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if not self.api_data: - self.download_api_data() - return self.api_data["link"] - - def get_file_name(self): - if not self.html: - self.download_html() - file_name_pattern = r"Downloading:(.*?)(.*?)" - return re.search(file_name_pattern, self.html).group(1) - - def proceed(self, url, location): - self.req.download(url, location, cookies=True) diff --git a/module/plugins/UploadedTo.py b/module/plugins/UploadedTo.py deleted file mode 100644 index bb623b4e6..000000000 --- a/module/plugins/UploadedTo.py +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import time -from module.Plugin import Plugin -import hashlib - -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/(?:file/)?(.*)" - props['version'] = "0.3" - props['description'] = """Uploaded.to Download Plugin""" - props['author_name'] = ("spoob", "mkaay") - props['author_mail'] = ("spoob@pyload.org", "mkaay@mkaay.de") - self.props = props - self.parent = parent - self.html = None - self.time_plus_wait = None #time() + wait in seconds - self.api_data = None - 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 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." - - self.download_api_data() - - pyfile.status.filename = self.get_file_name() - - if self.config['premium']: - pyfile.status.url = self.parent.url - return True - - self.get_waiting_time() - - 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" - return True - - def download_api_data(self): - url = self.parent.url - match = re.compile(self.props['pattern']).search(url) - if match: - src = self.req.load("http://uploaded.to/api/file", cookies=False, get={"id": match.group(1).split("/")[0]}) - if not src.find("404 Not Found"): - return - self.api_data = {} - lines = src.splitlines() - self.api_data["filename"] = lines[0] - self.api_data["size"] = lines[1] # in kbytes - self.api_data["checksum"] = lines[2] #sha1 - - def download_html(self): - if self.config['premium']: - self.config['username'], self.config['password'] - self.req.load("http://uploaded.to/login", None, { "email" : self.config['username'], "password" : self.config['password']}) - url = self.parent.url - self.html = self.req.load(url, cookies=False) - - def get_waiting_time(self): - 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 - """ - if self.config['premium']: - self.start_dl = True - return self.parent.url - try: - file_url_pattern = r".*" - return re.search(file_url_pattern, self.html).group(1) - except: - return None - - def get_file_name(self): - try: - if self.api_data and self.api_data["filename"]: - return self.api_data["filename"] - 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: - return self.parent.url - - def file_exists(self): - if re.search(r"(File doesn't exist .*)", self.html) != None: - return False - else: - return True - - def proceed(self, url, location): - if self.config['premium']: - self.req.download(url, location, cookies=True) - else: - self.req.download(url, location, cookies=False, post={"download_submit": "Free Download"}) - - def check_file(self, local_file): - if self.api_data and self.api_data["checksum"]: - h = hashlib.sha1() - f = open(local_file, "rb") - h.update(f.read()) - f.close() - hexd = h.hexdigest() - if hexd == self.api_data["checksum"]: - return (True, 0) - else: - return (False, 1) - else: - return (True, 5) diff --git a/module/plugins/XupIn.py b/module/plugins/XupIn.py deleted file mode 100644 index d044f2389..000000000 --- a/module/plugins/XupIn.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.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 deleted file mode 100644 index e501954da..000000000 --- a/module/plugins/YoupornCom.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.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 diff --git a/module/plugins/YoutubeChannel.py b/module/plugins/YoutubeChannel.py deleted file mode 100644 index 27a4ff8a7..000000000 --- a/module/plugins/YoutubeChannel.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.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 deleted file mode 100644 index 38a4934df..000000000 --- a/module/plugins/YoutubeCom.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.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"'VIDEO_TITLE': '(.*)'," - 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 deleted file mode 100644 index bec7f8c65..000000000 --- a/module/plugins/ZippyshareCom.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import urllib -from module.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 - """ - file_url_pattern = r"var \w* = '(http%.*?)';" - file_url_search = re.search(file_url_pattern, self.html).group(1) - file_url = urllib.unquote(file_url_search.replace("nnn", "aaa").replace("unlg", "v").replace("serwus", "zippyshare")) - return file_url - - 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 deleted file mode 100644 index 08f28a35c..000000000 --- a/module/plugins/ZshareNet.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.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 index 8d1c8b69c..e69de29bb 100644 --- a/module/plugins/__init__.py +++ b/module/plugins/__init__.py @@ -1 +0,0 @@ - diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py new file mode 100644 index 000000000..88b567904 --- /dev/null +++ b/module/plugins/container/CCF.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os.path +import random +import re +import tempfile +import urllib2 + +from module.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"(?!http://).*\.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 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 diff --git a/module/plugins/container/DLC.pyc b/module/plugins/container/DLC.pyc new file mode 100644 index 000000000..235e46e1a Binary files /dev/null and b/module/plugins/container/DLC.pyc differ diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py new file mode 100644 index 000000000..92508ce29 --- /dev/null +++ b/module/plugins/container/LinkList.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + + +from module.Plugin import Plugin + +class LinkList(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "LinkList" + props['type'] = "container" + props['pattern'] = r"(?!http://).*\.txt" + props['version'] = "0.1" + props['description'] = """Read Link Lists in txt format""" + props['author_name'] = ("Spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.read_config() + + def proceed(self, linkList, location): + tmpLinks = [] + txt = open(linkList, 'r') + links = txt.readlines() + for link in links: + if link != "\n": + tmpLinks.append(link.replace("\n", "")) + txt.close() + + if not self.parent.core.config['general']['debug_mode']: + txt = open(linkList, 'w') + txt.write("") + txt.close() + #@TODO: maybe delete read txt file? + + self.links = tmpLinks diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py new file mode 100644 index 000000000..0b6a63722 --- /dev/null +++ b/module/plugins/container/RSDF.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import base64 +import binascii + +from module.Plugin import Plugin + +class RSDF(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "RSDF" + props['type'] = "container" + props['pattern'] = r"(?!http://).*\.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 proceed(self, url, location): + 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() diff --git a/module/plugins/container/__init__.py b/module/plugins/container/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/module/plugins/decrypter/DDLMusicOrg.py b/module/plugins/decrypter/DDLMusicOrg.py new file mode 100644 index 000000000..c927d261c --- /dev/null +++ b/module/plugins/decrypter/DDLMusicOrg.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import sleep + +from module.Plugin import Plugin + +class DDLMusicOrg(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "DDLMusicOrg" + props['type'] = "container" + props['pattern'] = r"http://[\w\.]*?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+" + props['version'] = "0.1" + props['description'] = """ddl-music.org Container Plugin""" + props['author_name'] = ("mkaay") + props['author_mail'] = ("mkaay@mkaay.de") + 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, cookies=True) + + def file_exists(self): + """ returns True or False + """ + if not self.html: + self.download_html() + if re.search(r"Wer dies nicht rechnen kann", self.html) != None: + return True + return False + + def proceed(self, url, location): + for i in range(5): + self.download_html() + posturl = re.search(r"id=\"captcha\" action=\"(/captcha/ddlm_cr\d\.php)\"", self.html).group(1) + math = re.search(r"(\d+) ([\+-]) (\d+) =\s+", htmlwithlink) + if m: + self.links = [m.group(1)] + return + self.links = False diff --git a/module/plugins/decrypter/FourChanOrg.py b/module/plugins/decrypter/FourChanOrg.py new file mode 100644 index 000000000..e3b00c1f7 --- /dev/null +++ b/module/plugins/decrypter/FourChanOrg.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.Plugin import Plugin + +class FourChanOrg(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FourChanOrg" + 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.req.load("http://1kh.de/l/" + id)).group(1)) + temp_links.append(new_link) + self.links = temp_links diff --git a/module/plugins/decrypter/RSLayerCom.py b/module/plugins/decrypter/RSLayerCom.py new file mode 100644 index 000000000..20cadbe18 --- /dev/null +++ b/module/plugins/decrypter/RSLayerCom.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.unescape import unescape +from module.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/decrypter/RelinkUs.py b/module/plugins/decrypter/RelinkUs.py new file mode 100644 index 000000000..71b441116 --- /dev/null +++ b/module/plugins/decrypter/RelinkUs.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import time + +from module.Plugin import Plugin + +class RelinkUs(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "RelinkUs" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?relink.us/(f|((view|go).php))" + props['version'] = "1" + props['description'] = """Relink.us Container Plugin""" + props['author_name'] = ("Sleeper-", "spoob") + props['author_mail'] = ("@nonymous", "spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.multi_dl = False + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + container_id = self.parent.url.split("/")[-1].split("id=")[-1] + url = "http://relink.us/view.php?id="+container_id + self.html = self.req.load(url, cookies=True) + temp_links = [] + + # Download Ad-Frames, otherwise we aren't enabled for download + iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)>", self.html) + for iframe in iframes: + self.req.load("http://relink.us/"+iframe[0], cookies=True) + + link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) + + for link_string in link_strings: + self.req.lastURL = url + + # Set Download File + framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) + + new_link = self.req.lastEffectiveURL + + if re.match(r"http://(www\.)?relink.us/",new_link): + # Find iframe + new_link = re.search("src=['\"]([^'\"]*)['\"](.*)>", framereq).group(1) + # Wait some secs for relink.us server... + time.sleep(5) + + temp_links.append(new_link) + + self.links = temp_links diff --git a/module/plugins/decrypter/StealthTo.py b/module/plugins/decrypter/StealthTo.py new file mode 100644 index 000000000..855aae001 --- /dev/null +++ b/module/plugins/decrypter/StealthTo.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.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/decrypter/YoutubeChannel.py b/module/plugins/decrypter/YoutubeChannel.py new file mode 100644 index 000000000..27a4ff8a7 --- /dev/null +++ b/module/plugins/decrypter/YoutubeChannel.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.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/decrypter/__init__.py b/module/plugins/decrypter/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/module/plugins/hoster/BluehostTo.py b/module/plugins/hoster/BluehostTo.py new file mode 100644 index 000000000..eff8ebcd8 --- /dev/null +++ b/module/plugins/hoster/BluehostTo.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import time + +from module.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/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py new file mode 100644 index 000000000..6c5748096 --- /dev/null +++ b/module/plugins/hoster/DepositfilesCom.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib +from module.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/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py new file mode 100644 index 000000000..5b7db301d --- /dev/null +++ b/module/plugins/hoster/FilefactoryCom.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.Plugin import Plugin +from time import time + +class FilefactoryCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FilefactoryCom" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www\.)?filefactory\.com/file/" + props['version'] = "0.1" + props['description'] = """Filefactory.com Download Plugin""" + props['author_name'] = ("sitacuisses","spoob","mkaay") + props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + self.htmlwithlink = None + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + + self.download_html() + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + return False + + self.get_waiting_time() + + 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 download_html(self): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + tempurl = re.search('a href=\"(.*?)\".*?button\.basic\.jpg', self.html).group(1) + self.htmlwithlink = self.req.load("http://www.filefactory.com"+tempurl, 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 = re.search('a href=\"(.*?)\".*?button\.basic\.jpg', self.htmlwithlink).group(1) + #print file_url + 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('content=\"Download\ (\S*?)\ for\ free\.', self.html).group(1) + return file_name + else: + return self.parent.url + + def get_waiting_time(self): + if self.html == None: + self.download_html() + countdown_re = re.compile("countdown.*?>(\d+)") + m = countdown_re.search(self.htmlwithlink) + if m: + sec = int(m.group(1)) + else: + sec = 0 + self.time_plus_wait = time() + sec + + 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/hoster/FilesmonsterCom.py b/module/plugins/hoster/FilesmonsterCom.py new file mode 100644 index 000000000..27c687363 --- /dev/null +++ b/module/plugins/hoster/FilesmonsterCom.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Plugin for www.filesmonster.com +# this plugin isn't fully implemented yet,but it does download +# todo: +# detect, if reconnect is necessary +# download-error handling +# postpone download, if speed is below a set limit +# implement premium-access +# optional replace blanks in filename with underscores + +import re +import urllib +import time +from Plugin import Plugin + +class FilesmonsterCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FilesmonsterCom" + props['type'] = "hoster" + props['pattern'] = r"http://(www.)??filesmonster.com/download.php" + props['version'] = "0.1" + props['description'] = """Filesmonster.com Download Plugin""" + props['author_name'] = ("sitacuisses","spoob") + props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + self.htmlwithlink = None + self.url = None + self.filerequest = None + + def download_html(self): + self.url = self.parent.url + self.html = self.req.load(self.url) # get the start page + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + self.get_download_page() # the complex work is done here + file_url = self.htmlwithlink + 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(r"File\sname:\s(.*?)", 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 get_download_page(self): + herewego = re.findall(r"\s*\n\s*", self.html) + the_download_page = self.req.load("http://filesmonster.com/get/free/", None, herewego) + temporary_filtered = re.search(r"\s*\n(\s*\s*\n)*?\s*", the_download_page).group(0) + all_the_tuples = re.findall(r"(.*?)<\/h1>", self.html).group(1) + return file_name + else: + return self.parent.url + + def get_waiting_time(self): + if self.html == None: + self.download_html() + timestring = re.search('\s*var\stime\s=\s(\d*?)\.\d*;', self.html).group(1) + if timestring: + sec = int(timestring) + 1 #add 1 sec as tenths of seconds are cut off + else: + sec = 0 + self.time_plus_wait = time() + sec + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"Sorry, this Download doesnt exist anymore", self.html) != None: + return False + else: + return True + + def get_download_options(self): + re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?", self.html).group(0) #get the whole request + to_sort = re.findall(r"", re_envelope) + request_options = list() + for item in to_sort: #Name value pairs are output reversed from regex, so we reorder them + request_options.append((item[1], item[0])) + herewego = self.req.load(self.parent.url, None, request_options, cookies=True) # the actual download-Page + to_sort = None + to_sort = re.findall(r"", herewego) + request_options = list() + for item in to_sort: #Same as above + request_options.append((item[1], item[0])) + return request_options + + def proceed(self, url, location): + """ + request.download doesn't handle the 302 redirect correctly + that's why the data are posted "manually" via httplib + and the redirect-url is read from the header. + Important: The cookies may not be posted to the download-url + otherwise the downloaded file only contains "bad try" + Need to come up with a better idea to handle the redirect, + help is appreciated. + """ + temp_options = urllib.urlencode(self.req_opts) + temp_url = re.match(r"http://(.*?)/.*", url).group(1) # get the server name + temp_extended = re.match(r"http://.*?(/.*)", url).group(1) # get the url relative to serverroot + cookie_list = "" + for temp_cookie in self.req.cookies: #prepare cookies + cookie_list += temp_cookie.name + "=" + temp_cookie.value +";" + temp_headers = [ #create the additional header fields + ["Content-type", "application/x-www-form-urlencoded"], #this is very important + ["User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.10"], + ["Accept-Encoding", "deflate"], + ["Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"], + ["Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"], + ["Connection", "keep-alive"], + ["Keep-Alive", "300"], + ["Referer", self.req.lastURL], + ["Cookie", cookie_list]] + temp_conn = httplib.HTTPConnection(temp_url) + temp_conn.request("POST", temp_extended, temp_options, dict(temp_headers)) + temp_response = temp_conn.getresponse() + new_url = temp_response.getheader("Location") # we need the Location-header + temp_conn.close + self.req.download(new_url, location, None, None, cookies=False) diff --git a/module/plugins/hoster/GigasizeCom.py b/module/plugins/hoster/GigasizeCom.py new file mode 100644 index 000000000..e22fe8593 --- /dev/null +++ b/module/plugins/hoster/GigasizeCom.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import re +import tempfile +from time import time + +from module.Plugin import Plugin + +class GigasizeCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "GigasizeCom" + props['type'] = "hoster" + props['pattern'] = r"(?:http://)?(?:www.)?gigasize.com/get.php\?d=" + props['version'] = "0.1" + props['description'] = """Gigasize.com 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.gigasize.com/randomImage.php", captcha_image, cookies=True) + captcha = self.ocr.get_captcha(captcha_image) + self.html[1] = self.req.load("http://www.gigasize.com/formdownload.php", None, {"txtNumber": captcha}, cookies=True) + + if re.search(r"Package features", self.html[1]) != None: + if re.search(r"YOU HAVE REACHED YOUR HOURLY LIMIT", self.html[1]) != None: + self.time_plus_wait = time() + 3600 #one hour + #self.time_plus_wait = time() + 60 + 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 = '
' + search = re.search(file_url_pattern, self.html[1]) + if search: + return "http://gigazise.com" + search.group(1) + return "" + else: + return False + + def get_file_name(self): + if self.html[0] == None: + self.download_html() + if not self.want_reconnect: + file_name_pattern = "

Name: (.*)

" + return re.search(file_name_pattern, self.html[0]).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"The file has been deleted", self.html[0]) != None: + return False + else: + return True + + def proceed(self, url, location): + print url + print self.req.load(url, cookies=True) diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py new file mode 100644 index 000000000..a046cb6b1 --- /dev/null +++ b/module/plugins/hoster/HotfileCom.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import time +from module.Plugin import Plugin + +class HotfileCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "HotfileCom" + props['type'] = "hoster" + props['pattern'] = r"http://hotfile.com/dl/" + props['version'] = "0.1" + props['description'] = """Hotfile.com Download Plugin""" + props['author_name'] = ("sitacuisses","spoob","mkaay") + props['author_mail'] = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + self.htmlwithlink = None + self.url = None + + 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() + + 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() + + return True + + def download_html(self): + self.url = self.parent.url + self.html = self.req.load(self.url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + self.get_download_page() + file_url = re.search("a href=\"(http://hotfile\.com/get/\S*?)\"", self.htmlwithlink).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('Downloading\s(.*?)', 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 get_wait_time(self): + free_limit_pattern = re.compile(r"timerend=d\.getTime\(\)\+(\d+);") + matches = free_limit_pattern.findall(self.html) + if matches: + for match in matches: + if int(match) == 60000: + continue + if int(match) == 0: + continue + else: + self.time_plus_wait = time() + int(match)/1000 + 65 + self.want_reconnect = True + return True + self.time_plus_wait = time() + 65 + + def get_download_page(self): + herewego = re.search(r"\s*)*?\n", self.html).group(0) + all_the_tuples = re.findall(r"", herewego) + + self.htmlwithlink = self.req.load(self.url, None, all_the_tuples) + + def proceed(self, url, location): + + self.req.download(url, location) + diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py new file mode 100644 index 000000000..3eb21a591 --- /dev/null +++ b/module/plugins/hoster/MegauploadCom.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import re +import tempfile +from time import time + +from module.Plugin import Plugin + +class MegauploadCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "MegauploadCom" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www.)megaupload.com/" + props['version'] = "0.1" + props['description'] = """Megaupload.com Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.time_plus_wait = None #time() + wait in seconds + + self.html = [None, None] + self.want_reconnect = False + self.init_ocr() + self.multi_dl = False + + def download_html(self): + url = self.parent.url + + captcha_image = tempfile.NamedTemporaryFile(suffix=".gif").name + + for i in range(5): + self.html[0] = self.req.load(url, cookies=True) + url_captcha_html = re.search('(http://www.{,3}\.megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1) + self.req.download(url_captcha_html, captcha_image, cookies=True) + captcha = self.ocr.get_captcha(captcha_image) + os.remove(captcha_image) + captchacode = re.search('name="captchacode" value="(.*)"', self.html[0]).group(1) + megavar = re.search('name="megavar" value="(.*)">', 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 + self.time_plus_wait = time() + 45 + + 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/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py new file mode 100644 index 000000000..bc755fb58 --- /dev/null +++ b/module/plugins/hoster/NetloadIn.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import re +import tempfile +from time import time +from time import sleep +import hashlib + +from module.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.multi_dl = False + self.api_data = None + self.init_ocr() + self.read_config() + if self.config['premium']: + self.multi_dl = True + else: + self.multi_dl = False + + def prepare(self, thread): + pyfile = self.parent + self.req.clear_cookies() + + self.download_api_data() + if self.file_exists(): + pyfile.status.filename = self.get_file_name() + + if self.config['premium']: + self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}) + self.logger.info("Netload: Use Premium Account") + pyfile.status.url = self.parent.url + #@TODO: premium?? + return True + + self.download_html() + while not pyfile.status.url: + 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() + + else: + raise Exception, "The file was not found on the server." + + def download_api_data(self): + url = self.parent.url + id_regex = re.compile("http://netload.in/datei(.*?)(?:\.htm|/)") + match = id_regex.search(url) + if match: + apiurl = "http://netload.in/share/fileinfos2.php" + src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) + self.api_data = {} + if src != "unknown file_data": + lines = src.split(";") + self.api_data["exists"] = True + self.api_data["fileid"] = lines[0] + self.api_data["filename"] = lines[1] + self.api_data["size"] = lines[2] #@TODO formatting? (ex: '2.07 KB') + self.api_data["status"] = lines[3] + self.api_data["checksum"] = lines[4].replace("\n", "") + else: + self.api_data["exists"] = False + + def download_html(self): + self.html[0] = self.req.load(self.parent.url, cookies=True) + 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) + os.remove(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) + + if re.search(r"(We will prepare your download..|We had a reqeust with the IP)", self.html[2]) != None: + break + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + try: + file_url_pattern = r"
Click here" + return re.search(file_url_pattern, self.html[2]).group(1) + except: + return None + + def get_wait_time(self): + if re.search(r"We had a reqeust with the IP", self.html[2]): + self.time_plus_wait = time() + 10 * 30 + return + + wait_seconds = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 100 + self.time_plus_wait = time() + wait_seconds + + def get_file_name(self): + if self.api_data["filename"]: + return self.api_data["filename"] + elif self.html[0]: + file_name_pattern = '\t\t\t(.+)' + file_name_search = re.search(file_name_pattern, self.html[0]) + if file_name_search: + return file_name_search.group(1) + return self.parent.url + + def file_exists(self): + if self.api_data["exists"]: + return self.api_data["exists"] + elif self.html[0] and re.search(r"The file has been deleted", self.html[0]) == None: + return True + return False + + def proceed(self, url, location): + self.req.download(url, location, cookies=True) + + def check_file(self, local_file): + if self.api_data and self.api_data["checksum"]: + h = hashlib.md5() + f = open(local_file, "rb") + h.update(f.read()) + f.close() + hexd = h.hexdigest() + if hexd == self.api_data["checksum"]: + return (True, 0) + else: + return (False, 1) + else: + return (True, 5) diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py new file mode 100644 index 000000000..973e28470 --- /dev/null +++ b/module/plugins/hoster/RapidshareCom.py @@ -0,0 +1,191 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import time + +from module.Plugin import Plugin +import hashlib + +class RapidshareCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "RapidshareCom" + props['type'] = "hoster" + props['pattern'] = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)" + props['version'] = "1.0" + props['description'] = """Rapidshare.com Download Plugin""" + props['author_name'] = ("spoob", "RaNaN", "mkaay") + props['author_mail'] = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de") + 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.no_slots = True + self.api_data = None + self.url = self.parent.url + 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.req.clear_cookies() + + self.download_api_data() + if self.api_data["status"] == "1": + pyfile.status.filename = self.get_file_name() + + if self.config["premium"]: + self.logger.info("Rapidshare: Use Premium Account (%sGB left)" % (self.props["premkbleft"]/1000000)) + pyfile.status.url = self.parent.url + return True + + self.download_html() + while self.no_slots: + self.get_wait_time() + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.want_reconnect = self.want_reconnect + thread.wait(pyfile) + + pyfile.status.url = self.get_file_url() + + return True + elif self.api_data["status"] == "2": + self.logger.info("Rapidshare: Traffic Share (direct download)") + pyfile.status.filename = self.get_file_name() + pyfile.status.url = self.parent.url + return True + else: + raise Exception, "The file was not found on the server." + + def download_api_data(self): + """ + http://images.rapidshare.com/apidoc.txt + """ + api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" + api_param_file = {"sub": "checkfiles_v1", "files": "", "filenames": "", "incmd5": "1"} + m = re.compile(self.props['pattern']).search(self.url) + if m: + api_param_file["files"] = m.group(1) + api_param_file["filenames"] = m.group(2) + src = self.req.load(api_url_base, cookies=False, get=api_param_file) + if src.startswith("ERROR"): + return + fields = src.split(",") + self.api_data = {} + self.api_data["fileid"] = fields[0] + self.api_data["filename"] = fields[1] + self.api_data["size"] = fields[2] # in bytes + self.api_data["serverid"] = fields[3] + self.api_data["status"] = fields[4] + """ + status codes: + 0=File not found + 1=File OK (Downloading possible without any logging) + 2=File OK (TrafficShare direct download without any logging) + 3=Server down + 4=File marked as illegal + 5=Anonymous file locked, because it has more than 10 downloads already + 6=File OK (TrafficShare direct download with enabled logging) + """ + self.api_data["shorthost"] = fields[5] + self.api_data["checksum"] = fields[6].strip().lower() # md5 + + self.api_data["mirror"] = "http://rs%(serverid)s%(shorthost)s.rapidshare.com/files/%(fileid)s/%(filename)s" % self.api_data + + if self.config["premium"]: + api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", \ + "login": self.config['username'], "password": self.config['password']} + src = self.req.load(api_url_base, cookies=False, get=api_param_prem) + if src.startswith("ERROR"): + self.config["premium"] = False + self.logger.info("Rapidshare: Login faild") + return + fields = src.split("\n") + premkbleft = int(fields[19].split("=")[1]) + if premkbleft < int(self.api_data["size"][0:-3]): + self.logger.info("Rapidshare: Not enough traffic left") + self.config["premium"] = False + else: + self.props["premkbleft"] = premkbleft + + def download_html(self): + """ gets the url from self.parent.url saves html in self.html and parses + """ + self.html[0] = self.req.load(self.url, cookies=True) + self.html_old = time() + + def get_wait_time(self): + """downloads html with the important informations + """ + file_server_url = re.search(r" %s
' % self.config['server'] + + return re.search(file_url_pattern, self.html[1]).group(1) + + def get_file_name(self): + if self.api_data["filename"]: + return self.api_data["filename"] + elif self.html[0]: + file_name_pattern = r"

.+/(.+)

(.+)<\/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}) diff --git a/module/plugins/hoster/StorageTo.py b/module/plugins/hoster/StorageTo.py new file mode 100644 index 000000000..dbff844ad --- /dev/null +++ b/module/plugins/hoster/StorageTo.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import time + +from module.Plugin import Plugin + +class StorageTo(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "StorageTo" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www)?\.storage\.to/get/.*" + props['version'] = "0.1" + props['description'] = """Storage.to Download Plugin""" + props['author_name'] = ("mkaay") + props['author_mail'] = ("mkaay@mkaay.de") + self.props = props + self.parent = parent + self.time_plus_wait = None + self.want_reconnect = False + self.api_data = None + self.html = None + self.read_config() + self.multi_dl = False + + self.start_dl = False + + def prepare(self, thread): + pyfile = self.parent + + self.req.clear_cookies() + + 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() + + 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() + + return True + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + + def download_api_data(self): + url = self.parent.url + info_url = url.replace("/get/", "/getlink/") + src = self.req.load(info_url, cookies=True) + pattern = re.compile(r"'(\w+)' : (.*?)[,|\}]") + self.api_data = {} + for pair in pattern.findall(src): + self.api_data[pair[0]] = pair[1].strip("'") + print self.api_data + + def get_wait_time(self): + if not self.api_data: + self.download_api_data() + if self.api_data["state"] == "wait": + self.want_reconnect = True + self.time_plus_wait = time() + int(self.api_data["countdown"]) + + + + def file_exists(self): + """ returns True or False + """ + if not self.api_data: + self.download_api_data() + if self.api_data["state"] == "failed": + return False + else: + return True + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if not self.api_data: + self.download_api_data() + return self.api_data["link"] + + def get_file_name(self): + if not self.html: + self.download_html() + file_name_pattern = r"Downloading:(.*?)(.*?)" + return re.search(file_name_pattern, self.html).group(1) + + def proceed(self, url, location): + self.req.download(url, location, cookies=True) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py new file mode 100644 index 000000000..bb623b4e6 --- /dev/null +++ b/module/plugins/hoster/UploadedTo.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import time +from module.Plugin import Plugin +import hashlib + +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/(?:file/)?(.*)" + props['version'] = "0.3" + props['description'] = """Uploaded.to Download Plugin""" + props['author_name'] = ("spoob", "mkaay") + props['author_mail'] = ("spoob@pyload.org", "mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.time_plus_wait = None #time() + wait in seconds + self.api_data = None + 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 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." + + self.download_api_data() + + pyfile.status.filename = self.get_file_name() + + if self.config['premium']: + pyfile.status.url = self.parent.url + return True + + self.get_waiting_time() + + 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" + return True + + def download_api_data(self): + url = self.parent.url + match = re.compile(self.props['pattern']).search(url) + if match: + src = self.req.load("http://uploaded.to/api/file", cookies=False, get={"id": match.group(1).split("/")[0]}) + if not src.find("404 Not Found"): + return + self.api_data = {} + lines = src.splitlines() + self.api_data["filename"] = lines[0] + self.api_data["size"] = lines[1] # in kbytes + self.api_data["checksum"] = lines[2] #sha1 + + def download_html(self): + if self.config['premium']: + self.config['username'], self.config['password'] + self.req.load("http://uploaded.to/login", None, { "email" : self.config['username'], "password" : self.config['password']}) + url = self.parent.url + self.html = self.req.load(url, cookies=False) + + def get_waiting_time(self): + 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 + """ + if self.config['premium']: + self.start_dl = True + return self.parent.url + try: + file_url_pattern = r".*" + return re.search(file_url_pattern, self.html).group(1) + except: + return None + + def get_file_name(self): + try: + if self.api_data and self.api_data["filename"]: + return self.api_data["filename"] + 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: + return self.parent.url + + def file_exists(self): + if re.search(r"(File doesn't exist .*)", self.html) != None: + return False + else: + return True + + def proceed(self, url, location): + if self.config['premium']: + self.req.download(url, location, cookies=True) + else: + self.req.download(url, location, cookies=False, post={"download_submit": "Free Download"}) + + def check_file(self, local_file): + if self.api_data and self.api_data["checksum"]: + h = hashlib.sha1() + f = open(local_file, "rb") + h.update(f.read()) + f.close() + hexd = h.hexdigest() + if hexd == self.api_data["checksum"]: + return (True, 0) + else: + return (False, 1) + else: + return (True, 5) diff --git a/module/plugins/hoster/XupIn.py b/module/plugins/hoster/XupIn.py new file mode 100644 index 000000000..d044f2389 --- /dev/null +++ b/module/plugins/hoster/XupIn.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.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/hoster/YoupornCom.py b/module/plugins/hoster/YoupornCom.py new file mode 100644 index 000000000..e501954da --- /dev/null +++ b/module/plugins/hoster/YoupornCom.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.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 diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py new file mode 100644 index 000000000..38a4934df --- /dev/null +++ b/module/plugins/hoster/YoutubeCom.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.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"'VIDEO_TITLE': '(.*)'," + 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/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py new file mode 100644 index 000000000..bec7f8c65 --- /dev/null +++ b/module/plugins/hoster/ZippyshareCom.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib +from module.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 + """ + file_url_pattern = r"var \w* = '(http%.*?)';" + file_url_search = re.search(file_url_pattern, self.html).group(1) + file_url = urllib.unquote(file_url_search.replace("nnn", "aaa").replace("unlg", "v").replace("serwus", "zippyshare")) + return file_url + + 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/hoster/ZshareNet.py b/module/plugins/hoster/ZshareNet.py new file mode 100644 index 000000000..08f28a35c --- /dev/null +++ b/module/plugins/hoster/ZshareNet.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.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/hoster/__init__.py b/module/plugins/hoster/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/module/thread_list.py b/module/thread_list.py index fc4160a6d..719849585 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -188,7 +188,7 @@ class Thread_List(object): return False def reconnect(self): - reconn = subprocess.Popen(self.parent.config['general']['reconnect_method'], stdout=subprocess.PIPE) + reconn = subprocess.Popen(self.parent.config['general']['reconnect_method'])#, stdout=subprocess.PIPE) reconn.wait() time.sleep(1) ip = "" -- cgit v1.2.3