mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-08 14:56:38 +02:00
new URI instead of new URL, abstractjsonripper.
This commit is contained in:
@@ -8,6 +8,7 @@ import org.json.JSONObject;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
@@ -56,7 +57,7 @@ public abstract class AbstractJSONRipper extends AbstractRipper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public URL sanitizeURL(URL url) throws MalformedURLException {
|
public URL sanitizeURL(URL url) throws MalformedURLException, URISyntaxException {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,6 +2,8 @@ package com.rarchives.ripme.ripper.rippers;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -37,7 +39,7 @@ public class DerpiRipper extends AbstractJSONRipper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public URL sanitizeURL(URL url) throws MalformedURLException {
|
public URL sanitizeURL(URL url) throws MalformedURLException, URISyntaxException {
|
||||||
String u = url.toExternalForm();
|
String u = url.toExternalForm();
|
||||||
String[] uu = u.split("\\?", 2);
|
String[] uu = u.split("\\?", 2);
|
||||||
String newU = uu[0];
|
String newU = uu[0];
|
||||||
@@ -54,7 +56,7 @@ public class DerpiRipper extends AbstractJSONRipper {
|
|||||||
newU += "&key=" + key;
|
newU += "&key=" + key;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new URL(newU);
|
return new URI(newU).toURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user