Skip to content

Commit

Permalink
🎉 Release v1.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
freeok committed Nov 22, 2024
1 parent 58b2257 commit 69382ad
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion input/macos-run.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
chmod 777 ./runtime/bin/java && ./runtime/Contents/Home/bin/java -Dconfig.file=config.ini -jar app.jar
chmod 777 ./runtime/Contents/Home/bin/java && ./runtime/Contents/Home/bin/java -Dconfig.file=config.ini -jar app.jar
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.pcdd</groupId>
<artifactId>so-novel</artifactId>
<version>1.6.3</version>
<version>1.6.4</version>
<packaging>jar</packaging>

<name>so-novel</name>
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/pcdd/sonovel/parse/BookParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
*/
public class BookParser extends Parser {

private static final int TIMEOUT_MILLS = 30_000;

public BookParser(int sourceId) {
super(sourceId);
}

@SneakyThrows
public Book parse(String url) {
Rule.Book r = this.rule.getBook();
Document document = Jsoup.parse(URLUtil.url(url), 30_000);
Document document = Jsoup.parse(URLUtil.url(url), TIMEOUT_MILLS);
String bookName = document.select(r.getBookName()).attr("content");
String author = document.select(r.getAuthor()).attr("content");
String description = document.select(r.getDescription()).attr("content");
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/pcdd/sonovel/parse/CatalogParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
public class CatalogParser extends Parser {

public static final String INDEX_URL;
private static final int TIMEOUT_MILLS = 30_000;

// 加载配置文件参数
static {
Expand All @@ -41,7 +42,7 @@ public List<Chapter> parse(String url) {
*/
@SneakyThrows
public List<Chapter> parse(String url, int start, int end) {
Document document = Jsoup.parse(URLUtil.url(url), 30_000);
Document document = Jsoup.parse(URLUtil.url(url), TIMEOUT_MILLS);
Elements elements = document.select(this.rule.getBook().getCatalog());
List<Chapter> catalog = new ArrayList<>();

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/pcdd/sonovel/parse/SearchResultParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
*/
public class SearchResultParser extends Parser {

private static final int TIMEOUT_MILLS = 15_000;

public SearchResultParser(int sourceId) {
super(sourceId);
}

@SneakyThrows
public List<SearchResult> parse(String keyword) {
Rule.Search search = this.rule.getSearch();
Connection connect = Jsoup.connect(search.getUrl()).timeout(10_000);
Connection connect = Jsoup.connect(search.getUrl()).timeout(TIMEOUT_MILLS);
// 搜索结果页DOM
Document document = connect.data(search.getParamName().getKeyword(), keyword).post();
Elements elements = document.select(search.getResult());
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/pcdd/sonovel/util/Settings.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.pcdd.sonovel.util;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.setting.dialect.Props;
import lombok.experimental.UtilityClass;

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/pcdd/sonovel/ChapterConverterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void test01() {
<br>&nbsp;&nbsp;&nbsp;&nbsp;只刹那间,她的脸色就变得极为复杂起来,愤怒、疑惑,各种情绪掺杂,但却也并没有大发雷霆。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;想和更多志同道合的人一起聊《重生之老子是皇帝》,“热度网文&nbsp;或者&nbsp;”&nbsp;与更多书友一起聊喜欢的书
<br>
<br><br><br><p><a href="http://koubei.baidu.com/s/xbiqugu.net" target="_blank">亲,点击进去,给个好评呗,分数越高更新越快,据说给香书小说打满分的最后都找到了漂亮的老婆哦!</a><br>手机站全新改版升级地址:https://wap.xbiqugu.net,数据和书签与电脑站同步,无广告清新阅读!</p>
""").build();
""").build();

System.out.println(ChapterConverter.convert(chapter, "epub"));
}
Expand Down

0 comments on commit 69382ad

Please sign in to comment.