diff --git a/src/files/siteSelector.json b/src/files/siteSelector.json index 5c75400..8c0e8fa 100644 --- a/src/files/siteSelector.json +++ b/src/files/siteSelector.json @@ -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" } } diff --git a/src/scripts/ChapterLists.java b/src/scripts/ChapterLists.java index a7fc549..a77e890 100644 --- a/src/scripts/ChapterLists.java +++ b/src/scripts/ChapterLists.java @@ -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; @@ -79,6 +82,15 @@ public static void getList(Novel novel) { } } + private static List scribblehub(Novel novel) throws IOException { + novel.tableOfContent = Jsoup.connect(novel.novelLink).cookie("toc_show","9999").timeout(30 * 1000).get(); + List 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 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")