mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-01 19:40:18 +02:00
Merge pull request #1559 from 0x1f595/mastodon
Fix Pawoo ripper pagination
This commit is contained in:
@@ -3,6 +3,11 @@ package com.rarchives.ripme.ripper.rippers;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
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 class PawooRipper extends MastodonRipper {
|
||||||
public PawooRipper(URL url) throws IOException {
|
public PawooRipper(URL url) throws IOException {
|
||||||
super(url);
|
super(url);
|
||||||
@@ -17,4 +22,17 @@ public class PawooRipper extends MastodonRipper {
|
|||||||
public String getDomain() {
|
public String getDomain() {
|
||||||
return "pawoo.net";
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user