diff options
-rw-r--r-- | module/plugins/Plugin.py | 5 | ||||
-rw-r--r-- | module/plugins/hoster/DuckloadCom.py | 80 | ||||
-rw-r--r-- | module/plugins/hoster/FilefactoryCom.py | 99 | ||||
-rw-r--r-- | module/plugins/hoster/FilesmonsterCom.py | 89 | ||||
-rw-r--r-- | module/plugins/hoster/FreakshareNet.py | 2 | ||||
-rw-r--r-- | module/plugins/hoster/GigasizeCom.py | 78 | ||||
-rw-r--r-- | module/plugins/hoster/SharenowNet.py | 65 | ||||
-rw-r--r-- | module/plugins/hoster/XupIn.py | 43 | ||||
-rw-r--r-- | module/plugins/hoster/YourFilesTo.py | 87 | ||||
-rw-r--r-- | module/plugins/hoster/ZshareNet.py | 70 | ||||
-rw-r--r-- | module/web/pyload/views.py | 2 | ||||
-rwxr-xr-x | pyLoadCore.py | 11 |
12 files changed, 10 insertions, 621 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index dfdfbe4f6..ee823329c 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -241,10 +241,7 @@ class Plugin(object): download_folder = self.config['general']['download_folder'] - if self.config['general']['folder_per_package']: - location = join(download_folder, self.pyfile.package().folder.decode(sys.getfilesystemencoding())) - else: - location = download_folder + location = join(download_folder, self.pyfile.package().folder.decode(sys.getfilesystemencoding())) if not exists(location): makedirs(location) diff --git a/module/plugins/hoster/DuckloadCom.py b/module/plugins/hoster/DuckloadCom.py deleted file mode 100644 index 34a6a5146..000000000 --- a/module/plugins/hoster/DuckloadCom.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-import re
-from module.plugins.Hoster import Hoster
-from time import time
-
-class DuckloadCom(Hoster):
- __name__ = "DuckloadCom"
- __type__ = "hoster"
- __pattern__ = r"http://(?:www\.)?duckload\.com/divx/"
- __version__ = "0.1"
- __description__ = """Duckload.com Download Hoster"""
- __author_name__ = ("wugy")
- __author_mail__ = ("wugy@qip.ru")
-
- def __init__(self, parent):
- Hoster.__init__(self, parent)
- self.parent = parent
- self.html = [None, None]
- self.want_reconnect = False
- self.multi_dl = False
-
- 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:
- return False
-
- pyfile.status.filename = self.get_file_name()
-
- pyfile.status.waituntil = time()
- 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[0] = self.load(url)
- self.html[1] = self.load(url, post={"server": "1", "sn": "Stream Starten"})
-
- def get_file_url(self):
- """ returns the absolute downloadable filepath
- """
- if self.html[1] == None:
- self.download_html()
- if not self.want_reconnect:
- file_url = re.search('type=\"video/divx\"\ src=\"(.*?)\"', self.html[1]).group(1)
- #print file_url
- return file_url
- else:
- return False
-
- def get_file_name(self):
- if self.html[1] == None:
- self.download_html()
- if not self.want_reconnect:
- file_name = re.search('Film\ \"(\S*?)\"\ anschauen', self.html[1]).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"Datei wurde nicht gefunden!", self.html) != None:
- return False
- else:
- return True
diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py deleted file mode 100644 index fe68c914f..000000000 --- a/module/plugins/hoster/FilefactoryCom.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.plugins.Hoster import Hoster -from time import time - -class FilefactoryCom(Hoster): - __name__ = "FilefactoryCom" - __type__ = "hoster" - __pattern__ = r"http://(?:www\.)?filefactory\.com/file/" - __version__ = "0.1" - __description__ = """Filefactory.com Download Hoster""" - __author_name__ = ("sitacuisses","spoob","mkaay") - __author_mail__ = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de") - - def __init__(self, parent): - Hoster.__init__(self, parent) - 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: - 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.load(url, cookies=True) - tempurl = re.search('a href=\"(.*?)\".*?button\.basic\.jpg', self.html).group(1) - self.htmlwithlink = self.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=\"(.*?)\" id=\"downloadLinkTarget\"', 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.download(url, location, cookies=True) - diff --git a/module/plugins/hoster/FilesmonsterCom.py b/module/plugins/hoster/FilesmonsterCom.py deleted file mode 100644 index f52e01760..000000000 --- a/module/plugins/hoster/FilesmonsterCom.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Hoster 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 module.plugins.Hoster import Hoster - -class FilesmonsterCom(Hoster): - __name__ = "FilesmonsterCom" - __type__ = "hoster" - __pattern__ = r"http://(www.)??filesmonster.com/download.php" - __version__ = "0.1" - __description__ = """Filesmonster.com Download Hoster""" - __author_name__ = ("sitacuisses","spoob") - __author_mail__ = ("sitacuisses@yahoo.de","spoob@pyload.org") - - def __init__(self, parent): - Hoster.__init__(self, parent) - 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.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<span\sclass=\"em\">(.*?)</span>", self.html).group(1) - return file_name - else: - return self.parent.url - - def file_exists(self): - 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"<form\sid=\'slowdownload\'\smethod=\"post\"\saction=\"http://filesmonster.com/get/free/\">\s*\n\s*<input\stype=\"hidden\"\sname=\"(\S*?)\"\svalue=\"(\S*?)\"\s*>", self.html) - the_download_page = self.load("http://filesmonster.com/get/free/", None, herewego) - temporary_filtered = re.search(r"</div><form\sid=\'rtForm\'\sname=\"rtForm\"\smethod=\"post\">\s*\n(\s*<input\stype=\'hidden\'\sname=\'(\S*?)\'\svalue=\'(\S*?)\'>\s*\n)*?\s*</form>", the_download_page).group(0) - all_the_tuples = re.findall(r"<input\stype=\'hidden\'\sname=\'(\S*?)\'\svalue=\'(\S*?)\'", temporary_filtered) - time.sleep(30) - herewego = None - herewego = self.load('http://filesmonster.com/ajax.php', None, all_the_tuples) - ticket_number = re.search(r"\"text\":\"(.*?)\"\,\"error\"", herewego).group(1) - herewego = None - herewego = self.load('http://filesmonster.com/ajax.php', None, {'act': 'getdl', 'data': ticket_number}) - ticket_number = None - ticket_number = re.search(r"\"url\":\"(.*?)\"", herewego).group(1) - the_download_page = re.sub(r"\\/", r"/", ticket_number) - ticket_number = urllib.quote(the_download_page.encode('utf8')) - self.htmlwithlink = re.sub("http%3A", "http:", ticket_number) - self.filerequest = re.search(r"\"file_request\":\"(.*?)\"", herewego).group(1) - - def proceed(self, url, location): - self.download(url, location, None, {"X-File-Request": self.filerequest}) diff --git a/module/plugins/hoster/FreakshareNet.py b/module/plugins/hoster/FreakshareNet.py index 59b59e376..1bb36737e 100644 --- a/module/plugins/hoster/FreakshareNet.py +++ b/module/plugins/hoster/FreakshareNet.py @@ -2,8 +2,6 @@ # -*- coding: utf-8 -*- import re -import urllib -import httplib from module.plugins.Hoster import Hoster from time import time diff --git a/module/plugins/hoster/GigasizeCom.py b/module/plugins/hoster/GigasizeCom.py deleted file mode 100644 index 38d26a404..000000000 --- a/module/plugins/hoster/GigasizeCom.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import re -import tempfile -from time import time - -from module.plugins.Hoster import Hoster - -class GigasizeCom(Hoster): - __name__ = "GigasizeCom" - __type__ = "hoster" - __pattern__ = r"(?:http://)?(?:www.)?gigasize.com/get.php\?d=" - __version__ = "0.1" - __description__ = """Gigasize.com Download Hoster""" - __author_name__ = ("spoob") - __author_mail__ = ("spoob@pyload.org") - - def __init__(self, parent): - Hoster.__init__(self, parent) - 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.load(url, cookies=True) - - captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name - - for i in range(5): - self.download("http://www.gigasize.com/randomImage.php", captcha_image, cookies=True) - captcha = self.ocr.get_captcha(captcha_image) - self.html[1] = self.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 = '<form action="(/getcgi.php\?t=.*)" method="post" id="formDownload">' - 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 = "<p><strong>Name</strong>: <b>(.*)</b></p>" - 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 diff --git a/module/plugins/hoster/SharenowNet.py b/module/plugins/hoster/SharenowNet.py deleted file mode 100644 index 9eb0a9f9e..000000000 --- a/module/plugins/hoster/SharenowNet.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.plugins.Hoster import Hoster -from module.unescape import unescape - -class SharenowNet(Hoster): - __name__ = "SharenowNet" - __type__ = "hoster" - __pattern__ = r'http://(www\.)?share-now\.net/files/\d+-.*?\.html' - __version__ = "0.1" - __description__ = """Share-Now.net Download Hoster""" - __author_name__ = ("jeix") - __author_mail__ = ("jeix@hasnomail.de") - - def __init__(self, parent): - Hoster.__init__(self, parent) - self.parent = parent - self.html = None - self.multi_dl = False - - def proceed(self, url, location): - postData = {"Submit":"Download+Now",} - dval = re.search(r'name="download" value="(.*?)"/>', self.html).group(1) - if "Sicherheitscode eingeben" in self.html: - # download captcha - - # get captcha code - dval = "captchacode" - - postData["download"] = dval - self.download(url, location, cookies=False, post=postData) - - def download_html(self): - self.url = self.parent.url - self.html = self.load(self.url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - - return re.search(r'method="post" action="(http://.*?\.share-now\.net/download\.php)">', self.html).group(1) - - def get_file_name(self): - if self.html == None: - self.download_html() - - name = re.search(r'<span class="style1">Download -> (.*?)</span>', self.html, re.DOTALL).group(1) - name = "%s" % unescape(name.encode("ascii", "ignore")).decode("utf-8").encode("ascii", "ignore").replace("+", " ") - return name - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - - if re.search(r'name="download" value="(.*?)"/>', self.html) == None: - return False - else: - return True - diff --git a/module/plugins/hoster/XupIn.py b/module/plugins/hoster/XupIn.py deleted file mode 100644 index bf39990f9..000000000 --- a/module/plugins/hoster/XupIn.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.plugins.Hoster import Hoster - -class XupIn(Hoster): - __name__ = "XupIn" - __type__ = "hoster" - __pattern__ = r"http://(?:www.)?xup.in/" - __version__ = "0.1" - __description__ = """Xup.in Download Hoster""" - __author_name__ = ("spoob") - __author_mail__ = ("spoob@pyload.org") - - def __init__(self, parent): - Hoster.__init__(self, parent) - self.parent = parent - self.html = None - self.multi_dl = False - self.posts = {} - self.url = self.parent.url - if "xup.in/pic" in self.parent.url: - self.url = self.parent.url.replace("xup.in/pic", "xup.in/dl") - - def get_file_url(self): - 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) - file_url_pattern = r"<form action=\"(.*)\" method=\"post\">" - return re.search(file_url_pattern, self.html).group(1) - - def get_file_name(self): - file_name_pattern = r"<legend> <b>(.+?)</b> </legend>" - return re.search(file_name_pattern, self.html).group(1) - - def file_exists(self): - self.html = self.load(self.url) - if re.search(r"File does not exist", self.html) != None or self.html == "": - return False - return True - - def proceed(self, url, location): - self.download(url, location, post=self.posts) diff --git a/module/plugins/hoster/YourFilesTo.py b/module/plugins/hoster/YourFilesTo.py deleted file mode 100644 index 04941f759..000000000 --- a/module/plugins/hoster/YourFilesTo.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import urllib -from module.plugins.Hoster import Hoster -from time import time - -class YourfilesTo(Hoster): - __name__ = "YourfilesTo" - __type__ = "hoster" - __pattern__ = r"(http://)?(www\.)?yourfiles\.to/\?d=[a-zA-Z0-9]+" - __version__ = "0.1" - __description__ = """Youfiles.to Download Hoster""" - __author_name__ = ("jeix", "skydancer") - __author_mail__ = ("jeix@hasnomail.de", "skydancer@hasnomail.de") - - def __init__(self, parent): - Hoster.__init__(self, parent) - self.parent = parent - self.html = None - self.multi_dl = False - - - def prepare(self, thread): - self.want_reconnect = False - self.pyfile.status.exists = self.file_exists() - - if not self.pyfile.status.exists: - return False - - self.pyfile.status.filename = self.get_file_name() - - self.get_waiting_time() - self.pyfile.status.waituntil = self.time_plus_wait - self.pyfile.status.url = self.get_file_url() - self.pyfile.status.want_reconnect = self.want_reconnect - thread.wait(self.parent) - - return True - - def get_waiting_time(self): - if self.html == None: - self.download_html() - - #var zzipitime = 15; - m = re.search(r'var zzipitime = (\d+);', self.html) - if m: - sec = int(m.group(1)) - else: - sec = 0 - - self.time_plus_wait = time() + sec - - 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 - """ - url = re.search(r"var bla = '(.*?)';", self.html).group(1) - url = urllib.unquote(url.replace("http://http:/http://", "http://").replace("dumdidum", "")) - return url; - - def get_file_name(self): - if self.html == None: - self.download_html() - - return re.search("<title>(.*)</title>", self.html).group(1) - - 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) - - -
\ No newline at end of file diff --git a/module/plugins/hoster/ZshareNet.py b/module/plugins/hoster/ZshareNet.py deleted file mode 100644 index 2bc75ee4e..000000000 --- a/module/plugins/hoster/ZshareNet.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.plugins.Hoster import Hoster - -class ZshareNet(Hoster): - __name__ = "ZshareNet" - __type__ = "hoster" - __pattern__ = r"http://(?:www.)?zshare.net/" - __version__ = "0.1" - __description__ = """Zshare.net Download Hoster""" - __author_name__ = ("spoob") - __author_mail__ = ("spoob@pyload.org") - - def __init__(self, parent): - Hoster.__init__(self, parent) - 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.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.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("<font color=\"#666666\">(.*)</font></td>", 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/web/pyload/views.py b/module/web/pyload/views.py index 874f25ebf..8c32d36a4 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -351,7 +351,7 @@ def config(request): elif action == "password": for acc in accs[skey]: - if acc["login"] == name and acc["password"] != value: + if acc["login"] == name and value.strip(): settings.PYLOAD.update_account(skey, name, value) elif okey == "newacc" and value: diff --git a/pyLoadCore.py b/pyLoadCore.py index e211c59ca..1c21397e5 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -20,7 +20,7 @@ @author: mkaay @version: v0.4.0 """ -CURRENT_VERSION = '0.4.0b' +CURRENT_VERSION = '0.4.0' from getopt import GetoptError from getopt import getopt @@ -123,7 +123,7 @@ class Core(object): print "<Options>" print " -v, --version", " " * 10, "Print version to terminal" print " -c, --clear", " " * 12, "Delete the saved linklist" - print " -a, --add=<link/list>", " " * 2, "Add the specified links" + #print " -a, --add=<link/list>", " " * 2, "Add the specified links" print " -u, --user", " " * 13, "Set new User and password" print " -d, --debug", " " * 12, "Enable debug mode" print " -s, --setup", " " * 12, "Run Setup Assistent" @@ -477,7 +477,12 @@ class ServerMethods(): def add_package(self, name, links, queue=0): #0 is collector - pid = self.core.files.addPackage(name, name, queue) + if self.core.config['general']['folder_per_package']: + folder = name + else: + folder = "" + + pid = self.core.files.addPackage(name, folder, queue) self.core.files.addLinks(links, pid) |