diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-09 23:35:25 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-09 23:35:25 +0200 |
commit | b673872a9360a8f4a58dc1afd19fe0129d82f848 (patch) | |
tree | 9e6fe563f36666c4f15b09f45813730333e2242b | |
parent | Fix https://github.com/pyload/pyload/issues/1406 (diff) | |
parent | [ClickAndLoad] Version up (diff) | |
download | pyload-b673872a9360a8f4a58dc1afd19fe0129d82f848.tar.xz |
Merge branch 'stable' into 0.4.10
Conflicts:
module/plugins/hoster/BillionuploadsCom.py
pyload/plugin/account/ShareonlineBiz.py
pyload/plugin/account/UnrestrictLi.py
pyload/plugin/addon/ClickNLoad.py
pyload/plugin/hook/LinkdecrypterCom.py
pyload/plugin/hook/UnrestrictLi.py
pyload/plugin/hoster/FilefactoryCom.py
pyload/plugin/hoster/UnrestrictLi.py
pyload/plugin/internal/MultiHook.py
pyload/plugin/internal/XFSCrypter.py
-rw-r--r-- | pyload/plugin/account/ShareonlineBiz.py | 4 | ||||
-rw-r--r-- | pyload/plugin/account/UnrestrictLi.py | 44 | ||||
-rw-r--r-- | pyload/plugin/addon/ClickNLoad.py | 22 | ||||
-rw-r--r-- | pyload/plugin/hook/LinkdecrypterCom.py | 12 | ||||
-rw-r--r-- | pyload/plugin/hook/UnrestrictLi.py | 28 | ||||
-rw-r--r-- | pyload/plugin/hoster/BillionuploadsCom.py | 10 | ||||
-rw-r--r-- | pyload/plugin/hoster/FilefactoryCom.py | 4 | ||||
-rw-r--r-- | pyload/plugin/hoster/HostujeNet.py | 14 | ||||
-rw-r--r-- | pyload/plugin/hoster/OpenloadIo.py | 27 | ||||
-rw-r--r-- | pyload/plugin/hoster/SizedriveCom.py | 14 | ||||
-rw-r--r-- | pyload/plugin/hoster/UnrestrictLi.py | 72 | ||||
-rw-r--r-- | pyload/plugin/internal/MultiHook.py | 12 | ||||
-rw-r--r-- | pyload/plugin/internal/XFSCrypter.py | 4 |
13 files changed, 85 insertions, 182 deletions
diff --git a/pyload/plugin/account/ShareonlineBiz.py b/pyload/plugin/account/ShareonlineBiz.py index 06b2818c9..97f45e0ab 100644 --- a/pyload/plugin/account/ShareonlineBiz.py +++ b/pyload/plugin/account/ShareonlineBiz.py @@ -8,7 +8,7 @@ from pyload.plugin.Account import Account class ShareonlineBiz(Account): __name = "ShareonlineBiz" __type = "account" - __version = "0.31" + __version = "0.32" __description = """Share-online.biz account plugin""" __license = "GPLv3" @@ -40,7 +40,7 @@ class ShareonlineBiz(Account): if api['a'].lower() != "not_available": req.cj.setCookie("share-online.biz", 'a', api['a']) - premium = api['group'] in ("Premium", "PrePaid") + premium = api['group'] in ("PrePaid", "Premium", "Penalty-Premium") validuntil = float(api['expire_date']) diff --git a/pyload/plugin/account/UnrestrictLi.py b/pyload/plugin/account/UnrestrictLi.py deleted file mode 100644 index d57b998ca..000000000 --- a/pyload/plugin/account/UnrestrictLi.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugin.Account import Account -from pyload.utils import json_loads - - -class UnrestrictLi(Account): - __name = "UnrestrictLi" - __type = "account" - __version = "0.05" - - __description = """Unrestrict.li account plugin""" - __license = "GPLv3" - __authors = [("stickell", "l.stickell@yahoo.it")] - - - def loadAccountInfo(self, user, req): - json_data = req.load('http://unrestrict.li/api/jdownloader/user.php?format=json') - self.logDebug("JSON data: " + json_data) - json_data = json_loads(json_data) - - if 'vip' in json_data['result'] and json_data['result']['vip'] == 0: - return {"premium": False} - - validuntil = json_data['result']['expires'] - trafficleft = float(json_data['result']['traffic']) - - return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft} - - - def login(self, user, data, req): - req.cj.setCookie("unrestrict.li", "lang", "EN") - html = req.load("https://unrestrict.li/sign_in", decode=True) - - if 'solvemedia' in html: - self.logError(_("A Captcha is required. Go to http://unrestrict.li/sign_in and login, then retry")) - return - - post_data = {"username": user, "password": data['password'], - "remember_me": "remember", "signin": "Sign in"} - html = req.load("https://unrestrict.li/sign_in", post=post_data, decode=True) - - if 'sign_out' not in html: - self.wrongPassword() diff --git a/pyload/plugin/addon/ClickNLoad.py b/pyload/plugin/addon/ClickNLoad.py index 9e62072ba..93c66e302 100644 --- a/pyload/plugin/addon/ClickNLoad.py +++ b/pyload/plugin/addon/ClickNLoad.py @@ -4,6 +4,11 @@ import socket import threading import time +try: + import ssl +except ImportError: + pass + from pyload.plugin.Addon import Addon, threaded @@ -23,7 +28,7 @@ def forward(source, destination): class ClickNLoad(Addon): __name = "ClickNLoad" __type = "addon" - __version = "0.41" + __version = "0.43" __config = [("activated", "bool", "Activated" , True), ("port" , "int" , "Port" , 9666), @@ -71,6 +76,21 @@ class ClickNLoad(Addon): self.logDebug("Connection from %s:%s" % client_addr) server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + + if self.config['webinterface']['https']: + try: + server_socket = ssl.wrap_socket(server_socket) + + except NameError: + self.logError(_("pyLoad's webinterface is configured to use HTTPS, Please install python's ssl lib or disable HTTPS")) + client_socket.close() #: reset the connection. + continue + + except Exception, e: + self.logError(_("SSL error: %s") % e.message) + client_socket.close() #: reset the connection. + continue + server_socket.connect(("127.0.0.1", webport)) self.manager.startThread(forward, client_socket, server_socket) diff --git a/pyload/plugin/hook/LinkdecrypterCom.py b/pyload/plugin/hook/LinkdecrypterCom.py index d3f5c0afc..a4a125236 100644 --- a/pyload/plugin/hook/LinkdecrypterCom.py +++ b/pyload/plugin/hook/LinkdecrypterCom.py @@ -8,7 +8,7 @@ from pyload.plugin.internal.MultiHook import MultiHook class LinkdecrypterCom(MultiHook): __name = "LinkdecrypterCom" __type = "hook" - __version = "1.04" + __version = "1.06" __config = [("activated" , "bool" , "Activated" , True ), ("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), @@ -21,6 +21,12 @@ class LinkdecrypterCom(MultiHook): __authors = [("Walter Purcaro", "vuolter@gmail.com")] - def getCrypters(self): - return re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.\-, ]+)', + def getHosters(self): + list = re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.\-, ]+)', self.getURL("http://linkdecrypter.com/", decode=True).replace("(g)", "")).group(1).split(', ') + try: + list.remove("download.serienjunkies.org") + except ValueError: + pass + + return list diff --git a/pyload/plugin/hook/UnrestrictLi.py b/pyload/plugin/hook/UnrestrictLi.py deleted file mode 100644 index 124a5109a..000000000 --- a/pyload/plugin/hook/UnrestrictLi.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.utils import json_loads -from pyload.plugin.internal.MultiHook import MultiHook - - -class UnrestrictLi(MultiHook): - __name = "UnrestrictLi" - __type = "hook" - __version = "0.05" - - __config = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), - ("pluginlist" , "str" , "Plugin list (comma separated)" , "" ), - ("revertfailed" , "bool" , "Revert to standard download if fails", True ), - ("reload" , "bool" , "Reload plugin list" , True ), - ("reloadinterval", "int" , "Reload interval in hours" , 12 ), - ("history" , "bool" , "Delete History" , False)] - - __description = """Unrestrict.li hook plugin""" - __license = "GPLv3" - __authors = [("stickell", "l.stickell@yahoo.it")] - - - def getHosters(self): - json_data = self.getURL("http://unrestrict.li/api/jdownloader/hosts.php", get={'format': "json"}) - json_data = json_loads(json_data) - - return [element['host'] for element in json_data['result']] diff --git a/pyload/plugin/hoster/BillionuploadsCom.py b/pyload/plugin/hoster/BillionuploadsCom.py index e34584868..bed3a1d54 100644 --- a/pyload/plugin/hoster/BillionuploadsCom.py +++ b/pyload/plugin/hoster/BillionuploadsCom.py @@ -1,19 +1,15 @@ # -*- coding: utf-8 -*- -from pyload.plugin.internal.XFSHoster import XFSHoster +from pyload.plugin.internal.DeadHoster import DeadHoster -class BillionuploadsCom(XFSHoster): +class BillionuploadsCom(DeadHoster): __name = "BillionuploadsCom" __type = "hoster" - __version = "0.04" + __version = "0.06" __pattern = r'http://(?:www\.)?billionuploads\.com/\w{12}' __description = """Billionuploads.com hoster plugin""" __license = "GPLv3" __authors = [("zoidberg", "zoidberg@mujmail.cz")] - - - NAME_PATTERN = r'<td class="dofir" title="(?P<N>.+?)"' - SIZE_PATTERN = r'<td class="dofir">(?P<S>[\d.,]+) (?P<U>[\w^_]+)' diff --git a/pyload/plugin/hoster/FilefactoryCom.py b/pyload/plugin/hoster/FilefactoryCom.py index 5c42961ce..6c4e0b807 100644 --- a/pyload/plugin/hoster/FilefactoryCom.py +++ b/pyload/plugin/hoster/FilefactoryCom.py @@ -20,7 +20,7 @@ def getInfo(urls): class FilefactoryCom(SimpleHoster): __name = "FilefactoryCom" __type = "hoster" - __version = "0.54" + __version = "0.55" __pattern = r'https?://(?:www\.)?filefactory\.com/(file|trafficshare/\w+)/\w+' __config = [("use_premium", "bool", "Use premium account if available", True)] @@ -32,7 +32,7 @@ class FilefactoryCom(SimpleHoster): INFO_PATTERN = r'<div id="file_name"[^>]*>\s*<h2>(?P<N>[^<]+)</h2>\s*<div id="file_info">\s*(?P<S>[\d.,]+) (?P<U>[\w^_]+) uploaded' - OFFLINE_PATTERN = r'<h2>File Removed</h2>|This file is no longer available' + OFFLINE_PATTERN = r'<h2>File Removed</h2>|This file is no longer available|Invalid Download Link' LINK_FREE_PATTERN = LINK_PREMIUM_PATTERN = r'"([^"]+filefactory\.com/get.+?)"' diff --git a/pyload/plugin/hoster/HostujeNet.py b/pyload/plugin/hoster/HostujeNet.py index 0d292958e..ffe9243ef 100644 --- a/pyload/plugin/hoster/HostujeNet.py +++ b/pyload/plugin/hoster/HostujeNet.py @@ -6,15 +6,15 @@ from pyload.plugin.internal.SimpleHoster import SimpleHoster class HostujeNet(SimpleHoster): - __name__ = "HostujeNet" - __type__ = "hoster" - __version__ = "0.01" + __name = "HostujeNet" + __type = "hoster" + __version = "0.01" - __pattern__ = r'http://(?:www\.)?hostuje\.net/\w+' + __pattern = r'http://(?:www\.)?hostuje\.net/\w+' - __description__ = """Hostuje.net hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("GammaC0de", None)] + __description = """Hostuje.net hoster plugin""" + __license = "GPLv3" + __authors = [("GammaC0de", None)] NAME_PATTERN = r'<input type="hidden" name="name" value="(?P<N>.+?)">' diff --git a/pyload/plugin/hoster/OpenloadIo.py b/pyload/plugin/hoster/OpenloadIo.py new file mode 100644 index 000000000..a13015473 --- /dev/null +++ b/pyload/plugin/hoster/OpenloadIo.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- + +from pyload.plugin.internal.SimpleHoster import SimpleHoster + + +class OpenloadIo(SimpleHoster): + __name = "OpenloadIo" + __type = "hoster" + __version = "0.01" + + __pattern = r'https?://(?:www\.)?openload\.io/f/\w{11}' + + __description = """Openload.io hoster plugin""" + __license = "GPLv3" + __authors = [(None, None)] + + + NAME_PATTERN = r'<span id="filename">(?P<N>.+)</' + SIZE_PATTERN = r'<span class="count">(?P<S>[\d.,]+) (?P<U>[\w^_]+)<' + OFFLINE_PATTERN = r">(We can't find the file you are looking for)" + + LINK_FREE_PATTERN = r'id="realdownload"><a href="(https?://[\w\.]+\.openload\.io/dl/.*?)"' + + + def setup(self): + self.multiDL = True + self.chunkLimit = 1 diff --git a/pyload/plugin/hoster/SizedriveCom.py b/pyload/plugin/hoster/SizedriveCom.py index d4e705ae0..ece548921 100644 --- a/pyload/plugin/hoster/SizedriveCom.py +++ b/pyload/plugin/hoster/SizedriveCom.py @@ -6,15 +6,15 @@ from pyload.plugin.internal.SimpleHoster import SimpleHoster class SizedriveCom(SimpleHoster): - __name__ = "SizedriveCom" - __type__ = "hoster" - __version__ = "0.01" + __name = "SizedriveCom" + __type = "hoster" + __version = "0.01" - __pattern__ = r'http://(?:www\.)?sizedrive\.com/[rd]/(?P<ID>\w+)' + __pattern = r'http://(?:www\.)?sizedrive\.com/[rd]/(?P<ID>\w+)' - __description__ = """Sizedrive.com hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("GammaC0de", None)] + __description = """Sizedrive.com hoster plugin""" + __license = "GPLv3" + __authors = [("GammaC0de", None)] NAME_PATTERN = r'>Nome:</b> (?P<N>.+?)<' diff --git a/pyload/plugin/hoster/UnrestrictLi.py b/pyload/plugin/hoster/UnrestrictLi.py index 74dcadb5b..3735de6df 100644 --- a/pyload/plugin/hoster/UnrestrictLi.py +++ b/pyload/plugin/hoster/UnrestrictLi.py @@ -1,81 +1,15 @@ # -*- coding: utf-8 -*- -from pyload.utils import json_loads -from pyload.plugin.internal.MultiHoster import MultiHoster -from pyload.plugin.internal.SimpleHoster import secondsToMidnight +from pyload.plugin.internal.DeadHoster import DeadHoster -class UnrestrictLi(MultiHoster): +class UnrestrictLi(DeadHoster): __name = "UnrestrictLi" __type = "hoster" - __version = "0.22" + __version = "0.23" __pattern = r'https?://(?:www\.)?(unrestrict|unr)\.li/dl/[\w^_]+' - __config = [("use_premium", "bool", "Use premium account if available", True)] __description = """Unrestrict.li multi-hoster plugin""" __license = "GPLv3" __authors = [("stickell", "l.stickell@yahoo.it")] - - - LOGIN_ACCOUNT = False - - - def setup(self): - self.chunkLimit = 16 - self.resumeDownload = True - - - def handle_free(self, pyfile): - for _i in xrange(5): - self.html = self.load('https://unrestrict.li/unrestrict.php', - post={'link': pyfile.url, 'domain': 'long'}) - - self.logDebug("JSON data: " + self.html) - - if self.html: - break - else: - self.logInfo(_("Unable to get API data, waiting 1 minute and retry")) - self.retry(5, 60, "Unable to get API data") - - if 'Expired session' in self.html \ - or ("You are not allowed to download from this host" in self.html and self.premium): - self.account.relogin(self.user) - self.retry() - - elif "File offline" in self.html: - self.offline() - - elif "You are not allowed to download from this host" in self.html: - self.fail(_("You are not allowed to download from this host")) - - elif "You have reached your daily limit for this host" in self.html: - self.logWarning(_("Reached daily limit for this host")) - self.retry(5, secondsToMidnight(gmt=2), "Daily limit for this host reached") - - elif "ERROR_HOSTER_TEMPORARILY_UNAVAILABLE" in self.html: - self.logInfo(_("Hoster temporarily unavailable, waiting 1 minute and retry")) - self.retry(5, 60, "Hoster is temporarily unavailable") - - self.html = json_loads(self.html) - self.link = self.html.keys()[0] - self.api_data = self.html[self.link] - - if hasattr(self, 'api_data'): - self.setNameSize() - - - def checkFile(self, rules={}): - super(UnrestrictLi, self).checkFile(rules) - - if self.getConfig('history'): - self.load("https://unrestrict.li/history/", get={'delete': "all"}) - self.logInfo(_("Download history deleted")) - - - def setNameSize(self): - if 'name' in self.api_data: - self.pyfile.name = self.api_data['name'] - if 'size' in self.api_data: - self.pyfile.size = self.api_data['size'] diff --git a/pyload/plugin/internal/MultiHook.py b/pyload/plugin/internal/MultiHook.py index dc97ffea9..3779377b7 100644 --- a/pyload/plugin/internal/MultiHook.py +++ b/pyload/plugin/internal/MultiHook.py @@ -11,7 +11,7 @@ from pyload.utils import decode, remove_chars class MultiHook(Hook): __name = "MultiHook" __type = "hook" - __version = "0.44" + __version = "0.45" __config = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ("pluginlist" , "str" , "Plugin list (comma separated)", ""), @@ -123,7 +123,7 @@ class MultiHook(Hook): for _i in xrange(2): try: - pluginset = self._pluginSet(self.getHosters() if self.plugintype == "hoster" else self.getCrypters()) + pluginset = self._pluginSet(self.getHosters()) break except Exception, e: @@ -173,14 +173,6 @@ class MultiHook(Hook): raise NotImplementedError - def getCrypters(self): - """Load list of supported crypters - - :return: List of domain names - """ - raise NotImplementedError - - def periodical(self): """reload plugin list periodically""" self.loadAccount() diff --git a/pyload/plugin/internal/XFSCrypter.py b/pyload/plugin/internal/XFSCrypter.py index 85b99712a..e8dfa7e39 100644 --- a/pyload/plugin/internal/XFSCrypter.py +++ b/pyload/plugin/internal/XFSCrypter.py @@ -6,7 +6,7 @@ from pyload.plugin.internal.SimpleCrypter import SimpleCrypter class XFSCrypter(SimpleCrypter): __name = "XFSCrypter" __type = "crypter" - __version = "0.08" + __version = "0.09" __pattern = r'^unmatchable$' @@ -19,7 +19,7 @@ class XFSCrypter(SimpleCrypter): URL_REPLACEMENTS = [(r'&?per_page=\d+', ""), (r'[?/&]+$', ""), (r'(.+/[^?]+)$', r'\1?'), (r'$', r'&per_page=10000')] - LINK_PATTERN = r'<a href="(.+?)".*?>.+?(?:</a>)?\s*(<.+>\s*)?</(?:td|TD)>' + LINK_PATTERN = r'<(?:td|TD).*?>\s*(?:<.+>\s*)?<a href="(.+?)".*?>.+?(?:</a>)?\s*(?:<.+>\s*)?</(?:td|TD)>' NAME_PATTERN = r'<[Tt]itle>.*?\: (?P<N>.+) folder</[Tt]itle>' OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' |