mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-04 12:57:33 +02:00
@@ -1,10 +1,5 @@
|
|||||||
package com.rarchives.ripme.ripper.rippers;
|
package com.rarchives.ripme.ripper.rippers;
|
||||||
|
|
||||||
import com.rarchives.ripme.ripper.AbstractHTMLRipper;
|
|
||||||
import com.rarchives.ripme.utils.Http;
|
|
||||||
import org.jsoup.nodes.Document;
|
|
||||||
import org.jsoup.nodes.Element;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@@ -13,10 +8,13 @@ import java.util.List;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import org.jsoup.nodes.Document;
|
||||||
|
import org.jsoup.nodes.Element;
|
||||||
|
|
||||||
|
import com.rarchives.ripme.ripper.AbstractHTMLRipper;
|
||||||
|
import com.rarchives.ripme.utils.Http;
|
||||||
|
|
||||||
public class HentaiimageRipper extends AbstractHTMLRipper {
|
public class HentaiimageRipper extends AbstractHTMLRipper {
|
||||||
|
|
||||||
|
|
||||||
public HentaiimageRipper(URL url) throws IOException {
|
public HentaiimageRipper(URL url) throws IOException {
|
||||||
super(url);
|
super(url);
|
||||||
}
|
}
|
||||||
@@ -43,13 +41,13 @@ public class HentaiimageRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGID(URL url) throws MalformedURLException {
|
public String getGID(URL url) throws MalformedURLException {
|
||||||
Pattern p = Pattern.compile("https://(?:\\w\\w\\.)?hentai-(image|comic).com/image/([a-zA-Z0-9_-]+)/?");
|
Pattern p = Pattern.compile("https://(?:\\w\\w\\.)?hentai-(image|comic|img-xxx).com/image/([a-zA-Z0-9_-]+)/?");
|
||||||
Matcher m = p.matcher(url.toExternalForm());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return m.group(1);
|
return m.group(1);
|
||||||
}
|
}
|
||||||
throw new MalformedURLException("Expected hitomi URL format: " +
|
throw new MalformedURLException("Expected hitomi URL format: " +
|
||||||
"https://hentai-image.com/image/ID - got " + url + " instead");
|
"https://hentai-img-xxx.com/image/ID - got " + url + " instead");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -4,17 +4,15 @@ import java.io.IOException;
|
|||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
|
||||||
import com.rarchives.ripme.ripper.rippers.HentaiimageRipper;
|
|
||||||
import com.rarchives.ripme.utils.Utils;
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import com.rarchives.ripme.ripper.rippers.HentaiimageRipper;
|
||||||
|
|
||||||
public class HentaiimageRipperTest extends RippersTest {
|
public class HentaiimageRipperTest extends RippersTest {
|
||||||
@Test
|
@Test
|
||||||
public void testHentaifoundryRip() throws IOException, URISyntaxException {
|
public void testHentaifoundryRip() throws IOException, URISyntaxException {
|
||||||
if (Utils.getConfigBoolean("test.run_flaky_tests", false)) {
|
HentaiimageRipper ripper = new HentaiimageRipper(
|
||||||
HentaiimageRipper ripper = new HentaiimageRipper(new URI("https://hentai-image.com/image/afrobull-gerudo-ongoing-12/").toURL());
|
new URI("https://hentai-img-xxx.com/image/afrobull-gerudo-ongoing-12/").toURL());
|
||||||
testRipper(ripper);
|
testRipper(ripper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user