BCTLSSocketStreamFactory: SSLSocketStreamFactory using BouncyCastle, to support newer SSL stuff for old java 1.6 (eg older mac versions)

OpenInBrowserAction: 
-increased delay to 1 sec
-fixed if statement
IoUa: updated to always use highest quality
WorldBytezCom: accounts dont have traffic limit
UpToStreamCom: updated url regex
BouncyCastle: update to version 153
SecondLevelLaunch: set BCTLSSocketStreamFactory for java < 1.7
build>full

git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@31841 ebf7c1c2-ba36-0410-9fe8-c592906822b4

Former-commit-id: 38a3c14f3dd2869bd4a1d0552f24f3eb9e8caa01
This commit is contained in:
jiaz 2015-10-22 14:36:57 +00:00
parent 0e92797642
commit d35bc09243
14 changed files with 287 additions and 203 deletions

View File

@ -1,109 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="jd/plugins/optional/neembuu/|jd/plugins/optional/remoteserv/|jd/plugins/optional/remoteserv/|org/jdownloader/extensions/langfileeditor/" kind="src" path="src"/>
<classpathentry kind="src" path="src-closed"/>
<classpathentry kind="src" path="translations"/>
<classpathentry kind="src" path="themes"/>
<classpathentry excluding="org/jdownloader/nativeswing/OptionsAndPlaylistExample.java|org/jdownloader/nativeswing/SimpleVLCPlayerExample.java" kind="src" path="tests"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jd/ressourcen/libs/dbus"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/irclib.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/mail.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/debug-1.0.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/jcip-annotations-1.0.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/Filters.jar" sourcepath="ressourcen/code-ressourcen/Filter_src.zip"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/looks.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/synthetica.jar" sourcepath="C:/Users/Thomas/Downloads/synthetica.src.2.zip">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/jd/ressourcen/code-ressourcen/synthetica_docs.zip!/"/>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackStar.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueIce.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueSteel.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaMauveMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaOrangeMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSilverMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSimple2D.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSkyMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaWhiteVision.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/jna.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackEye.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaGreenDream.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/image4j.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/debug-disable.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/hexdump.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/libdbus-java.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/unix.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/fest-assert-1.2.jar" sourcepath="ressourcen/code-ressourcen/fest-assert-1.2-sources.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/fest-reflect-1.2.jar" sourcepath="ressourcen/code-ressourcen/fest-reflect-1.2-sources.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/fest-swing-1.2.jar" sourcepath="ressourcen/code-ressourcen/fest-swing-1.2-sources.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/fest-swing-junit-4.5-1.2.jar" sourcepath="ressourcen/code-ressourcen/fest-swing-junit-4.5-1.2-sources.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/fest-util-1.1.2.jar" sourcepath="ressourcen/code-ressourcen/fest-util-1.1.2-sources.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/junit-4.8.2.jar" sourcepath="ressourcen/code-ressourcen/junit-4.8.2-src.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbinding.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/jpathwatch-0-93-rc1.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/AppleJavaExtensions.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/asc.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/swfutils.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/JDBrowser"/>
<classpathentry combineaccessrules="false" kind="src" path="/AppWorkUtils"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingWin.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/mqtt.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/jackson-core.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/jackson-mapper.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/miglayout.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/bcprov-jdk15on-147.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingLinux.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingMac.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/MyJDownloaderClient"/>
<classpathentry kind="lib" path="ressourcen/libs/jna_platform.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/cling-core.jar" sourcepath="C:/Users/Thomas/Desktop/cling-distribution-2.0.1">
<attributes>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/cling-support.jar">
<attributes>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-http.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-util.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-xml.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/proxyVole.jar" sourcepath="/ProxyVole"/>
<classpathentry kind="lib" path="ressourcen/libs/savemytube.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/htmlunit-core-js.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/js.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaAluOxide.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueLight.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaClassy.jar"/>
<classpathentry kind="var" path="SWT_PLATFORM/swt.jar" sourcepath="/JD_WORKSPACE/dev/libs/SWT/src.zip">
<attributes>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/swt/DJNativeSwing-SWT.jar" sourcepath="dev/libs/DJNativeSwing-SWT-1-0-2/DJNativeSwing-SWT-1-0-2.src.zip">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/JDownloader/dev/libs/DJNativeSwing-SWT-1-0-2/DJNativeSwing-SWT-1-0-2.docs.zip!/api"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/swt/DJNativeSwing.jar" sourcepath="dev/libs/DJNativeSwing-SWT-1-0-2/DJNativeSwing-SWT-1-0-2.src.zip">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/JDownloader/dev/libs/DJNativeSwing-SWT-1-0-2/DJNativeSwing-SWT-1-0-2.docs.zip!/api/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/jsyntaxpane.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sqljet.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sequence-library.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/svnkit.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/antlr-runtime.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaPlain.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="jd/plugins/optional/neembuu/|jd/plugins/optional/remoteserv/|jd/plugins/optional/remoteserv/|org/jdownloader/extensions/langfileeditor/" kind="src" path="src"/>
<classpathentry kind="src" path="src-closed"/>
<classpathentry kind="src" path="translations"/>
<classpathentry kind="src" path="themes"/>
<classpathentry excluding="org/jdownloader/nativeswing/OptionsAndPlaylistExample.java|org/jdownloader/nativeswing/SimpleVLCPlayerExample.java" kind="src" path="tests"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jd/ressourcen/libs/dbus"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/irclib.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/mail.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/debug-1.0.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/jcip-annotations-1.0.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/Filters.jar" sourcepath="ressourcen/code-ressourcen/Filter_src.zip"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/looks.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/synthetica.jar" sourcepath="C:/Users/Thomas/Downloads/synthetica.src.2.zip">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/jd/ressourcen/code-ressourcen/synthetica_docs.zip!/"/>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackStar.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueIce.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueSteel.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaMauveMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaOrangeMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSilverMoon.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSimple2D.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaSkyMetallic.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaWhiteVision.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/jna.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlackEye.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaGreenDream.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/image4j.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/debug-disable.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/hexdump.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/libdbus-java.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/dbus/unix.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/fest-assert-1.2.jar" sourcepath="ressourcen/code-ressourcen/fest-assert-1.2-sources.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/fest-reflect-1.2.jar" sourcepath="ressourcen/code-ressourcen/fest-reflect-1.2-sources.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/fest-swing-1.2.jar" sourcepath="ressourcen/code-ressourcen/fest-swing-1.2-sources.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/fest-swing-junit-4.5-1.2.jar" sourcepath="ressourcen/code-ressourcen/fest-swing-junit-4.5-1.2-sources.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/fest-util-1.1.2.jar" sourcepath="ressourcen/code-ressourcen/fest-util-1.1.2-sources.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/junit-4.8.2.jar" sourcepath="ressourcen/code-ressourcen/junit-4.8.2-src.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbinding.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/jpathwatch-0-93-rc1.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/AppleJavaExtensions.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/asc.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/swfutils.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/JDBrowser"/>
<classpathentry combineaccessrules="false" kind="src" path="/AppWorkUtils"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingWin.jar"/>
<classpathentry kind="lib" path="ressourcen/libs_ext/mqtt.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/jackson-core.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/jackson-mapper.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/miglayout.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingLinux.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sevenzipjbindingMac.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/MyJDownloaderClient"/>
<classpathentry kind="lib" path="ressourcen/libs/jna_platform.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/cling-core.jar" sourcepath="C:/Users/Thomas/Desktop/cling-distribution-2.0.1">
<attributes>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/cling-support.jar">
<attributes>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-http.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-util.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/UPNP/seamless-xml.jar"/>
<classpathentry kind="lib" path="/AppWorkUtils/libs/proxyVole.jar" sourcepath="/ProxyVole"/>
<classpathentry kind="lib" path="ressourcen/libs/savemytube.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/htmlunit-core-js.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/js.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaAluOxide.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaBlueLight.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaClassy.jar"/>
<classpathentry kind="var" path="SWT_PLATFORM/swt.jar" sourcepath="/JD_WORKSPACE/dev/libs/SWT/src.zip">
<attributes>
<attribute name="source_encoding" value="UTF-8"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/swt/DJNativeSwing-SWT.jar" sourcepath="dev/libs/DJNativeSwing-SWT-1-0-2/DJNativeSwing-SWT-1-0-2.src.zip">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/JDownloader/dev/libs/DJNativeSwing-SWT-1-0-2/DJNativeSwing-SWT-1-0-2.docs.zip!/api"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/swt/DJNativeSwing.jar" sourcepath="dev/libs/DJNativeSwing-SWT-1-0-2/DJNativeSwing-SWT-1-0-2.src.zip">
<attributes>
<attribute name="javadoc_location" value="jar:platform:/resource/JDownloader/dev/libs/DJNativeSwing-SWT-1-0-2/DJNativeSwing-SWT-1-0-2.docs.zip!/api/"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="ressourcen/libs/jsyntaxpane.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sqljet.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/sequence-library.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/svnkit.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/antlr-runtime.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/laf/syntheticaPlain.jar"/>
<classpathentry kind="lib" path="ressourcen/libs/bcprov-jdk15on.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

