mirror of
https://github.com/tonikelope/megabasterd.git
synced 2025-05-01 15:14:29 +02:00
7.10
- SmartProxy auto refresh -> 15 secs wait - SmartProxy 509 block -> 300 secs
This commit is contained in:
parent
8449dbc1e5
commit
74cdeada79
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.tonikelope</groupId>
|
<groupId>com.tonikelope</groupId>
|
||||||
<artifactId>MegaBasterd</artifactId>
|
<artifactId>MegaBasterd</artifactId>
|
||||||
<version>7.9</version>
|
<version>7.10</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -203,7 +203,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
LOG.log(Level.INFO, "{0} Worker [{1}] SmartProxy getFastestProxy returned NULL! {2}", new Object[]{Thread.currentThread().getName(), _id, _download.getFile_name()});
|
LOG.log(Level.INFO, "{0} Worker [{1}] SmartProxy getProxy returned NULL! {2}", new Object[]{Thread.currentThread().getName(), _id, _download.getFile_name()});
|
||||||
|
|
||||||
URL url = new URL(chunk_url);
|
URL url = new URL(chunk_url);
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ import javax.swing.UIManager;
|
|||||||
*/
|
*/
|
||||||
public final class MainPanel {
|
public final class MainPanel {
|
||||||
|
|
||||||
public static final String VERSION = "7.9";
|
public static final String VERSION = "7.10";
|
||||||
public static final boolean FORCE_SMART_PROXY = false; //TRUE FOR DEBUGING SMART PROXY
|
public static final boolean FORCE_SMART_PROXY = false; //TRUE FOR DEBUGING SMART PROXY
|
||||||
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
|
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
|
||||||
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;
|
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;
|
||||||
@ -347,9 +347,9 @@ public final class MainPanel {
|
|||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
swingInvoke(() -> {
|
|
||||||
getView().updateSmartProxyStatus("SmartProxy: OFF");
|
getView().updateSmartProxyStatus("SmartProxy: OFF");
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
swingInvoke(() -> {
|
swingInvoke(() -> {
|
||||||
|
@ -153,54 +153,55 @@ public final class MainPanelView extends javax.swing.JFrame {
|
|||||||
|
|
||||||
public void updateKissStreamServerStatus(final String status) {
|
public void updateKissStreamServerStatus(final String status) {
|
||||||
|
|
||||||
|
swingInvoke(() -> {
|
||||||
String old_status = getKiss_server_status().getText();
|
String old_status = getKiss_server_status().getText();
|
||||||
|
|
||||||
if (!old_status.equals(status + " ")) {
|
if (!old_status.equals(status + " ")) {
|
||||||
Dimension frame_size = this.getSize();
|
Dimension frame_size = this.getSize();
|
||||||
|
|
||||||
swingInvoke(() -> {
|
|
||||||
getKiss_server_status().setText(status + " ");
|
getKiss_server_status().setText(status + " ");
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
setSize(frame_size);
|
setSize(frame_size);
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void updateSmartProxyStatus(final String status) {
|
public void updateSmartProxyStatus(final String status) {
|
||||||
|
|
||||||
|
swingInvoke(() -> {
|
||||||
String old_status = getSmart_proxy_status().getText();
|
String old_status = getSmart_proxy_status().getText();
|
||||||
|
|
||||||
if (!old_status.equals(status + " ")) {
|
if (!old_status.equals(status + " ")) {
|
||||||
Dimension frame_size = this.getSize();
|
Dimension frame_size = this.getSize();
|
||||||
|
|
||||||
swingInvoke(() -> {
|
|
||||||
getSmart_proxy_status().setText(status + " ");
|
getSmart_proxy_status().setText(status + " ");
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
setSize(frame_size);
|
setSize(frame_size);
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateMCReverseStatus(final String status) {
|
public void updateMCReverseStatus(final String status) {
|
||||||
|
|
||||||
|
swingInvoke(() -> {
|
||||||
|
|
||||||
String old_status = getMc_reverse_status().getText();
|
String old_status = getMc_reverse_status().getText();
|
||||||
|
|
||||||
if (!old_status.equals(status + " ")) {
|
if (!old_status.equals(status + " ")) {
|
||||||
Dimension frame_size = this.getSize();
|
Dimension frame_size = this.getSize();
|
||||||
|
|
||||||
swingInvoke(() -> {
|
|
||||||
getMc_reverse_status().setText(status + " ");
|
getMc_reverse_status().setText(status + " ");
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
setSize(frame_size);
|
setSize(frame_size);
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void _new_upload_dialog(FileGrabberDialog dialog) {
|
private void _new_upload_dialog(FileGrabberDialog dialog) {
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package com.tonikelope.megabasterd;
|
package com.tonikelope.megabasterd;
|
||||||
|
|
||||||
import static com.tonikelope.megabasterd.MiscTools.swingInvoke;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -21,7 +20,8 @@ import java.util.logging.Logger;
|
|||||||
public final class SmartMegaProxyManager {
|
public final class SmartMegaProxyManager {
|
||||||
|
|
||||||
public static String DEFAULT_SMART_PROXY_URL = "https://raw.githubusercontent.com/tonikelope/megabasterd/proxy_list/proxy_list.txt";
|
public static String DEFAULT_SMART_PROXY_URL = "https://raw.githubusercontent.com/tonikelope/megabasterd/proxy_list/proxy_list.txt";
|
||||||
public static final int PROXY_BLOCK_TIME = 180;
|
public static final int PROXY_BLOCK_TIME = 300;
|
||||||
|
public static final int PROXY_AUTO_REFRESH_SLEEP_TIME = 15;
|
||||||
private static final Logger LOG = Logger.getLogger(SmartMegaProxyManager.class.getName());
|
private static final Logger LOG = Logger.getLogger(SmartMegaProxyManager.class.getName());
|
||||||
private volatile String _proxy_list_url;
|
private volatile String _proxy_list_url;
|
||||||
private final LinkedHashMap<String, Long> _proxy_list;
|
private final LinkedHashMap<String, Long> _proxy_list;
|
||||||
@ -56,7 +56,13 @@ public final class SmartMegaProxyManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.log(Level.WARNING, "{0} Smart Proxy Manager: NO PROXYS AVAILABLE!! (Refreshing...)", new Object[]{Thread.currentThread().getName()});
|
LOG.log(Level.WARNING, "{0} Smart Proxy Manager: NO PROXYS AVAILABLE!! (Refreshing in " + String.valueOf(PROXY_AUTO_REFRESH_SLEEP_TIME) + " secs...)", new Object[]{Thread.currentThread().getName()});
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(PROXY_AUTO_REFRESH_SLEEP_TIME * 1000);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
Logger.getLogger(SmartMegaProxyManager.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
|
||||||
refreshProxyList();
|
refreshProxyList();
|
||||||
|
|
||||||
@ -69,7 +75,7 @@ public final class SmartMegaProxyManager {
|
|||||||
|
|
||||||
_proxy_list.put(proxy, System.currentTimeMillis() + PROXY_BLOCK_TIME * 1000);
|
_proxy_list.put(proxy, System.currentTimeMillis() + PROXY_BLOCK_TIME * 1000);
|
||||||
|
|
||||||
LOG.log(Level.WARNING, "{0} Smart Proxy Manager: BLOCKING PROXY -> {1}", new Object[]{Thread.currentThread().getName(), proxy});
|
LOG.log(Level.WARNING, "{0} Smart Proxy Manager: BLOCKING PROXY -> {1} ({2} secs)", new Object[]{Thread.currentThread().getName(), proxy, PROXY_BLOCK_TIME});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,16 +156,13 @@ public final class SmartMegaProxyManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
swingInvoke(() -> {
|
|
||||||
_main_panel.getView().updateSmartProxyStatus("SmartProxy: ON (" + String.valueOf(getProxyCount()) + ")");
|
_main_panel.getView().updateSmartProxyStatus("SmartProxy: ON (" + String.valueOf(getProxyCount()) + ")");
|
||||||
});
|
|
||||||
|
|
||||||
LOG.log(Level.INFO, "{0} Smart Proxy Manager: proxy list refreshed ({1})", new Object[]{Thread.currentThread().getName(), _proxy_list.size()});
|
LOG.log(Level.INFO, "{0} Smart Proxy Manager: proxy list refreshed ({1})", new Object[]{Thread.currentThread().getName(), _proxy_list.size()});
|
||||||
|
|
||||||
} else if (!custom_clean_list.isEmpty()) {
|
} else if (!custom_clean_list.isEmpty()) {
|
||||||
swingInvoke(() -> {
|
|
||||||
_main_panel.getView().updateSmartProxyStatus("SmartProxy: ON (" + String.valueOf(getProxyCount()) + ")*");
|
_main_panel.getView().updateSmartProxyStatus("SmartProxy: ON (" + String.valueOf(getProxyCount()) + ")*");
|
||||||
});
|
|
||||||
|
|
||||||
LOG.log(Level.INFO, "{0} Smart Proxy Manager: proxy list refreshed ({1})", new Object[]{Thread.currentThread().getName(), _proxy_list.size()});
|
LOG.log(Level.INFO, "{0} Smart Proxy Manager: proxy list refreshed ({1})", new Object[]{Thread.currentThread().getName(), _proxy_list.size()});
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 188 KiB |
Loading…
x
Reference in New Issue
Block a user