Skip to content

Commit

Permalink
v1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Flameish committed Jul 20, 2019
1 parent a371da3 commit 25cac2f
Show file tree
Hide file tree
Showing 5 changed files with 280 additions and 279 deletions.
21 changes: 12 additions & 9 deletions src/Novel.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class Novel {
private String url;
private String host;
private String chapterContainer;
private List<String> blacklistedTags;

public Novel(String domain, String urla) {
url = urla;
Expand All @@ -22,55 +23,53 @@ public Novel(String domain, String urla) {
this.chapterLinkSelecter = "#accordion .chapter-item"; //Table of contents chapter links
this.chapterContainer = ".p-15 .fr-view"; //chapter text
this.titleHostName = "-WuxiaWorld"; //From the tab title with whitespaces removed
blacklistedTags = Arrays.asList("a.chapter-nav");
this.blacklistedTags = Arrays.asList("a.chapter-nav");
break;
case "royalroad":
this.host = "https://www.royalroad.com/";
this.chapterLinkSelecter = ".table td:not([class])";
this.chapterContainer = ".chapter-content";
this.titleHostName = "-Royal-Road";
this.blacklistedTags = null;
break;
case "gravitytales":
this.host = "http://gravitytales.com/";
this.chapterLinkSelecter = ".table td";
this.chapterContainer = "#chapterContent";
this.titleHostName = "-Gravity-Tales";
url = urla + "/chapters"; //gravity tales' chapter list is at gravitytales.com/NOVEL/chapters
this.blacklistedTags = null;
break;
case "volarenovels":
this.host = "https://volarenovels.com/";
this.chapterLinkSelecter = "#accordion .chapter-item a";
this.chapterContainer = ".jfontsize_content.fr-view";
this.titleHostName = "-volare-novels";
blacklistedTags = Arrays.asList("a.chapter-nav", "div[id^=div-gpt-ad]", "span[style=font-size: 0]", "span[class=hidden-text]");
this.blacklistedTags = Arrays.asList("a.chapter-nav", "div[id^=div-gpt-ad]", "span[style=font-size: 0]", "span[class=hidden-text]");
break;
case "wordexcerpt":
this.host = "https://wordexcerpt.com/";
this.chapterLinkSelecter = ".listing-chapters_wrap a[href^=" + urla + "]";
this.chapterContainer = ".text-left";
this.titleHostName = "-WordExcerpt";
blacklistedTags = Arrays.asList("center", "meta", "script");
this.blacklistedTags = Arrays.asList("center", "meta", "script");
break;
case "lightnovelstranslations":
this.host = "https://lightnovelstranslations.com/";
this.chapterLinkSelecter = ".entry-content a[href^=" + urla + "]:not(a[rel])";
this.chapterContainer = ".entry-content";
this.titleHostName = "";
blacklistedTags = Arrays.asList("div.code-block", ".sharedaddy", "#textbox");
this.blacklistedTags = Arrays.asList("div.code-block", ".sharedaddy", "#textbox");
break;
case "boxnovel":
this.host = "https://boxnovel.com/";
this.chapterLinkSelecter = ".listing-chapters_wrap a";
this.chapterContainer = ".text-left";
this.titleHostName = "";
blacklistedTags = Arrays.asList("div.code-block");
this.blacklistedTags = Arrays.asList("div.code-block");
break;

}
if (!(blacklistedTags == null)) {
Shared.blacklistedTags.clear();
Shared.blacklistedTags.addAll(blacklistedTags);
}
}

String getChapterLinkSelector() {
Expand All @@ -92,4 +91,8 @@ String getHost() {
String getChapterContainer() {
return this.chapterContainer;
}

List<String> getBlacklistedTags() {
return this.blacklistedTags;
}
}
Loading

0 comments on commit 25cac2f

Please sign in to comment.