mirror of
https://github.com/tonikelope/megabasterd.git
synced 2025-04-29 22:24:32 +02:00
6.76
-Optional CUSTOM SMART PROXY LIST -Smart Proxy progress watchdog timeout -> 60 secs
This commit is contained in:
parent
23aa819fcb
commit
12a9b48e49
4
pom.xml
4
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.tonikelope</groupId>
|
||||
<artifactId>MegaBasterd</artifactId>
|
||||
<version>6.75</version>
|
||||
<version>6.76</version>
|
||||
<packaging>jar</packaging>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@ -37,7 +37,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.9.10</version>
|
||||
<version>2.9.10.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
|
@ -46,7 +46,7 @@ import javax.swing.JComponent;
|
||||
public class Download implements Transference, Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
public static final boolean VERIFY_CBC_MAC_DEFAULT = false;
|
||||
public static final int PROGRESS_WATCHDOG_TIMEOUT = 120;
|
||||
public static final int PROGRESS_WATCHDOG_TIMEOUT = 60;
|
||||
public static final boolean USE_SLOTS_DEFAULT = true;
|
||||
public static final int WORKERS_DEFAULT = 6;
|
||||
public static final boolean USE_MEGA_ACCOUNT_DOWN = false;
|
||||
@ -637,7 +637,7 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
|
||||
|
||||
THREAD_POOL.execute(() -> {
|
||||
|
||||
//PROGRESS WATCHDOG If a download (using SmartProxy) remains more than two minutes without advancing 1 byte, we restart it.
|
||||
//PROGRESS WATCHDOG If a download using SmartProxy remains more than 60 seconds without receiving data, we force fatal error in order to restart it.
|
||||
LOG.log(Level.INFO, "{0} PROGRESS WATCHDOG HELLO!", Thread.currentThread().getName());
|
||||
|
||||
long last_progress, progress = getProgress();
|
||||
@ -659,6 +659,7 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
|
||||
|
||||
if (!isExit() && progress <= last_progress) {
|
||||
stopDownloader("PROGRESS WATCHDOG TIMEOUT!");
|
||||
MainPanel.getProxy_manager().refreshProxyList(); //Force SmartProxy proxy list refresh
|
||||
}
|
||||
|
||||
LOG.log(Level.INFO, "{0} PROGRESS WATCHDOG BYE BYE!", Thread.currentThread().getName());
|
||||
|
@ -38,6 +38,7 @@ public class LabelTranslatorSingleton {
|
||||
|
||||
private void Spanish() {
|
||||
|
||||
_addTranslation("Use this proxy list (instead of the one included in MegaBasterd) Format is PROXY:PORT", "Usar esta lista de proxys (en vez de la incluida en MegaBasterd) El formato es PROXY:PUERTO");
|
||||
_addTranslation("Waiting for completion handler ... ***DO NOT EXIT MEGABASTERD NOW***", "Esperando manejador de finalización ... ***NO CIERRES MEGABASTERD EN ESTE MOMENTO***");
|
||||
_addTranslation("Finishing calculating CBC-MAC code (this could take a while) ... ***DO NOT EXIT MEGABASTERD NOW***", "Terminando de calcular código CBC-MAC (esto podría llevar tiempo) ... ***NO CIERRES MEGABASTERD EN ESTE MOMENTO***");
|
||||
_addTranslation("Split content in different uploads", "Separar contenido en diferentes subidas");
|
||||
|
@ -53,7 +53,7 @@ import javax.swing.UIManager;
|
||||
*/
|
||||
public final class MainPanel {
|
||||
|
||||
public static final String VERSION = "6.75";
|
||||
public static final String VERSION = "6.76";
|
||||
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
|
||||
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;
|
||||
public static final int STREAMER_PORT = 1337;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||
<NonVisualComponents>
|
||||
<Component class="javax.swing.JProgressBar" name="jProgressBar1">
|
||||
</Component>
|
||||
@ -151,35 +151,47 @@
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jSeparator10" alignment="0" pref="1683" max="32767" attributes="0"/>
|
||||
<Component id="smart_proxy_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="max_downloads_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="max_downloads_spinner" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="multi_slot_down_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="limit_download_speed_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="rec_smart_proxy_label" alignment="0" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="21" pref="21" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="rec_download_slots_label" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="smart_proxy_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="default_slots_down_label" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="max_downloads_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="default_slots_down_spinner" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="max_downloads_spinner" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="multi_slot_down_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="limit_download_speed_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="21" pref="21" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="rec_download_slots_label" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="default_slots_down_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="default_slots_down_spinner" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="max_down_speed_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="max_down_speed_spinner" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="use_mega_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="use_mega_account_down_combobox" min="-2" pref="700" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="max_down_speed_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="max_down_speed_spinner" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="use_mega_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="use_mega_account_down_combobox" min="-2" pref="700" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="rec_smart_proxy_label" max="32767" attributes="0"/>
|
||||
<Component id="custom_proxy_list_label" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
|
||||
@ -280,6 +292,10 @@
|
||||
<Component id="smart_proxy_checkbox" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="rec_smart_proxy_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="custom_proxy_list_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane1" min="-2" pref="186" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@ -513,6 +529,36 @@
|
||||
</Component>
|
||||
<Component class="javax.swing.JSeparator" name="jSeparator11">
|
||||
</Component>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextArea" name="custom_proxy_textarea">
|
||||
<Properties>
|
||||
<Property name="columns" type="int" value="20"/>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="18" style="0"/>
|
||||
</Property>
|
||||
<Property name="rows" type="int" value="5"/>
|
||||
<Property name="doubleBuffered" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_AddingCodePost" type="java.lang.String" value="custom_proxy_textarea.addMouseListener(new ContextMenuMouseListener());"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JLabel" name="custom_proxy_list_label">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="12" style="0"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Use this proxy list (instead of the one included in MegaBasterd) Format is PROXY:PORT"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
@ -1475,9 +1521,6 @@
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Freeze transferences before start"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="start_frozen_checkboxStateChanged"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSeparator" name="jSeparator15">
|
||||
</Component>
|
||||
|
@ -578,6 +578,10 @@ public class SettingsDialog extends javax.swing.JDialog {
|
||||
this.language_combo.setSelectedItem(LabelTranslatorSingleton.getInstance().translate("Spanish"));
|
||||
}
|
||||
|
||||
String custom_proxy_list = DBTools.selectSettingValue("custom_proxy_list");
|
||||
|
||||
custom_proxy_textarea.setText(custom_proxy_list);
|
||||
|
||||
_remember_master_pass = true;
|
||||
|
||||
_deleted_mega_accounts = new HashSet();
|
||||
@ -634,6 +638,9 @@ public class SettingsDialog extends javax.swing.JDialog {
|
||||
jSeparator9 = new javax.swing.JSeparator();
|
||||
jSeparator10 = new javax.swing.JSeparator();
|
||||
jSeparator11 = new javax.swing.JSeparator();
|
||||
jScrollPane1 = new javax.swing.JScrollPane();
|
||||
custom_proxy_textarea = new javax.swing.JTextArea();
|
||||
custom_proxy_list_label = new javax.swing.JLabel();
|
||||
uploads_scrollpane = new javax.swing.JScrollPane();
|
||||
uploads_panel = new javax.swing.JPanel();
|
||||
default_slots_up_label = new javax.swing.JLabel();
|
||||
@ -825,6 +832,16 @@ public class SettingsDialog extends javax.swing.JDialog {
|
||||
rec_smart_proxy_label.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N
|
||||
rec_smart_proxy_label.setText("Note: enable it in order to mitigate bandwidth limit. (Multi slot required).");
|
||||
|
||||
custom_proxy_textarea.setColumns(20);
|
||||
custom_proxy_textarea.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
|
||||
custom_proxy_textarea.setRows(5);
|
||||
custom_proxy_textarea.setDoubleBuffered(true);
|
||||
jScrollPane1.setViewportView(custom_proxy_textarea);
|
||||
custom_proxy_textarea.addMouseListener(new ContextMenuMouseListener());
|
||||
|
||||
custom_proxy_list_label.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N
|
||||
custom_proxy_list_label.setText("Use this proxy list (instead of the one included in MegaBasterd) Format is PROXY:PORT");
|
||||
|
||||
javax.swing.GroupLayout downloads_panelLayout = new javax.swing.GroupLayout(downloads_panel);
|
||||
downloads_panel.setLayout(downloads_panelLayout);
|
||||
downloads_panelLayout.setHorizontalGroup(
|
||||
@ -846,30 +863,38 @@ public class SettingsDialog extends javax.swing.JDialog {
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, downloads_panelLayout.createSequentialGroup()
|
||||
.addGroup(downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jSeparator10, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 1683, Short.MAX_VALUE)
|
||||
.addComponent(smart_proxy_checkbox, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, downloads_panelLayout.createSequentialGroup()
|
||||
.addComponent(max_downloads_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(max_downloads_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(multi_slot_down_checkbox, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(limit_download_speed_checkbox, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(rec_smart_proxy_label, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, downloads_panelLayout.createSequentialGroup()
|
||||
.addGap(21, 21, 21)
|
||||
.addGroup(downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(rec_download_slots_label)
|
||||
.addGroup(downloads_panelLayout.createSequentialGroup()
|
||||
.addComponent(default_slots_down_label)
|
||||
.addGroup(downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(smart_proxy_checkbox, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, downloads_panelLayout.createSequentialGroup()
|
||||
.addComponent(max_downloads_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(default_slots_down_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(downloads_panelLayout.createSequentialGroup()
|
||||
.addComponent(max_down_speed_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(max_down_speed_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(downloads_panelLayout.createSequentialGroup()
|
||||
.addComponent(use_mega_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(use_mega_account_down_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 700, javax.swing.GroupLayout.PREFERRED_SIZE)))))
|
||||
.addComponent(max_downloads_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(multi_slot_down_checkbox, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(limit_download_speed_checkbox, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, downloads_panelLayout.createSequentialGroup()
|
||||
.addGap(21, 21, 21)
|
||||
.addGroup(downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(rec_download_slots_label)
|
||||
.addGroup(downloads_panelLayout.createSequentialGroup()
|
||||
.addComponent(default_slots_down_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(default_slots_down_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(downloads_panelLayout.createSequentialGroup()
|
||||
.addComponent(max_down_speed_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(max_down_speed_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(downloads_panelLayout.createSequentialGroup()
|
||||
.addComponent(use_mega_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(use_mega_account_down_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 700, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, downloads_panelLayout.createSequentialGroup()
|
||||
.addGap(26, 26, 26)
|
||||
.addGroup(downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(rec_smart_proxy_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(custom_proxy_list_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane1))))
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addGap(12, 12, 12))
|
||||
.addGroup(downloads_panelLayout.createSequentialGroup()
|
||||
.addGroup(downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@ -952,6 +977,10 @@ public class SettingsDialog extends javax.swing.JDialog {
|
||||
.addComponent(smart_proxy_checkbox)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(rec_smart_proxy_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(custom_proxy_list_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@ -1440,11 +1469,6 @@ public class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
start_frozen_checkbox.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
|
||||
start_frozen_checkbox.setText("Freeze transferences before start");
|
||||
start_frozen_checkbox.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
start_frozen_checkboxStateChanged(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout advanced_panelLayout = new javax.swing.GroupLayout(advanced_panel);
|
||||
advanced_panel.setLayout(advanced_panelLayout);
|
||||
@ -1607,6 +1631,7 @@ public class SettingsDialog extends javax.swing.JDialog {
|
||||
settings.put("start_frozen", start_frozen_checkbox.isSelected() ? "yes" : "no");
|
||||
settings.put("use_custom_chunks_dir", custom_chunks_dir_checkbox.isSelected() ? "yes" : "no");
|
||||
settings.put("custom_chunks_dir", _custom_chunks_dir);
|
||||
settings.put("custom_proxy_list", custom_proxy_textarea.getText());
|
||||
|
||||
String old_font = DBTools.selectSettingValue("font");
|
||||
|
||||
@ -2659,10 +2684,14 @@ public class SettingsDialog extends javax.swing.JDialog {
|
||||
rec_smart_proxy_label.setEnabled(true);
|
||||
multi_slot_down_checkbox.setSelected(true);
|
||||
use_proxy_checkbox.setSelected(false);
|
||||
custom_proxy_list_label.setEnabled(true);
|
||||
custom_proxy_textarea.setEnabled(true);
|
||||
|
||||
} else {
|
||||
|
||||
rec_smart_proxy_label.setEnabled(false);
|
||||
custom_proxy_list_label.setEnabled(false);
|
||||
custom_proxy_textarea.setEnabled(false);
|
||||
}
|
||||
}//GEN-LAST:event_smart_proxy_checkboxStateChanged
|
||||
|
||||
@ -2746,10 +2775,6 @@ public class SettingsDialog extends javax.swing.JDialog {
|
||||
}
|
||||
}//GEN-LAST:event_custom_chunks_dir_buttonActionPerformed
|
||||
|
||||
private void start_frozen_checkboxStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_start_frozen_checkboxStateChanged
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_start_frozen_checkboxStateChanged
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JPanel accounts_panel;
|
||||
private javax.swing.JButton add_elc_account_button;
|
||||
@ -2761,6 +2786,8 @@ public class SettingsDialog extends javax.swing.JDialog {
|
||||
private javax.swing.JButton custom_chunks_dir_button;
|
||||
private javax.swing.JCheckBox custom_chunks_dir_checkbox;
|
||||
private javax.swing.JLabel custom_chunks_dir_current_label;
|
||||
private javax.swing.JLabel custom_proxy_list_label;
|
||||
private javax.swing.JTextArea custom_proxy_textarea;
|
||||
private javax.swing.JLabel default_dir_label;
|
||||
private javax.swing.JLabel default_slots_down_label;
|
||||
private javax.swing.JSpinner default_slots_down_spinner;
|
||||
@ -2782,6 +2809,7 @@ public class SettingsDialog extends javax.swing.JDialog {
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JProgressBar jProgressBar1;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JSeparator jSeparator1;
|
||||
private javax.swing.JSeparator jSeparator10;
|
||||
private javax.swing.JSeparator jSeparator11;
|
||||
|
@ -7,6 +7,8 @@ import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
@ -77,7 +79,32 @@ public final class SmartMegaProxyManager {
|
||||
|
||||
try {
|
||||
|
||||
if (this._proxy_list_url != null && this._proxy_list_url.length() > 0) {
|
||||
String custom_proxy_list = DBTools.selectSettingValue("custom_proxy_list");
|
||||
|
||||
ArrayList<String> custom_list = new ArrayList<>(Arrays.asList(custom_proxy_list.split("\\r?\\n")));
|
||||
|
||||
LinkedHashMap<String, Long> custom_clean_list = new LinkedHashMap<>();
|
||||
|
||||
if (!custom_list.isEmpty()) {
|
||||
|
||||
Long current_time = System.currentTimeMillis();
|
||||
|
||||
for (String proxy : custom_list) {
|
||||
|
||||
if (proxy.trim().matches(".+?:[0-9]{1,5}")) {
|
||||
custom_clean_list.put(proxy, current_time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!custom_clean_list.isEmpty()) {
|
||||
|
||||
_proxy_list.clear();
|
||||
|
||||
_proxy_list.putAll(custom_clean_list);
|
||||
}
|
||||
|
||||
if (custom_clean_list.isEmpty() && _proxy_list_url != null && _proxy_list_url.length() > 0) {
|
||||
|
||||
URL url = new URL(this._proxy_list_url);
|
||||
|
||||
@ -121,6 +148,13 @@ public final class SmartMegaProxyManager {
|
||||
_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()});
|
||||
|
||||
} else if (!custom_clean_list.isEmpty()) {
|
||||
swingInvoke(() -> {
|
||||
_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()});
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 195 KiB After Width: | Height: | Size: 192 KiB |
Loading…
x
Reference in New Issue
Block a user