mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-08 14:56:38 +02:00
new URI instead of new URL, jpg3, hentaidude.
This commit is contained in:
@@ -10,6 +10,7 @@ import org.jsoup.nodes.Document;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -91,7 +92,7 @@ public class HentaidudeRipper extends AbstractSingleFileRipper {
|
||||
public void run() {
|
||||
try {
|
||||
Document doc = Http.url(url).get();
|
||||
URL videoSourceUrl = new URL(getVideoUrl(doc));
|
||||
URL videoSourceUrl = new URI(getVideoUrl(doc)).toURL();
|
||||
addURLToDownload(videoSourceUrl, "", "", "", null, getVideoName(), "mp4");
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Could not get video url for " + getVideoName(), e);
|
||||
|
@@ -7,6 +7,7 @@ import org.jsoup.nodes.Element;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
@@ -40,11 +41,11 @@ public class Jpg3Ripper extends AbstractHTMLRipper {
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL sanitizeURL(URL url) throws MalformedURLException {
|
||||
public URL sanitizeURL(URL url) throws MalformedURLException, URISyntaxException {
|
||||
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);
|
||||
return new URI(u).toURL();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.rarchives.ripme.tst.ripper.rippers;
|
||||
|
||||
import com.rarchives.ripme.ripper.rippers.HentaidudeRipper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
@@ -8,6 +9,7 @@ import java.net.URISyntaxException;
|
||||
|
||||
public class HentaidudeRipperTest extends RippersTest{
|
||||
|
||||
@Test
|
||||
public void testRip() throws IOException, URISyntaxException {
|
||||
HentaidudeRipper ripper = new HentaidudeRipper(new URI("https://hentaidude.com/girlfriends-4ever-dlc-2/").toURL());
|
||||
testRipper(ripper);
|
||||
|
Reference in New Issue
Block a user