1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-04-22 12:42:02 +02:00

Fix Pawoo ripper pagination

The generic Mastodon ripper mostly worked as a base for this ripper, but Pawoo uses a custom web UI that changes how navigation links work, so I've updated it to use the correct selector.
This commit is contained in:
0x1f595 2020-01-21 18:29:17 -07:00
parent 4248a0fd23
commit 5555e2017b

View File

@ -3,6 +3,11 @@ package com.rarchives.ripme.ripper.rippers;
import java.io.IOException;
import java.net.URL;
import com.rarchives.ripme.utils.Http;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
public class PawooRipper extends MastodonRipper {
public PawooRipper(URL url) throws IOException {
super(url);
@ -17,4 +22,17 @@ public class PawooRipper extends MastodonRipper {
public String getDomain() {
return "pawoo.net";
}
@Override
// Pawoo uses a custom theme that has different navigation links
public Document getNextPage(Document doc) throws IOException {
Elements hrefs = doc.select(".pagination a[rel=\"next\"]");
if (hrefs.isEmpty()) {
throw new IOException("No more pages");
}
String nextUrl = hrefs.last().attr("href");
sleep(500);
return Http.url(nextUrl).get();
}
}