1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-01-17 20:58:31 +01:00

Merge pull request #1559 from 0x1f595/mastodon

Fix Pawoo ripper pagination
This commit is contained in:
cyian-1756 2020-01-22 14:20:28 +00:00 committed by GitHub
commit cd16aaca0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();
}
}