Skip to content

Commit 42efc81

Browse files
committed
Fix issues in new LusciousRipper class
1 parent 4e3619a commit 42efc81

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/rarchives/ripme/ripper/rippers/LusciousRipper.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import java.io.IOException;
1111
import java.io.UnsupportedEncodingException;
1212
import java.net.MalformedURLException;
13+
import java.net.URI;
14+
import java.net.URISyntaxException;
1315
import java.net.URL;
1416
import java.net.URLEncoder;
1517
import java.util.ArrayList;
@@ -27,10 +29,10 @@ public LusciousRipper(URL url) throws IOException {
2729
}
2830

2931
@Override
30-
public URL sanitizeURL(URL url) throws MalformedURLException {
32+
public URL sanitizeURL(URL url) throws MalformedURLException, URISyntaxException{
3133
String URLToReturn = url.toExternalForm();
3234
URLToReturn = URLToReturn.replaceAll("https?://(?:www\\.)?luscious\\.", "https://old.luscious.");
33-
URL san_url = new URL(URLToReturn);
35+
URL san_url = new URI(URLToReturn).toURL();
3436
LOGGER.info("sanitized URL is " + san_url.toExternalForm());
3537
return san_url;
3638
}

0 commit comments

Comments
 (0)