1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-17 19:26:34 +02:00

new URL is deprecated, use new URI, AbstractHTML.

This commit is contained in:
soloturn
2023-06-15 16:21:33 +02:00
parent 6ffd6f34d0
commit ab17fa9822
4 changed files with 8 additions and 5 deletions

View File

@@ -51,7 +51,7 @@ public abstract class AbstractHTMLRipper extends AbstractRipper {
return cachedFirstPage;
}
public Document getNextPage(Document doc) throws IOException {
public Document getNextPage(Document doc) throws IOException, URISyntaxException {
return null;
}
protected abstract List<String> getURLsFromPage(Document page);

View File

@@ -2,6 +2,7 @@ package com.rarchives.ripme.ripper.rippers;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@@ -96,7 +97,7 @@ public class ComicextraRipper extends AbstractHTMLRipper {
}
@Override
public Document getNextPage(Document doc) throws IOException {
public Document getNextPage(Document doc) throws IOException, URISyntaxException {
if (urlType == UrlType.COMIC) {
++chapterIndex;
imageIndex = 0; // Resetting the imagesIndex so that images prefix within each chapter starts from '001_'.

View File

@@ -13,6 +13,8 @@ import org.jsoup.select.Elements;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -154,7 +156,7 @@ public class EHentaiRipper extends AbstractHTMLRipper {
}
@Override
public Document getNextPage(Document doc) throws IOException {
public Document getNextPage(Document doc) throws IOException, URISyntaxException {
// Check if we've stopped
if (isStopped()) {
throw new IOException("Ripping interrupted");
@@ -174,7 +176,7 @@ public class EHentaiRipper extends AbstractHTMLRipper {
// Sleep before loading next page
sleep(PAGE_SLEEP_TIME);
// Load next page
Document nextPage = getPageWithRetries(new URL(nextURL));
Document nextPage = getPageWithRetries(new URI(nextURL).toURL());
this.lastURL = nextURL;
return nextPage;
}

View File

@@ -96,7 +96,7 @@ public class ListalRipper extends AbstractHTMLRipper {
}
@Override
public Document getNextPage(Document page) throws IOException {
public Document getNextPage(Document page) throws IOException, URISyntaxException {
Document nextPage = super.getNextPage(page);
switch (urlType) {
case LIST: