mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-22 05:23:06 +02:00
new URI in mainwindow.
This commit is contained in:
@@ -37,13 +37,13 @@ import java.io.IOException;
|
|||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Enumeration;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@@ -738,7 +738,7 @@ public final class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
if (!urlText.startsWith("http")) {
|
if (!urlText.startsWith("http")) {
|
||||||
urlText = "http://" + urlText;
|
urlText = "http://" + urlText;
|
||||||
}
|
}
|
||||||
URL url = new URL(urlText);
|
URL url = new URI(urlText).toURL();
|
||||||
AbstractRipper ripper = AbstractRipper.getRipper(url);
|
AbstractRipper ripper = AbstractRipper.getRipper(url);
|
||||||
statusWithColor(ripper.getHost() + " album detected", Color.GREEN);
|
statusWithColor(ripper.getHost() + " album detected", Color.GREEN);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -1282,8 +1282,8 @@ public final class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
}
|
}
|
||||||
URL url;
|
URL url;
|
||||||
try {
|
try {
|
||||||
url = new URL(urlString);
|
url = new URI(urlString).toURL();
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException | URISyntaxException e) {
|
||||||
LOGGER.error("[!] Could not generate URL for '" + urlString + "'", e);
|
LOGGER.error("[!] Could not generate URL for '" + urlString + "'", e);
|
||||||
error("Given URL is not valid, expecting http://website.com/page/...");
|
error("Given URL is not valid, expecting http://website.com/page/...");
|
||||||
return null;
|
return null;
|
||||||
@@ -1340,7 +1340,7 @@ public final class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
if (!urlText.startsWith("http")) {
|
if (!urlText.startsWith("http")) {
|
||||||
urlText = "http://" + urlText;
|
urlText = "http://" + urlText;
|
||||||
}
|
}
|
||||||
URL url = new URL(urlText);
|
URL url = new URI(urlText).toURL();
|
||||||
// Ripper is needed here to throw/not throw an Exception
|
// Ripper is needed here to throw/not throw an Exception
|
||||||
AbstractRipper ripper = AbstractRipper.getRipper(url);
|
AbstractRipper ripper = AbstractRipper.getRipper(url);
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user