mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-13 01:14:14 +02:00
sanitizeURL added to jpg3 ripper to handle when link to other than the first page of the album is inputted
This commit is contained in:
@@ -7,6 +7,7 @@ import org.jsoup.nodes.Element;
|
|||||||
|
|
||||||
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.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -39,6 +40,14 @@ public class Jpg3Ripper extends AbstractHTMLRipper {
|
|||||||
return urls;
|
return urls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public URL sanitizeURL(URL url) throws MalformedURLException {
|
||||||
|
String u = url.toExternalForm();
|
||||||
|
u = u.replaceAll("https?://jpg3.su/a/([^/]+)/?.*", "https://jpg3.su/a/$1");
|
||||||
|
LOGGER.debug("Changed URL from " + url + " to " + u);
|
||||||
|
return new URL(u);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Document getNextPage(Document page) throws IOException, URISyntaxException {
|
public Document getNextPage(Document page) throws IOException, URISyntaxException {
|
||||||
String href = page.select("[data-pagination='next']").attr("href");
|
String href = page.select("[data-pagination='next']").attr("href");
|
||||||
|
Reference in New Issue
Block a user