tonikelope 2020-04-13 12:07:45 +02:00
parent db51cf8dbb
commit 4963848f4b
6 changed files with 29 additions and 11 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId>
<artifactId>MegaBasterd</artifactId>
<version>7.23</version>
<version>7.24</version>
<packaging>jar</packaging>
<dependencies>
<dependency>

View File

@ -326,6 +326,8 @@ public class LinkGrabberDialog extends javax.swing.JDialog implements ClipboardC
String link = i.next();
link = MiscTools.newMegaLinks2Legacy(link);
if (findFirstRegex("(?:https?|mega)://[^/]*/(#.*?)?!.+![^\r\n]+", link, 0) == null) {
i.remove();

View File

@ -57,7 +57,7 @@ import javax.swing.UIManager;
*/
public final class MainPanel {
public static final String VERSION = "7.23";
public static final String VERSION = "7.24";
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;

View File

@ -945,9 +945,12 @@ public final class MainPanelView extends javax.swing.JFrame {
Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
Set<String> urls = new HashSet(findAllRegex("(?:https?|mega)://[^\r\n]+(#[^\r\n!]*?)?![^\r\n!]+![^\\?\r\n]+", dialog.getLinks_textarea().getText(), 0));
//Convert to legacy link format
String link_data = MiscTools.newMegaLinks2Legacy(dialog.getLinks_textarea().getText());
Set<String> megadownloader = new HashSet(findAllRegex("mega://enc[^\r\n]+", dialog.getLinks_textarea().getText(), 0));
Set<String> urls = new HashSet(findAllRegex("(?:https?|mega)://[^\r\n]+(#[^\r\n!]*?)?![^\r\n!]+![^\\?\r\n]+", link_data, 0));
Set<String> megadownloader = new HashSet(findAllRegex("mega://enc[^\r\n]+", link_data, 0));
megadownloader.forEach((link) -> {
try {
@ -959,7 +962,7 @@ public final class MainPanelView extends javax.swing.JFrame {
}
});
Set<String> elc = new HashSet(findAllRegex("mega://elc[^\r\n]+", dialog.getLinks_textarea().getText(), 0));
Set<String> elc = new HashSet(findAllRegex("mega://elc[^\r\n]+", link_data, 0));
elc.forEach((link) -> {
try {
@ -971,7 +974,7 @@ public final class MainPanelView extends javax.swing.JFrame {
}
});
Set<String> dlc = new HashSet(findAllRegex("dlc://([^\r\n]+)", dialog.getLinks_textarea().getText(), 1));
Set<String> dlc = new HashSet(findAllRegex("dlc://([^\r\n]+)", link_data, 1));
dlc.stream().map((d) -> CryptTools.decryptDLC(d, _main_panel)).forEachOrdered((links) -> {
links.stream().filter((link) -> (findFirstRegex("(?:https?|mega)://[^\r\n](#[^\r\n!]*?)?![^\r\n!]+![^\\?\r\n]+", link, 0) != null)).forEachOrdered((link) -> {

View File

@ -797,7 +797,9 @@ public class MiscTools {
try {
String decoded = MiscTools.findFirstRegex("(?:https?|mega)://[^\r\n]+(#[^\r\n!]*?)?![^\r\n!]+![^\\?\r\n]+", new String(Base64.getDecoder().decode(chunk), "UTF-8"), 0);
String clean_data = MiscTools.newMegaLinks2Legacy(new String(Base64.getDecoder().decode(chunk)));
String decoded = MiscTools.findFirstRegex("(?:https?|mega)://[^\r\n]+(#[^\r\n!]*?)?![^\r\n!]+![^\\?\r\n]+", clean_data, 0);
if (decoded != null) {
links.add(decoded);
@ -808,9 +810,11 @@ public class MiscTools {
}
}
links.addAll(findAllRegex("(?:https?|mega)://[^\r\n]+(#[^\r\n!]*?)?![^\r\n!]+![^\\?\r\n]+", URLDecoder.decode(data, "UTF-8"), 0));
String clean_data = MiscTools.newMegaLinks2Legacy(URLDecoder.decode(data, "UTF-8"));
links.addAll(findAllRegex("mega://e(n|l)c[^\r\n]+", URLDecoder.decode(data, "UTF-8"), 0));
links.addAll(findAllRegex("(?:https?|mega)://[^\r\n]+(#[^\r\n!]*?)?![^\r\n!]+![^\\?\r\n]+", clean_data, 0));
links.addAll(findAllRegex("mega://e(n|l)c[^\r\n]+", clean_data, 0));
res = links.stream().map((s) -> s + "\n").reduce(res, String::concat);
} catch (UnsupportedEncodingException ex) {
@ -828,9 +832,11 @@ public class MiscTools {
if (data != null) {
try {
ArrayList<String> links = findAllRegex("(?:https?|mega)://[^\r\n]+(#[^\r\n!]*?)?![^\r\n!]+![^\\?\r\n]+", URLDecoder.decode(data, "UTF-8"), 0);
String clean_data = MiscTools.newMegaLinks2Legacy(URLDecoder.decode(data, "UTF-8"));
links.addAll(findAllRegex("mega://e(n|l)c[^\r\n]+", URLDecoder.decode(data, "UTF-8"), 0));
ArrayList<String> links = findAllRegex("(?:https?|mega)://[^\r\n]+(#[^\r\n!]*?)?![^\r\n!]+![^\\?\r\n]+", clean_data, 0);
links.addAll(findAllRegex("mega://e(n|l)c[^\r\n]+", clean_data, 0));
if (links.size() > 0) {
@ -1388,6 +1394,13 @@ public class MiscTools {
}
public static String newMegaLinks2Legacy(String data) {
String replace1 = data.replaceAll("https://mega\\.nz/folder/([^#]+)#(.+)", "https://mega.nz/#F!$1!$2");
return replace1.replaceAll("https://mega\\.nz/file/([^#]+)#(.+)", "https://mega.nz/#!$1!$2");
}
private MiscTools() {
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 223 KiB