Binary file not shown.

View File

@ -0,0 +1,8 @@
https://www.bouncycastle.org/latest_releases.html, bcprov-jdk15on-153.jar
Copyright (c) 2000 - 2015 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -87,6 +87,7 @@ import org.appwork.utils.StringUtils;
import org.appwork.utils.event.queue.QueueAction;
import org.appwork.utils.logging.Log;
import org.appwork.utils.logging2.LogSource;
import org.appwork.utils.net.httpconnection.HTTPConnectionImpl;
import org.appwork.utils.os.CrossSystem;
import org.appwork.utils.os.CrossSystem.OperatingSystem;
import org.appwork.utils.os.SecuritySoftwareException;
@ -111,6 +112,7 @@ import org.jdownloader.extensions.extraction.ArchiveController;
import org.jdownloader.gui.translate._GUI;
import org.jdownloader.images.NewTheme;
import org.jdownloader.logging.LogController;
import org.jdownloader.net.BCTLSSocketStreamFactory;
import org.jdownloader.osevents.OperatingSystemEventSender;
import org.jdownloader.plugins.controller.host.HostPluginController;
import org.jdownloader.scripting.JSHtmlUnitPermissionRestricter;
@ -755,6 +757,16 @@ public class SecondLevelLaunch {
final Thread thread = new Thread() {
@Override
public void run() {
try {
if (Application.getJavaVersion() < Application.JAVA17) {
HTTPConnectionImpl.setDefaultSSLSocketStreamFactory(new BCTLSSocketStreamFactory());
SecondLevelLaunch.LOG.info("Use BouncyCastle for default SSLSocketStreamFactory!");
} else {
SecondLevelLaunch.LOG.info("Use JSSE for default SSLSocketStreamFactory!");
}
} catch (final Throwable e) {
SecondLevelLaunch.LOG.log(e);
}
try {
CFG_GENERAL.BROWSER_COMMAND_LINE.getEventSender().addListener(new GenericConfigEventListener<String[]>() {

View File

@ -33,7 +33,7 @@ import jd.plugins.FilePackage;
import jd.plugins.PluginForDecrypt;
import jd.utils.JDUtilities;
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 3, names = { "uptostream.com" }, urls = { "https?://(?:www\\.)?uptostream\\.com/[a-z0-9]{12}" }, flags = { 0 })
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 3, names = { "uptostream.com" }, urls = { "https?://(?:www\\.)?uptostream\\.com/(iframe/)?[a-z0-9]{12}" }, flags = { 0 })
public class UpToStreamCom extends PluginForDecrypt {
@SuppressWarnings("deprecation")

View File

@ -17,6 +17,7 @@ import jd.http.SocketConnectionFactory;
import org.appwork.utils.StringUtils;
import org.appwork.utils.logging2.LogSource;
import org.appwork.utils.net.httpconnection.HTTPProxy;
import org.appwork.utils.net.httpconnection.JavaSSLSocketStreamFactory;
import org.appwork.utils.net.socketconnection.SocketConnection;
import org.jdownloader.logging.LogController;
@ -126,7 +127,7 @@ public class SimpleUseNet {
}
protected SSLSocketFactory getSSLSocketFactory() throws IOException {
return SocketConnection.getSSLSocketFactory(true);
return JavaSSLSocketStreamFactory.getSSLSocketFactory(true);
}
protected boolean useSNIWorkaround() {

View File

@ -31,7 +31,7 @@ import jd.plugins.LinkStatus;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
@HostPlugin(revision = "$Revision$", interfaceVersion = 3, names = { "io.ua" }, urls = { "https?://(?:www\\.)?io\\.ua/\\d+p" }, flags = { 0 })
@HostPlugin(revision = "$Revision$", interfaceVersion = 3, names = { "io.ua" }, urls = { "https?://(?:www\\.)?io\\.ua/\\d+" }, flags = { 0 })
public class IoUa extends PluginForHost {
public IoUa(PluginWrapper wrapper) {
@ -63,64 +63,70 @@ public class IoUa extends PluginForHost {
DLLINK = null;
this.setBrowserExclusive();
br.setFollowRedirects(true);
final Regex urlregex = new Regex(downloadLink.getDownloadURL(), "(\\d+)p$");
String filename = null;
/* Better filenames even for offline urls */
downloadLink.setName(filename);
final String imageID = new Regex(downloadLink.getDownloadURL(), "/(\\d+)").getMatch(0);
br.getPage(downloadLink.getDownloadURL().replace("https://", "http://"));
if (br.getHttpConnection().getResponseCode() == 404) {
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
// DLLINK = br.getRegex("id=\\'mainfoto\\' src=\\'(http://[^<>\"]*?)\\'").getMatch(0);
if (DLLINK == null) {
DLLINK = br.getRegex("\\'http://m\\.io\\.ua/img_aa/medium/([^<>\"]*?)\\'").getMatch(0);
if (br.containsHTML("'/" + imageID + "u'")) {
br.getPage("http://io.ua/" + imageID + "u");
}
filename = this.br.getRegex("class=\\'shadow_big\\' alt=\\'([^<>\"\\']*?)\\'").getMatch(0);
String imageURL = br.getRegex("'(https?://\\w+\\.io\\.ua/img_aa/full/.*?)'").getMatch(0);
if (imageURL == null) {
imageURL = br.getRegex("'(https?://\\w+\\.io\\.ua/img_aa/large/.*?)'").getMatch(0);
if (imageURL == null) {
imageURL = br.getRegex("'(https?://\\w+\\.io\\.ua/img_aa/medium/.*?)'").getMatch(0);
}
}
String filename = this.br.getRegex("class=\\'shadow_big\\' alt=\\'([^<>\"\\']*?)\\'").getMatch(0);
if (filename == null) {
filename = urlregex.getMatch(0);
filename = imageID;
} else {
filename = filename + "_" + imageID;
}
if (filename == null || DLLINK == null) {
if (filename == null || imageURL == null) {
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
DLLINK = Encoding.htmlDecode(DLLINK);
/* Prefer fullsize */
DLLINK = "http://f.io.ua/img_aa/full/" + DLLINK;
DLLINK = DLLINK.replace(".jpg", "_f.jpg");
filename = Encoding.htmlDecode(filename);
filename = filename.trim();
filename = encodeUnicode(filename);
String ext = DLLINK.substring(DLLINK.lastIndexOf("."));
/* Make sure that we get a correct extension */
if (ext == null || !ext.matches("\\.[A-Za-z0-9]{3,5}")) {
ext = default_Extension;
DLLINK = imageURL;
if (downloadLink.getFinalFileName() == null) {
filename = Encoding.htmlDecode(filename);
filename = filename.trim();
filename = encodeUnicode(filename);
String ext = DLLINK.substring(DLLINK.lastIndexOf("."));
/* Make sure that we get a correct extension */
if (ext == null || !ext.matches("\\.[A-Za-z0-9]{3,5}")) {
ext = default_Extension;
}
if (!filename.endsWith(ext)) {
filename += ext;
}
downloadLink.setFinalFileName(filename);
}
if (!filename.endsWith(ext)) {
filename += ext;
}
downloadLink.setFinalFileName(filename);
final Browser br2 = br.cloneBrowser();
// In case the link redirects to the finallink
br2.setFollowRedirects(true);
URLConnectionAdapter con = null;
try {
if (downloadLink.getKnownDownloadSize() == -1) {
final Browser br2 = br.cloneBrowser();
// In case the link redirects to the finallink
br2.setFollowRedirects(true);
URLConnectionAdapter con = null;
try {
con = br2.openHeadConnection(DLLINK);
} catch (final BrowserException e) {
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
if (!con.getContentType().contains("html")) {
downloadLink.setDownloadSize(con.getLongContentLength());
} else {
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
downloadLink.setProperty("directlink", DLLINK);
return AvailableStatus.TRUE;
} finally {
try {
con.disconnect();
} catch (final Throwable e) {
try {
con = br2.openHeadConnection(DLLINK);
} catch (final BrowserException e) {
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
if (!con.getContentType().contains("html")) {
downloadLink.setDownloadSize(con.getLongContentLength());
} else {
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
return AvailableStatus.TRUE;
} finally {
try {
con.disconnect();
} catch (final Throwable e) {
}
}
}
return AvailableStatus.TRUE;
}
@Override
@ -128,16 +134,12 @@ public class IoUa extends PluginForHost {
requestFileInformation(downloadLink);
dl = jd.plugins.BrowserAdapter.openDownload(br, downloadLink, DLLINK, free_resume, free_maxchunks);
if (dl.getConnection().getContentType().contains("html")) {
br.followConnection();
if (dl.getConnection().getResponseCode() == 403) {
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error 403", 60 * 60 * 1000l);
} else if (dl.getConnection().getResponseCode() == 404) {
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error 404", 60 * 60 * 1000l);
}
br.followConnection();
try {
dl.getConnection().disconnect();
} catch (final Throwable e) {
}
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
dl.startDownload();

View File

@ -29,12 +29,6 @@ import java.util.Random;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import org.appwork.utils.StringUtils;
import org.appwork.utils.formatter.SizeFormatter;
import org.appwork.utils.formatter.TimeFormatter;
import org.appwork.utils.os.CrossSystem;
import org.jdownloader.captcha.v2.challenge.recaptcha.v2.CaptchaHelperHostPluginRecaptchaV2;
import jd.PluginWrapper;
import jd.config.ConfigContainer;
import jd.config.ConfigEntry;
@ -57,6 +51,12 @@ import jd.plugins.PluginForHost;
import jd.utils.JDUtilities;
import jd.utils.locale.JDL;
import org.appwork.utils.StringUtils;
import org.appwork.utils.formatter.SizeFormatter;
import org.appwork.utils.formatter.TimeFormatter;
import org.appwork.utils.os.CrossSystem;
import org.jdownloader.captcha.v2.challenge.recaptcha.v2.CaptchaHelperHostPluginRecaptchaV2;
@HostPlugin(revision = "$Revision$", interfaceVersion = 3, names = { "nitroflare.com" }, urls = { "https?://(www\\.)?nitroflare\\.com/(?:view|watch)/[A-Z0-9]+" }, flags = { 2 })
public class NitroFlareCom extends antiDDoSForHost {

View File

@ -45,7 +45,6 @@ import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.Plugin;
import jd.plugins.PluginException;
import jd.plugins.PluginForDecrypt;
import jd.plugins.PluginForHost;
import jd.plugins.components.SiteType.SiteTemplate;
import jd.utils.JDUtilities;
@ -54,7 +53,6 @@ import jd.utils.locale.JDL;
import org.appwork.utils.formatter.SizeFormatter;
import org.appwork.utils.formatter.TimeFormatter;
import org.jdownloader.captcha.v2.challenge.keycaptcha.KeyCaptcha;
import org.jdownloader.captcha.v2.challenge.solvemedia.SolveMedia;
@HostPlugin(revision = "$Revision$", interfaceVersion = 2, names = { "worldbytez.com" }, urls = { "https?://(www\\.)?worldbytez\\.com/(vidembed\\-)?[a-z0-9]{12}" }, flags = { 2 })
public class WorldBytezCom extends PluginForHost {
@ -358,7 +356,7 @@ public class WorldBytezCom extends PluginForHost {
skipWaittime = true;
} else if (br.containsHTML("solvemedia\\.com/papi/")) {
logger.info("Detected captcha method \"solvemedia\" for this host");
final org.jdownloader.captcha.v2.challenge.solvemedia.SolveMedia sm = new org.jdownloader.captcha.v2.challenge.solvemedia.SolveMedia(br);
File cf = null;
try {
@ -375,7 +373,7 @@ public class WorldBytezCom extends PluginForHost {
dlForm.put("adcopy_response", "manual_challenge");
} else if (br.containsHTML("id=\"capcode\" name= \"capcode\"")) {
logger.info("Detected captcha method \"keycaptca\"");
String result = handleCaptchaChallenge(getDownloadLink(),new KeyCaptcha(this, br, getDownloadLink()).createChallenge(this));
String result = handleCaptchaChallenge(getDownloadLink(), new KeyCaptcha(this, br, getDownloadLink()).createChallenge(this));
if (result == null) {
throw new PluginException(LinkStatus.ERROR_CAPTCHA);
}
@ -845,21 +843,9 @@ public class WorldBytezCom extends PluginForHost {
ai.setUsedSpace(space[0] + "Mb");
}
account.setValid(true);
String availabletraffic = new Regex(correctedBR, "glyphicon-signal\"></span>([^<>\"\\']+)</div>").getMatch(0);
if (availabletraffic == null) {
availabletraffic = new Regex(correctedBR, ">\\s*Traffic available today:\\s*(?:<[^>]+>)*(-?[0-9\\.]+\\s*(KB|MB|GB|TB)?|Unlimited)\\s*<").getMatch(0);
}
if (availabletraffic != null && !availabletraffic.contains("nlimited") && !availabletraffic.equalsIgnoreCase(" Mb")) {
availabletraffic.trim();
// need to set 0 traffic left, as getSize returns positive result, even when negative value supplied.
if (!availabletraffic.startsWith("-")) {
ai.setTrafficLeft(SizeFormatter.getSize(availabletraffic));
} else {
ai.setTrafficLeft(0);
}
} else {
ai.setUnlimitedTraffic();
}
ai.setUnlimitedTraffic();
// If the account is expired we'll accept it as a free account
final String expire = new Regex(correctedBR, "(\\d{1,2} (January|February|March|April|May|June|July|August|September|October|November|December) \\d{4})").getMatch(0);
long expiretime = 0;
@ -1029,9 +1015,9 @@ public class WorldBytezCom extends PluginForHost {
public void resetDownloadlink(DownloadLink link) {
}
@Override
public SiteTemplate siteTemplateType() {
return SiteTemplate.SibSoft_XFileShare;
}
@Override
public SiteTemplate siteTemplateType() {
return SiteTemplate.SibSoft_XFileShare;
}
}

View File

@ -60,11 +60,11 @@ public class OpenInBrowserAction extends CustomizableTableContextAppAction<FileP
}
final SelectionInfo<FilePackage, DownloadLink> selection = getSelection();
if (hasSelection(selection)) {
final List<DownloadLink> links = selection.getChildren();
new Thread("OpenInBrowserAction") {
public void run() {
final List<DownloadLink> links = selection.getChildren();
final HashSet<String> urls = LinkTreeUtils.getURLs(links, true);
if (links.size() < 5) {
if (urls.size() < 5) {
for (String url : urls) {
CrossSystem.openURLOrShowMessage(url);
}
@ -81,8 +81,7 @@ public class OpenInBrowserAction extends CustomizableTableContextAppAction<FileP
for (String url : urls) {
CrossSystem.openURLOrShowMessage(url);
current++;
Thread.sleep(500);
Thread.sleep(1000);
}
}
@ -96,8 +95,7 @@ public class OpenInBrowserAction extends CustomizableTableContextAppAction<FileP
if (total == 0) {
return -1;
}
int ret = (current * 100) / total;
final int ret = (current * 100) / total;
return ret;
}

View File

@ -69,7 +69,7 @@ public class OpenInBrowserAction extends CustomizableTableContextAppAction<Crawl
new Thread("OpenInBrowserAction") {
public void run() {
final HashSet<String> urls = LinkTreeUtils.getURLs(links, true);
if (links.size() < 5) {
if (urls.size() < 5) {
for (String url : urls) {
CrossSystem.openURLOrShowMessage(url);
}
@ -86,8 +86,7 @@ public class OpenInBrowserAction extends CustomizableTableContextAppAction<Crawl
for (String url : urls) {
CrossSystem.openURLOrShowMessage(url);
current++;
Thread.sleep(500);
Thread.sleep(1000);
}
}
@ -101,8 +100,7 @@ public class OpenInBrowserAction extends CustomizableTableContextAppAction<Crawl
if (total == 0) {
return -1;
}
int ret = (current * 100) / total;
final int ret = (current * 100) / total;
return ret;
}

View File

@ -0,0 +1,79 @@
/**
* Copyright (c) 2009 - 2015 AppWork UG(haftungsbeschränkt) <e-mail@appwork.org>
*
* This file is part of org.appwork.utils.net.httpconnection
*
* This software is licensed under the Artistic License 2.0,
* see the LICENSE file or http://www.opensource.org/licenses/artistic-license-2.0.php
* for details
*/
package org.jdownloader.net;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import org.appwork.utils.net.httpconnection.SSLSocketStreamFactory;
import org.appwork.utils.net.httpconnection.SocketStreamInterface;
import org.bouncycastle.crypto.tls.CertificateRequest;
import org.bouncycastle.crypto.tls.DefaultTlsClient;
import org.bouncycastle.crypto.tls.TlsAuthentication;
import org.bouncycastle.crypto.tls.TlsClientProtocol;
import org.bouncycastle.crypto.tls.TlsCredentials;
/**
* @author daniel
*
*/
public class BCTLSSocketStreamFactory implements SSLSocketStreamFactory {
@Override
public SocketStreamInterface create(final SocketStreamInterface socketStream, String host, int port, boolean autoclose, boolean trustAll) throws IOException {
java.security.SecureRandom secureRandom = new java.security.SecureRandom();
final TlsClientProtocol protocol = new TlsClientProtocol(socketStream.getInputStream(), socketStream.getOutputStream(), secureRandom);
final DefaultTlsClient client = new DefaultTlsClient() {
public TlsAuthentication getAuthentication() throws IOException {
TlsAuthentication auth = new TlsAuthentication() {
// Capture the server certificate information!
public void notifyServerCertificate(org.bouncycastle.crypto.tls.Certificate serverCertificate) throws IOException {
}
public TlsCredentials getClientCredentials(CertificateRequest certificateRequest) throws IOException {
return null;
}
};
return auth;
}
};
protocol.connect(client);
return new SocketStreamInterface() {
@Override
public Socket getSocket() {
return socketStream.getSocket();
}
@Override
public OutputStream getOutputStream() throws IOException {
return protocol.getOutputStream();
}
@Override
public InputStream getInputStream() throws IOException {
return protocol.getInputStream();
}
@Override
public void close() throws IOException {
try {
protocol.close();
} finally {
socketStream.getSocket().close();
}
}
};
}
}

View File

@ -418,7 +418,7 @@ public class PluginClassLoader extends URLClassLoader {
private static final HashMap<String, String> DYNAMIC_LOADABLE_LOBRARIES = new HashMap<String, String>();
static {
synchronized (DYNAMIC_LOADABLE_LOBRARIES) {
DYNAMIC_LOADABLE_LOBRARIES.put("org.bouncycastle", "bcprov-jdk15on-147.jar");
DYNAMIC_LOADABLE_LOBRARIES.put("org.bouncycastle", "bcprov-jdk15on.jar");
}
}