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:
commit
cd16aaca0d
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user