mirror of
https://github.com/mirror/jdownloader.git
synced 2025-02-17 02:37:56 +00:00
Plugin:
-updated getNewPluginForDecryptInstance to forward LinkCrawler/LinkCrawlerGeneration to new plugin instance git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@49749 ebf7c1c2-ba36-0410-9fe8-c592906822b4 Former-commit-id: f9c81aeb078c926c72bbd90268a3fd211d4c4f9e
This commit is contained in:
parent
7c4450079e
commit
cf07fe2b49
@ -37,6 +37,33 @@ import java.util.regex.Pattern;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import jd.PluginWrapper;
|
||||
import jd.config.ConfigContainer;
|
||||
import jd.config.SubConfiguration;
|
||||
import jd.controlling.accountchecker.AccountChecker.AccountCheckJob;
|
||||
import jd.controlling.accountchecker.AccountCheckerThread;
|
||||
import jd.controlling.downloadcontroller.SingleDownloadController;
|
||||
import jd.controlling.linkchecker.LinkCheckerThread;
|
||||
import jd.controlling.linkcrawler.CrawledLink;
|
||||
import jd.controlling.linkcrawler.LinkCrawler;
|
||||
import jd.controlling.linkcrawler.LinkCrawler.LinkCrawlerGeneration;
|
||||
import jd.controlling.linkcrawler.LinkCrawlerDeepInspector;
|
||||
import jd.controlling.linkcrawler.LinkCrawlerThread;
|
||||
import jd.controlling.reconnect.ipcheck.BalancedWebIPCheck;
|
||||
import jd.controlling.reconnect.ipcheck.IPCheckException;
|
||||
import jd.controlling.reconnect.ipcheck.OfflineException;
|
||||
import jd.http.Browser;
|
||||
import jd.http.Browser.BrowserException;
|
||||
import jd.http.BrowserSettingsThread;
|
||||
import jd.http.ProxySelectorInterface;
|
||||
import jd.http.StaticProxySelector;
|
||||
import jd.http.URLConnectionAdapter;
|
||||
import jd.nutils.SimpleFTP.ENCODING;
|
||||
import jd.nutils.encoding.Encoding;
|
||||
import jd.plugins.PluginForHost.FILENAME_SOURCE;
|
||||
import jd.plugins.components.SiteType.SiteTemplate;
|
||||
import jd.utils.JDUtilities;
|
||||
|
||||
import org.appwork.exceptions.WTFException;
|
||||
import org.appwork.net.protocol.http.HTTPConstants;
|
||||
import org.appwork.storage.JSonMapperException;
|
||||
@ -87,33 +114,6 @@ import org.jdownloader.plugins.controller.host.PluginFinder;
|
||||
import org.jdownloader.settings.staticreferences.CFG_CAPTCHA;
|
||||
import org.jdownloader.translate._JDT;
|
||||
|
||||
import jd.PluginWrapper;
|
||||
import jd.config.ConfigContainer;
|
||||
import jd.config.SubConfiguration;
|
||||
import jd.controlling.accountchecker.AccountChecker.AccountCheckJob;
|
||||
import jd.controlling.accountchecker.AccountCheckerThread;
|
||||
import jd.controlling.downloadcontroller.SingleDownloadController;
|
||||
import jd.controlling.linkchecker.LinkCheckerThread;
|
||||
import jd.controlling.linkcrawler.CrawledLink;
|
||||
import jd.controlling.linkcrawler.LinkCrawler;
|
||||
import jd.controlling.linkcrawler.LinkCrawler.LinkCrawlerGeneration;
|
||||
import jd.controlling.linkcrawler.LinkCrawlerDeepInspector;
|
||||
import jd.controlling.linkcrawler.LinkCrawlerThread;
|
||||
import jd.controlling.reconnect.ipcheck.BalancedWebIPCheck;
|
||||
import jd.controlling.reconnect.ipcheck.IPCheckException;
|
||||
import jd.controlling.reconnect.ipcheck.OfflineException;
|
||||
import jd.http.Browser;
|
||||
import jd.http.Browser.BrowserException;
|
||||
import jd.http.BrowserSettingsThread;
|
||||
import jd.http.ProxySelectorInterface;
|
||||
import jd.http.StaticProxySelector;
|
||||
import jd.http.URLConnectionAdapter;
|
||||
import jd.nutils.SimpleFTP.ENCODING;
|
||||
import jd.nutils.encoding.Encoding;
|
||||
import jd.plugins.PluginForHost.FILENAME_SOURCE;
|
||||
import jd.plugins.components.SiteType.SiteTemplate;
|
||||
import jd.utils.JDUtilities;
|
||||
|
||||
/**
|
||||
* Diese abstrakte Klasse steuert den Zugriff auf weitere Plugins. Alle Plugins müssen von dieser Klasse abgeleitet werden.
|
||||
*
|
||||
@ -574,7 +574,7 @@ public abstract class Plugin implements ActionListener {
|
||||
return filenameWithoutExtension + newExtension;
|
||||
} else {
|
||||
return filenameOrg;
|
||||
}
|
||||
}f
|
||||
}
|
||||
|
||||
protected boolean allowFileNameExtension(String filenameOrg, CompiledFiletypeExtension filetypeOld, CompiledFiletypeExtension filetypeNew) {
|
||||
@ -594,7 +594,7 @@ public abstract class Plugin implements ActionListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds extension to given filename if given filename does not already end with new extension. </br>
|
||||
* Adds extension to given filename if given filename does not already end with new extension. <br>
|
||||
* Do not use this to replace a file extension with another one if you clearly know what to replace with what because this will auto
|
||||
* decide whether to replace or append the new extension!
|
||||
*/
|
||||
@ -1137,7 +1137,19 @@ public abstract class Plugin implements ActionListener {
|
||||
protected PluginForDecrypt getNewPluginForDecryptInstance(final String host) throws PluginException {
|
||||
final LazyCrawlerPlugin lazyCrawlerPlugin = CrawlerPluginController.getInstance().get(host);
|
||||
if (lazyCrawlerPlugin != null) {
|
||||
return getNewPluginInstance(lazyCrawlerPlugin);
|
||||
final PluginForDecrypt ret = getNewPluginInstance(lazyCrawlerPlugin);
|
||||
if (this instanceof PluginForDecrypt) {
|
||||
ret.setCrawler(((PluginForDecrypt) this).getCrawler());
|
||||
ret.setLinkCrawlerGeneration(((PluginForDecrypt) this).getLinkCrawlerGeneration());
|
||||
} else if (Thread.currentThread() instanceof LinkCrawlerThread) {
|
||||
final LinkCrawlerThread lct = ((LinkCrawlerThread) Thread.currentThread());
|
||||
ret.setCrawler(lct.getCurrentLinkCrawler());
|
||||
ret.setLinkCrawlerGeneration(lct.getLinkCrawlerGeneration());
|
||||
}
|
||||
if (ret.getCrawler() == null) {
|
||||
ret.setCrawler(new LinkCrawler(false, true));
|
||||
}
|
||||
return ret;
|
||||
} else {
|
||||
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT, "Could not find PluginForDecrypt:" + host);
|
||||
}
|
||||
@ -1254,9 +1266,9 @@ public abstract class Plugin implements ActionListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a BubbleNotification. </br>
|
||||
* Plugins which are expected to use this function should return LazyPlugin.FEATURE of type BUBBLE_NOTIFICATION. </br>
|
||||
* Any plugin can try to display a BubbleNotification but upper handling may decide not to display it depending on user settings. </br>
|
||||
* Displays a BubbleNotification. <br>
|
||||
* Plugins which are expected to use this function should return LazyPlugin.FEATURE of type BUBBLE_NOTIFICATION. <br>
|
||||
* Any plugin can try to display a BubbleNotification but upper handling may decide not to display it depending on user settings. <br>
|
||||
* Examples of Plugins using this functionality: RedditComCrawler, TwitterComCrawler, HighWayCore
|
||||
*/
|
||||
protected void displayBubbleNotification(final String title, final String text, final Icon icon) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user