mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-27 07:44:20 +02:00
Fixed EromeRipper and added new test to EromerRipperTest.
This commit is contained in:
@@ -124,12 +124,17 @@ public class EromeRipper extends AbstractHTMLRipper {
|
||||
private List<String> getMediaFromPage(Document doc) {
|
||||
List<String> results = new ArrayList<>();
|
||||
for (Element el : doc.select("img.img-front")) {
|
||||
if (el.hasAttr("src")) {
|
||||
if (el.attr("src").startsWith("https:")) {
|
||||
results.add(el.attr("src"));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
results.add("https:" + el.attr("src"));
|
||||
}
|
||||
} else if (el.hasAttr("data-src")) {
|
||||
//to add images that are not loaded( as all images are lasyloaded as we scroll).
|
||||
results.add(el.attr("data-src"));
|
||||
}
|
||||
|
||||
}
|
||||
for (Element el : doc.select("source[label=HD]")) {
|
||||
if (el.attr("src").startsWith("https:")) {
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.rarchives.ripme.tst.ripper.rippers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import com.rarchives.ripme.ripper.rippers.EromeRipper;
|
||||
@@ -37,4 +38,10 @@ public class EromeRipperTest extends RippersTest {
|
||||
EromeRipper ripper = new EromeRipper(url);
|
||||
testRipper(ripper);
|
||||
}
|
||||
|
||||
public void testGetURLsFromPage() throws IOException {
|
||||
URL url = new URL("https://www.erome.com/a/Tak8F2h6");
|
||||
EromeRipper ripper = new EromeRipper(url);
|
||||
assert (35 == ripper.getURLsFromPage(ripper.getFirstPage()).size());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user