1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-12 08:54:11 +02:00

Fix issues in new LusciousRipper class

This commit is contained in:
MetaPrime
2025-01-02 01:17:31 -08:00
parent 4e3619ad13
commit 42efc815df

View File

@@ -10,6 +10,8 @@ import org.jsoup.nodes.Document;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
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.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
@@ -27,10 +29,10 @@ public class LusciousRipper extends AbstractHTMLRipper {
} }
@Override @Override
public URL sanitizeURL(URL url) throws MalformedURLException { public URL sanitizeURL(URL url) throws MalformedURLException, URISyntaxException{
String URLToReturn = url.toExternalForm(); String URLToReturn = url.toExternalForm();
URLToReturn = URLToReturn.replaceAll("https?://(?:www\\.)?luscious\\.", "https://old.luscious."); URLToReturn = URLToReturn.replaceAll("https?://(?:www\\.)?luscious\\.", "https://old.luscious.");
URL san_url = new URL(URLToReturn); URL san_url = new URI(URLToReturn).toURL();
LOGGER.info("sanitized URL is " + san_url.toExternalForm()); LOGGER.info("sanitized URL is " + san_url.toExternalForm());
return san_url; return san_url;
} }