Skip to content

Commit

Permalink
Add scribblehub
Browse files Browse the repository at this point in the history
  • Loading branch information
Flameish committed Jul 14, 2020
1 parent b6af8a2 commit eb8e97f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/files/siteSelector.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,5 +453,20 @@
"bookCoverSelector": ".novel-featureimg img",
"bookAuthorSelector": "",
"bookSubjectSelector": ".novel-tags"
},

"ScribbleHub": {
"url": "https://scribblehub.com/",
"ordinalIndexForBaseNovel": "5",
"chapterLinkSelector": "a.toc_a",
"chapterContainer": "#chp_raw",
"blacklistedTags": [
"null"
],
"bookTitleSelector": ".fic_title",
"bookDescSelector": ".wi_fic_desc",
"bookCoverSelector": ".fic_image img",
"bookAuthorSelector": ".auth_name_fic",
"bookSubjectSelector": ".wi_fic_genre a"
}
}
12 changes: 12 additions & 0 deletions src/scripts/ChapterLists.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public static void getList(Novel novel) {
case "https://foxaholic.com/":
novel.chapters = ChapterLists.foxaholic(novel);
break;
case "https://scribblehub.com/":
novel.chapters = ChapterLists.scribblehub(novel);
break;
default:
novel.chapters = ChapterLists.defaults(novel);
break;
Expand All @@ -79,6 +82,15 @@ public static void getList(Novel novel) {
}
}

private static List<Chapter> scribblehub(Novel novel) throws IOException {
novel.tableOfContent = Jsoup.connect(novel.novelLink).cookie("toc_show","9999").timeout(30 * 1000).get();
List<Chapter> chapters = new ArrayList<>();
for (Element chapterLink : novel.tableOfContent.select(novel.host.chapterLinkSelector)) {
chapters.add(new Chapter(chapterLink.text(), chapterLink.attr("abs:href")));
}
return chapters;
}

private static List<Chapter> creativenovels(Novel novel) throws IOException {
novel.tableOfContent = Jsoup.connect(novel.novelLink).timeout(30 * 1000).get();
Connection.Response res = Jsoup.connect("https://creativenovels.com/wp-admin/admin-ajax.php")
Expand Down

0 comments on commit eb8e97f

Please sign in to comment.