mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-26 23:34:53 +02:00
@@ -52,9 +52,9 @@ public class XcartxRipper extends AbstractHTMLRipper {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> getURLsFromPage(Document page) {
|
public List<String> getURLsFromPage(Document page) {
|
||||||
List<String> imageURLs = new ArrayList<>();
|
List<String> imageURLs = new ArrayList<>();
|
||||||
Elements albumElements = page.select("a.highslide");
|
Elements imageElements = page.select("div.f-desc img");
|
||||||
for (Element imageBox : albumElements) {
|
for (Element image : imageElements) {
|
||||||
String imageUrl = imageBox.attr("href");
|
String imageUrl = image.attr("abs:src");
|
||||||
|
|
||||||
imageURLs.add(imageUrl);
|
imageURLs.add(imageUrl);
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,36 @@
|
|||||||
|
package com.rarchives.ripme.ripper.rippers;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class XlecxRipper extends XcartxRipper {
|
||||||
|
|
||||||
|
private Pattern p = Pattern.compile("^https?://xlecx.com/([a-zA-Z0-9_\\-]+).html");
|
||||||
|
|
||||||
|
public XlecxRipper(URL url) throws IOException {
|
||||||
|
super(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getHost() {
|
||||||
|
return "xlecx";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDomain() {
|
||||||
|
return "xlecx.com";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGID(URL url) throws MalformedURLException {
|
||||||
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
|
if (m.matches()) {
|
||||||
|
return m.group(1);
|
||||||
|
}
|
||||||
|
throw new MalformedURLException("Expected URL format: http://xlecx.com/comic, got: " + url);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,13 @@
|
|||||||
|
package com.rarchives.ripme.tst.ripper.rippers;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
import com.rarchives.ripme.ripper.rippers.XlecxRipper;
|
||||||
|
|
||||||
|
public class XlecxRipperTest extends RippersTest {
|
||||||
|
public void testAlbum() throws IOException {
|
||||||
|
XlecxRipper ripper = new XlecxRipper(new URL("http://xlecx.com/4274-black-canary-ravished-prey.html"));
|
||||||
|
testRipper(ripper);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user