mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-18 03:31:24 +02:00
new URL is deprecated, use new URI, AbstractHTML.
This commit is contained in:
@@ -51,7 +51,7 @@ public abstract class AbstractHTMLRipper extends AbstractRipper {
|
|||||||
return cachedFirstPage;
|
return cachedFirstPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Document getNextPage(Document doc) throws IOException {
|
public Document getNextPage(Document doc) throws IOException, URISyntaxException {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
protected abstract List<String> getURLsFromPage(Document page);
|
protected abstract List<String> getURLsFromPage(Document page);
|
||||||
|
@@ -2,6 +2,7 @@ package com.rarchives.ripme.ripper.rippers;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -96,7 +97,7 @@ public class ComicextraRipper extends AbstractHTMLRipper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Document getNextPage(Document doc) throws IOException {
|
public Document getNextPage(Document doc) throws IOException, URISyntaxException {
|
||||||
if (urlType == UrlType.COMIC) {
|
if (urlType == UrlType.COMIC) {
|
||||||
++chapterIndex;
|
++chapterIndex;
|
||||||
imageIndex = 0; // Resetting the imagesIndex so that images prefix within each chapter starts from '001_'.
|
imageIndex = 0; // Resetting the imagesIndex so that images prefix within each chapter starts from '001_'.
|
||||||
|
@@ -13,6 +13,8 @@ import org.jsoup.select.Elements;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
@@ -154,7 +156,7 @@ public class EHentaiRipper extends AbstractHTMLRipper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Document getNextPage(Document doc) throws IOException {
|
public Document getNextPage(Document doc) throws IOException, URISyntaxException {
|
||||||
// Check if we've stopped
|
// Check if we've stopped
|
||||||
if (isStopped()) {
|
if (isStopped()) {
|
||||||
throw new IOException("Ripping interrupted");
|
throw new IOException("Ripping interrupted");
|
||||||
@@ -174,7 +176,7 @@ public class EHentaiRipper extends AbstractHTMLRipper {
|
|||||||
// Sleep before loading next page
|
// Sleep before loading next page
|
||||||
sleep(PAGE_SLEEP_TIME);
|
sleep(PAGE_SLEEP_TIME);
|
||||||
// Load next page
|
// Load next page
|
||||||
Document nextPage = getPageWithRetries(new URL(nextURL));
|
Document nextPage = getPageWithRetries(new URI(nextURL).toURL());
|
||||||
this.lastURL = nextURL;
|
this.lastURL = nextURL;
|
||||||
return nextPage;
|
return nextPage;
|
||||||
}
|
}
|
||||||
|
@@ -96,7 +96,7 @@ public class ListalRipper extends AbstractHTMLRipper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Document getNextPage(Document page) throws IOException {
|
public Document getNextPage(Document page) throws IOException, URISyntaxException {
|
||||||
Document nextPage = super.getNextPage(page);
|
Document nextPage = super.getNextPage(page);
|
||||||
switch (urlType) {
|
switch (urlType) {
|
||||||
case LIST:
|
case LIST:
|
||||||
|
Reference in New Issue
Block a user