Here is code for fasting the process
`package grabber.sources;
import grabber.Chapter;
import grabber.GrabberUtils;
import grabber.Novel;
import grabber.NovelMetadata;
import org.jsoup.HttpStatusException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class readwn_com implements Source {
private final String name = "Readwn.com";
private final String url = "https://www.readwn.com/";
private final boolean canHeadless = false;
private Novel novel;
private Document toc;
public readwn_com() {
}
public readwn_com(Novel novel) {
this.novel = novel;
}
public String getName() {
return name;
}
public boolean canHeadless() {
return canHeadless;
}
public String toString() {
return name;
}
public String getUrl() {
return url;
}
public List<Chapter> getChapterList() {
List<Chapter> chapterList = new ArrayList();
try {
toc = Jsoup.connect(novel.novelLink)
.cookies(novel.cookies)
.userAgent("Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0")
.get();
// Travers pagination
Document chapterListPage = toc;
while (true) {
// Add chapters from current page
Elements chapterLinks = chapterListPage.select(".chapter-list a");
for (Element chapterLink : chapterLinks) {
chapterList.add(new Chapter(chapterLink.selectFirst("strong").text(), chapterLink.attr("abs:href")));
}
// Go to next page
Element nextPageLink = chapterListPage.selectFirst(".pagination li:contains(>) a");
// Is last page
if (nextPageLink == null) break;
chapterListPage = Jsoup.connect(nextPageLink.attr("abs:href"))
.cookies(novel.cookies)
.userAgent("Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0")
.get();
}
} catch (HttpStatusException httpEr) {
GrabberUtils.err(novel.window, GrabberUtils.getHTMLErrMsg(httpEr));
} catch (IOException e) {
GrabberUtils.err(novel.window, "Could not connect to webpage!", e);
} catch (NullPointerException e) {
GrabberUtils.err(novel.window, "Could not find expected selectors. Correct novel link?", e);
}
return chapterList;
}
public Element getChapterContent(Chapter chapter) {
Element chapterBody = null;
try {
Document doc = Jsoup.connect(chapter.chapterURL)
.cookies(novel.cookies)
.userAgent("Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0")
.get();
chapterBody = doc.selectFirst(".chapter-content");
} catch (HttpStatusException httpEr) {
GrabberUtils.err(novel.window, GrabberUtils.getHTMLErrMsg(httpEr));
} catch (IOException e) {
GrabberUtils.err(novel.window, "Could not connect to webpage!", e);
}
return chapterBody;
}
public NovelMetadata getMetadata() {
NovelMetadata metadata = new NovelMetadata();
if (toc != null) {
Element title = toc.selectFirst(".novel-title");
Element author = toc.selectFirst(".author span[itemprop=author]");
Element desc = toc.selectFirst(".summary div");
Element cover = toc.selectFirst(".lazy");
metadata.setTitle(title != null ? title.text() : "");
metadata.setAuthor(author != null ? author.text() : "");
metadata.setDescription(desc != null ? desc.text() : "");
metadata.setBufferedCover(cover != null ? cover.attr("abs:data-src") : "");
Elements tags = toc.select(".categories a");
List<String> subjects = new ArrayList<>();
for (Element tag : tags) {
subjects.add(tag.text());
}
metadata.setSubjects(subjects);
}
return metadata;
}
public List<String> getBlacklistedTags() {
List blacklistedTags = new ArrayList();
return blacklistedTags;
}
}`
invalid Source request