mirror of
https://github.com/tonikelope/megabasterd.git
synced 2025-04-29 22:24:32 +02:00
7.48
Fix https://github.com/tonikelope/megabasterd/issues/367 https://github.com/tonikelope/megabasterd/issues/368
This commit is contained in:
parent
a1ea38cb82
commit
717b473f9e
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.tonikelope</groupId>
|
||||
<artifactId>MegaBasterd</artifactId>
|
||||
<version>7.47</version>
|
||||
<version>7.48</version>
|
||||
<packaging>jar</packaging>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -101,6 +101,10 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
|
||||
private final Object _progress_watchdog_lock;
|
||||
private final boolean _priority;
|
||||
|
||||
public String getStatus_error() {
|
||||
return _status_error;
|
||||
}
|
||||
|
||||
public Download(MainPanel main_panel, MegaAPI ma, String url, String download_path, String file_name, String file_key, Long file_size, String file_pass, String file_noexpire, boolean use_slots, boolean restart, String custom_chunks_dir, boolean priority) {
|
||||
|
||||
_priority = priority;
|
||||
|
@ -21,6 +21,74 @@ public class DownloadManager extends TransferenceManager {
|
||||
super(main_panel, main_panel.getMax_dl(), main_panel.getView().getStatus_down_label(), main_panel.getView().getjPanel_scroll_down(), main_panel.getView().getClose_all_finished_down_button(), main_panel.getView().getPause_all_down_button(), main_panel.getView().getClean_all_down_menu());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeAllFinished() {
|
||||
|
||||
_transference_finished_queue.stream().filter((t) -> ((!t.isStatusError() || ((Download) t).getStatus_error().equals("FILE WITH SAME NAME AND SIZE ALREADY EXISTS")) && !t.isCanceled())).map((t) -> {
|
||||
_transference_finished_queue.remove(t);
|
||||
return t;
|
||||
}).forEachOrdered((t) -> {
|
||||
_transference_remove_queue.add(t);
|
||||
});
|
||||
|
||||
secureNotify();
|
||||
}
|
||||
|
||||
public void copyAllLinksToClipboard() {
|
||||
|
||||
ArrayList<String> links = new ArrayList<>();
|
||||
|
||||
String out = "***PROVISIONING DOWNLOADS***\r\n\r\n";
|
||||
|
||||
for (Transference t : _transference_provision_queue) {
|
||||
|
||||
links.add(((Download) t).getUrl());
|
||||
}
|
||||
|
||||
out += String.join("\r\n", links);
|
||||
|
||||
links.clear();
|
||||
|
||||
out += "\r\n\r\n***WAITING DOWNLOADS***\r\n\r\n";
|
||||
|
||||
for (Transference t : _transference_waitstart_aux_queue) {
|
||||
|
||||
links.add(((Download) t).getUrl());
|
||||
}
|
||||
|
||||
for (Transference t : _transference_waitstart_queue) {
|
||||
|
||||
links.add(((Download) t).getUrl());
|
||||
}
|
||||
|
||||
out += String.join("\r\n", links);
|
||||
|
||||
links.clear();
|
||||
|
||||
out += "\r\n\r\n***RUNNING DOWNLOADS***\r\n\r\n";
|
||||
|
||||
for (Transference t : _transference_running_list) {
|
||||
|
||||
links.add(((Download) t).getUrl());
|
||||
}
|
||||
|
||||
out += String.join("\r\n", links);
|
||||
|
||||
links.clear();
|
||||
|
||||
out += "\r\n\r\n***FINISHED DOWNLOADS***\r\n\r\n";
|
||||
|
||||
for (Transference t : _transference_finished_queue) {
|
||||
|
||||
links.add(((Download) t).getUrl());
|
||||
}
|
||||
|
||||
out += String.join("\r\n", links);
|
||||
|
||||
MiscTools.copyTextToClipboard(out);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(Transference[] downloads) {
|
||||
|
||||
|
@ -38,6 +38,7 @@ public class LabelTranslatorSingleton {
|
||||
|
||||
private void Spanish() {
|
||||
|
||||
_addTranslation("¡TODO COPIADO!", "ALL COPIED!");
|
||||
_addTranslation("FILE WITH SAME NAME AND SIZE ALREADY EXISTS", "YA EXISTE UN FICHERO CON EL MISMO NOMBRE Y TAMAÑO");
|
||||
_addTranslation("WARNING: USING MEGA API WITHOUT API KEY MAY VIOLATE ITS TERM OF USE. YOU SHOULD GET A KEY -> https://mega.nz/sdk", "AVISO: USAR LA API DE MEGA SIN UNA API KEY PUEDE VIOLAR SUS TÉRMINOS DE USO. DEBES CONSEGUIR UNA API KEY -> https://mega.nz/sdk");
|
||||
_addTranslation("WARNING: USING MEGA API WITHOUT API KEY MAY VIOLATE ITS TERM OF USE.\n\nYOU SHOULD GET A KEY -> https://mega.nz/sdk (and set it in MegaBasterd ADVANCED SETTINGS).\n\nCREATE API KEY NOW?", "AVISO: USAR LA API DE MEGA SIN UNA API KEY PUEDE VIOLAR SUS TÉRMINOS DE USO.\n\nDEBES CONSEGUIR UNA API KEY -> https://mega.nz/sdk (e introducirla en AJUSTES AVANZADOS de MegaBasterd).\n\n¿CREAR AHORA UNA API KEY?");
|
||||
|
@ -60,7 +60,7 @@ import javax.swing.UIManager;
|
||||
*/
|
||||
public final class MainPanel {
|
||||
|
||||
public static final String VERSION = "7.47";
|
||||
public static final String VERSION = "7.48";
|
||||
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 DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;
|
||||
|
@ -216,6 +216,12 @@
|
||||
<Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="new ImageIcon(getClass().getResource(ICON_FILE)).getImage()" type="code"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[1024, 600]"/>
|
||||
</Property>
|
||||
<Property name="size" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[1024, 600]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="menuBar" type="java.lang.String" value="main_menubar"/>
|
||||
@ -242,18 +248,18 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jTabbedPane1" alignment="1" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="283" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="unfreeze_transferences_button" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="282" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="kiss_server_status" pref="191" max="32767" attributes="0"/>
|
||||
<Component id="kiss_server_status" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="mc_reverse_status" pref="191" max="32767" attributes="0"/>
|
||||
<Component id="mc_reverse_status" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="smart_proxy_status" pref="191" max="32767" attributes="0"/>
|
||||
<Component id="smart_proxy_status" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="memory_status" pref="198" max="32767" attributes="0"/>
|
||||
<Component id="memory_status" max="32767" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="logo_label" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@ -268,7 +274,7 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="unfreeze_transferences_button" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jTabbedPane1" pref="469" max="32767" attributes="0"/>
|
||||
<Component id="jTabbedPane1" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="logo_label" min="-2" max="-2" attributes="0"/>
|
||||
@ -364,7 +370,7 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="global_speed_down_label" max="32767" attributes="0"/>
|
||||
<Component id="global_speed_down_label" pref="839" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="pause_all_down_button" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@ -373,6 +379,9 @@
|
||||
<Component id="status_down_label" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="close_all_finished_down_button" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jScrollPane_down" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="down_remtime_label" alignment="0" max="32767" attributes="0"/>
|
||||
@ -383,7 +392,10 @@
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="close_all_finished_down_button" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="close_all_finished_down_button" alignment="3" max="32767" attributes="0"/>
|
||||
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="status_down_label" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
@ -481,6 +493,20 @@
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="jButton1">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="16" style="1"/>
|
||||
</Property>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/images/icons8-copy-to-clipboard-30.png"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="COPY ALL LINKS"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="uploads_panel">
|
||||
|
@ -509,6 +509,7 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
jPanel_scroll_down = new javax.swing.JPanel();
|
||||
pause_all_down_button = new javax.swing.JButton();
|
||||
down_remtime_label = new javax.swing.JLabel();
|
||||
jButton1 = new javax.swing.JButton();
|
||||
uploads_panel = new javax.swing.JPanel();
|
||||
global_speed_up_label = new javax.swing.JLabel();
|
||||
status_up_label = new javax.swing.JLabel();
|
||||
@ -540,6 +541,8 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
|
||||
setTitle("MegaBasterd " + VERSION);
|
||||
setIconImage(new ImageIcon(getClass().getResource(ICON_FILE)).getImage());
|
||||
setPreferredSize(new java.awt.Dimension(1024, 600));
|
||||
setSize(new java.awt.Dimension(1024, 600));
|
||||
|
||||
logo_label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/mbasterd_logo_nuevo-picsay.png"))); // NOI18N
|
||||
logo_label.setDoubleBuffered(true);
|
||||
@ -598,19 +601,31 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
|
||||
down_remtime_label.setFont(new java.awt.Font("Dialog", 1, 20)); // NOI18N
|
||||
|
||||
jButton1.setFont(new java.awt.Font("Dialog", 1, 16)); // NOI18N
|
||||
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-copy-to-clipboard-30.png"))); // NOI18N
|
||||
jButton1.setText("COPY ALL LINKS");
|
||||
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
jButton1ActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout downloads_panelLayout = new javax.swing.GroupLayout(downloads_panel);
|
||||
downloads_panel.setLayout(downloads_panelLayout);
|
||||
downloads_panelLayout.setHorizontalGroup(
|
||||
downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(downloads_panelLayout.createSequentialGroup()
|
||||
.addComponent(global_speed_down_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(global_speed_down_label, javax.swing.GroupLayout.DEFAULT_SIZE, 839, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(pause_all_down_button))
|
||||
.addGroup(downloads_panelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(status_down_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(close_all_finished_down_button))
|
||||
.addComponent(close_all_finished_down_button)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jButton1)
|
||||
.addGap(6, 6, 6))
|
||||
.addComponent(jScrollPane_down)
|
||||
.addComponent(down_remtime_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
@ -619,7 +634,9 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, downloads_panelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(close_all_finished_down_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(close_all_finished_down_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jButton1))
|
||||
.addComponent(status_down_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jScrollPane_down, javax.swing.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE)
|
||||
@ -865,17 +882,17 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(0, 283, Short.MAX_VALUE)
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(unfreeze_transferences_button)
|
||||
.addGap(0, 282, Short.MAX_VALUE))
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(kiss_server_status, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
|
||||
.addComponent(kiss_server_status, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(mc_reverse_status, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
|
||||
.addComponent(mc_reverse_status, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(smart_proxy_status, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
|
||||
.addComponent(smart_proxy_status, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(memory_status, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)
|
||||
.addComponent(memory_status, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(logo_label)))
|
||||
.addContainerGap())
|
||||
@ -886,7 +903,7 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
.addContainerGap()
|
||||
.addComponent(unfreeze_transferences_button)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE)
|
||||
.addComponent(jTabbedPane1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(logo_label)
|
||||
@ -1421,6 +1438,14 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
THREAD_POOL.execute(_main_panel.getUpload_manager()::unfreezeTransferenceWaitStartQueue);
|
||||
}//GEN-LAST:event_unfreeze_transferences_buttonActionPerformed
|
||||
|
||||
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
||||
// TODO add your handling code here:
|
||||
|
||||
_main_panel.getDownload_manager().copyAllLinksToClipboard();
|
||||
|
||||
JOptionPane.showMessageDialog(this, LabelTranslatorSingleton.getInstance().translate("¡TODO COPIADO!"));
|
||||
}//GEN-LAST:event_jButton1ActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JMenuItem about_menu;
|
||||
private javax.swing.JCheckBoxMenuItem auto_close_menu;
|
||||
@ -1437,6 +1462,7 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
private javax.swing.JLabel global_speed_up_label;
|
||||
private javax.swing.JMenu help_menu;
|
||||
private javax.swing.JMenuItem hide_tray_menu;
|
||||
private javax.swing.JButton jButton1;
|
||||
private javax.swing.JPanel jPanel_scroll_down;
|
||||
private javax.swing.JPanel jPanel_scroll_up;
|
||||
private javax.swing.JScrollPane jScrollPane_down;
|
||||
|
@ -8,6 +8,8 @@ import static java.awt.event.WindowEvent.WINDOW_CLOSING;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.JButton;
|
||||
@ -182,79 +184,98 @@ public class StreamerDialog extends javax.swing.JDialog implements ClipboardChan
|
||||
|
||||
final Dialog tthis = this;
|
||||
|
||||
try {
|
||||
boolean error = false;
|
||||
THREAD_POOL.execute(() -> {
|
||||
try {
|
||||
boolean error = false;
|
||||
|
||||
String stream_link = null;
|
||||
String stream_link = null;
|
||||
|
||||
String link = URLDecoder.decode(original_link_textfield.getText(), "UTF-8").trim();
|
||||
String link = URLDecoder.decode(original_link_textfield.getText(), "UTF-8").trim();
|
||||
|
||||
if (link.length() > 0) {
|
||||
if (link.length() > 0) {
|
||||
|
||||
try {
|
||||
try {
|
||||
|
||||
if (findFirstRegex("://enc", link, 0) != null) {
|
||||
if (findFirstRegex("://enc", link, 0) != null) {
|
||||
|
||||
link = CryptTools.decryptMegaDownloaderLink(link);
|
||||
link = CryptTools.decryptMegaDownloaderLink(link);
|
||||
|
||||
} else if (findFirstRegex("://elc", link, 0) != null) {
|
||||
} else if (findFirstRegex("://elc", link, 0) != null) {
|
||||
|
||||
HashSet links = CryptTools.decryptELC(link, ((MainPanelView) tthis.getParent()).getMain_panel());
|
||||
HashSet links = CryptTools.decryptELC(link, ((MainPanelView) tthis.getParent()).getMain_panel());
|
||||
|
||||
if (links != null) {
|
||||
if (links != null) {
|
||||
|
||||
link = (String) links.iterator().next();
|
||||
link = (String) links.iterator().next();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
error = true;
|
||||
|
||||
LOG.log(Level.SEVERE, ex.getMessage());
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
String data;
|
||||
|
||||
error = true;
|
||||
if (findFirstRegex("://mega(\\.co)?\\.nz/#[^fF]", link, 0) != null || findFirstRegex("://mega(\\.co)?\\.nz/#F*", link, 0) != null || findFirstRegex("https?://[^/]+/![^!]+![0-9a-fA-F]+", link, 0) != null) {
|
||||
|
||||
LOG.log(Level.SEVERE, ex.getMessage());
|
||||
}
|
||||
if (link.contains("#F*")) {
|
||||
|
||||
String data;
|
||||
MegaAPI ma = new MegaAPI();
|
||||
|
||||
if (findFirstRegex("://mega(\\.co)?\\.nz/#[^fF]", link, 0) != null || findFirstRegex("https?://[^/]+/![^!]+![0-9a-fA-F]+", link, 0) != null) {
|
||||
Set<String> links = new HashSet<>();
|
||||
|
||||
String selected_account = (String) use_mega_account_down_combobox.getSelectedItem();
|
||||
links.add(link);
|
||||
|
||||
data = Bin2UrlBASE64(((selected_account != null ? selected_account : "") + "|" + link).getBytes("UTF-8"));
|
||||
List nlinks = ma.getNlinks(links);
|
||||
|
||||
stream_link = "http://localhost:1337/video/" + data;
|
||||
link = (String) nlinks.get(0);
|
||||
}
|
||||
|
||||
String selected_account = (String) use_mega_account_down_combobox.getSelectedItem();
|
||||
|
||||
data = Bin2UrlBASE64(((selected_account != null ? selected_account : "") + "|" + link).getBytes("UTF-8"));
|
||||
|
||||
stream_link = "http://localhost:1337/video/" + data;
|
||||
|
||||
} else {
|
||||
|
||||
error = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
error = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (error) {
|
||||
|
||||
error = true;
|
||||
MiscTools.GUIRun(() -> {
|
||||
JOptionPane.showMessageDialog(tthis, LabelTranslatorSingleton.getInstance().translate("Please, paste a Mega/MegaCrypter/ELC link!"), "Error", JOptionPane.ERROR_MESSAGE);
|
||||
|
||||
original_link_textfield.setText("");
|
||||
|
||||
dance_button.setEnabled(true);
|
||||
|
||||
original_link_textfield.setEnabled(true);
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
_mainPanelView.getMain_panel().getClipboardspy().detachObserver((ClipboardChangeObserver) tthis);
|
||||
copyTextToClipboard(stream_link);
|
||||
MiscTools.GUIRun(() -> {
|
||||
JOptionPane.showMessageDialog(tthis, LabelTranslatorSingleton.getInstance().translate("Streaming link was copied to clipboard!\nRemember to keep MegaBasterd running in background while playing content."));
|
||||
dispose();
|
||||
getParent().dispatchEvent(new WindowEvent(tthis, WINDOW_CLOSING));
|
||||
});
|
||||
}
|
||||
} catch (UnsupportedEncodingException ex) {
|
||||
LOG.log(Level.SEVERE, ex.getMessage());
|
||||
}
|
||||
|
||||
if (error) {
|
||||
|
||||
JOptionPane.showMessageDialog(tthis, LabelTranslatorSingleton.getInstance().translate("Please, paste a Mega/MegaCrypter/ELC link!"), "Error", JOptionPane.ERROR_MESSAGE);
|
||||
|
||||
original_link_textfield.setText("");
|
||||
|
||||
dance_button.setEnabled(true);
|
||||
|
||||
original_link_textfield.setEnabled(true);
|
||||
|
||||
} else {
|
||||
|
||||
_mainPanelView.getMain_panel().getClipboardspy().detachObserver((ClipboardChangeObserver) tthis);
|
||||
copyTextToClipboard(stream_link);
|
||||
JOptionPane.showMessageDialog(tthis, LabelTranslatorSingleton.getInstance().translate("Streaming link was copied to clipboard!\nRemember to keep MegaBasterd running in background while playing content."));
|
||||
dispose();
|
||||
getParent().dispatchEvent(new WindowEvent(tthis, WINDOW_CLOSING));
|
||||
}
|
||||
} catch (UnsupportedEncodingException ex) {
|
||||
LOG.log(Level.SEVERE, ex.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
}//GEN-LAST:event_dance_buttonActionPerformed
|
||||
|
||||
|
@ -23,14 +23,14 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
|
||||
public static final int MAX_PROVISION_WORKERS = 25;
|
||||
private static final Logger LOG = Logger.getLogger(TransferenceManager.class.getName());
|
||||
|
||||
private final ConcurrentLinkedQueue<Object> _transference_preprocess_global_queue;
|
||||
private final ConcurrentLinkedQueue<Runnable> _transference_preprocess_queue;
|
||||
private final ConcurrentLinkedQueue<Transference> _transference_provision_queue;
|
||||
private final ConcurrentLinkedQueue<Transference> _transference_waitstart_queue;
|
||||
private final ConcurrentLinkedQueue<Transference> _transference_waitstart_aux_queue;
|
||||
private final ConcurrentLinkedQueue<Transference> _transference_remove_queue;
|
||||
private final ConcurrentLinkedQueue<Transference> _transference_finished_queue;
|
||||
private final ConcurrentLinkedQueue<Transference> _transference_running_list;
|
||||
protected final ConcurrentLinkedQueue<Object> _transference_preprocess_global_queue;
|
||||
protected final ConcurrentLinkedQueue<Runnable> _transference_preprocess_queue;
|
||||
protected final ConcurrentLinkedQueue<Transference> _transference_provision_queue;
|
||||
protected final ConcurrentLinkedQueue<Transference> _transference_waitstart_queue;
|
||||
protected final ConcurrentLinkedQueue<Transference> _transference_waitstart_aux_queue;
|
||||
protected final ConcurrentLinkedQueue<Transference> _transference_remove_queue;
|
||||
protected final ConcurrentLinkedQueue<Transference> _transference_finished_queue;
|
||||
protected final ConcurrentLinkedQueue<Transference> _transference_running_list;
|
||||
|
||||
private final javax.swing.JPanel _scroll_panel;
|
||||
private final javax.swing.JLabel _status;
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 185 KiB |
Loading…
x
Reference in New Issue
Block a user