Skip to content

Commit

Permalink
🎉 Release v1.7.2 🎅🏻🎄
Browse files Browse the repository at this point in the history
  • Loading branch information
freeok committed Dec 24, 2024
1 parent 6fc87ac commit 45b55db
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[base]
# 启用书源 (只能选一个,当前可选值:1、2、3)
source-id = 3
source-id = 4
# 下载路径,绝对相对均可 (Windows 路径分隔符不要用 \ ,用 \\ 或 /)
download-path = downloads
# 文件扩展名,支持 epub、txt、html,推荐 epub
Expand Down
4 changes: 2 additions & 2 deletions 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.7.1</version>
<version>1.7.2</version>
<packaging>jar</packaging>

<name>so-novel</name>
Expand Down Expand Up @@ -197,4 +197,4 @@
</resource>
</resources>
</build>
</project>
</project>
3 changes: 1 addition & 2 deletions src/main/java/com/pcdd/sonovel/parse/ChapterParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.pcdd.sonovel.model.ConfigBean;
import com.pcdd.sonovel.model.SearchResult;
import com.pcdd.sonovel.util.CrawlUtils;
import com.pcdd.sonovel.util.ExceptionUtils;
import com.pcdd.sonovel.util.RandomUA;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
Expand Down Expand Up @@ -39,7 +38,7 @@ public ChapterParser(ConfigBean config) {
public Chapter parse(Chapter chapter, CountDownLatch latch, SearchResult sr) {
try {
Console.log("<== 正在下载: 【{}】", chapter.getTitle());
ExceptionUtils.randomThrow();
// ExceptionUtils.randomThrow();
chapter.setContent(crawl(chapter.getUrl(), false));
latch.countDown();
return chapterConverter.convert(chapter, config.getExtName());
Expand Down
46 changes: 46 additions & 0 deletions src/main/resources/rule/rule-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"id": 0,
"url": "",
"name": "",
"comment": "",
"type": "",
"search": {
"url": "",
"method": "",
"body": "{}",
"cookies": "{}",
"pagination": false,
"nextPage": "",
"result": "",
"offset": 0,
"bookName": "",
"author": "",
"latestChapter": "",
"update": ""
},
"book": {
"url": "",
"bookName": "",
"author": "",
"intro": "",
"category": "",
"coverUrl": "",
"latestChapter": "",
"latestUpdate": "",
"isEnd": "",
"catalog": "",
"catalogOffset": 0
},
"chapter": {
"url": "",
"pagination": false,
"nextPage": "",
"chapterNo": 0,
"title": "",
"content": "",
"paragraphTagClosed": false,
"paragraphTag": "",
"filterTxt": "",
"filterTag": ""
}
}
8 changes: 3 additions & 5 deletions src/test/java/com/pcdd/sonovel/JsoupTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
import lombok.SneakyThrows;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class JsoupTest {

/**
* jsoup-1.18.1增加了Response进度事件接口
* https://github.com/jhy/jsoup/pull/2164
* <a href="https://github.com/jhy/jsoup/pull/2164">jsoup-1.18.1增加了Response进度事件接口</a>
*/
@SneakyThrows
public static void main(String[] args) {
Expand All @@ -21,7 +19,7 @@ public static void main(String[] args) {
Console.log(percent + "%");
});

Document document = con.get();
System.out.println(con.response());
}

}
}

0 comments on commit 45b55db

Please sign in to comment.