From 688f1aed2453747430d59b5eb78f0c200ed1742a Mon Sep 17 00:00:00 2001 From: freeok <51998152+freeok@users.noreply.github.com> Date: Tue, 19 Nov 2024 06:33:11 +0800 Subject: [PATCH] :tada: Release v1.6.2 --- .github/workflows/release.yml | 2 ++ input/readme.txt | 10 ++++++---- pom.xml | 8 +++++--- src/main/java/com/pcdd/sonovel/core/Crawler.java | 2 +- src/main/java/com/pcdd/sonovel/parse/BookParser.java | 8 +++++++- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fbe5daa..c1f631c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,8 @@ jobs: with: distribution: 'corretto' java-version: '17' + # 启用 Maven 依赖缓存,以提高构建速度 + cache: 'maven' - name: Build executable shell: powershell run: | diff --git a/input/readme.txt b/input/readme.txt index ffdb32b..cdc6c10 100644 --- a/input/readme.txt +++ b/input/readme.txt @@ -1,15 +1,17 @@ Windows 用户 运行 exe 文件启动 -macOS +macOS 用户 运行 macos-run.sh 启动 Linux 用户 运行 linux-run.sh 启动 提示: -1. config.ini 是配置文件,下载格式在此修改,保存后重新运行 exe 才能生效 -2. 请按照要求输入内容,若不按要求输入则无法正常工作 -3. 若书源失效,请 New issue (https://github.com/freeok/so-novel/issues) +1. 将终端窗口最大化,使用体验更佳 +2. config.ini 是配置文件,下载格式在此修改,保存后重新运行 exe 生效 +3. 按 Tab 键选择功能(Tab 可连按),然后按 Enter 键确认执行 +4. 请按照要求输入内容,若不按要求输入则无法正常工作 +5. 若书源失效,请 New issue (https://github.com/freeok/so-novel/issues) 最新版下载地址:https://github.com/freeok/so-novel/releases \ No newline at end of file diff --git a/pom.xml b/pom.xml index 79e2240..7b291ec 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.pcdd so-novel - 1.6.1 + 1.6.2 jar so-novel @@ -21,8 +21,10 @@ 17 3.27.1 - - ${java.version} + + + ${java.version} + ${java.version} UTF-8 UTF-8 diff --git a/src/main/java/com/pcdd/sonovel/core/Crawler.java b/src/main/java/com/pcdd/sonovel/core/Crawler.java index 0b1b984..d7131dc 100644 --- a/src/main/java/com/pcdd/sonovel/core/Crawler.java +++ b/src/main/java/com/pcdd/sonovel/core/Crawler.java @@ -169,7 +169,7 @@ private static String generatePath(Chapter chapter) { // Windows 文件名非法字符替换 + "_" + chapter.getTitle().replaceAll("[\\\\/:*?<>]", "") + "." + extName; - default -> throw new IllegalStateException("不支持的下载格式: " + EXT_NAME); + default -> throw new IllegalStateException("暂不支持的下载格式: " + EXT_NAME); }; } diff --git a/src/main/java/com/pcdd/sonovel/parse/BookParser.java b/src/main/java/com/pcdd/sonovel/parse/BookParser.java index 2e8b2be..ec37770 100644 --- a/src/main/java/com/pcdd/sonovel/parse/BookParser.java +++ b/src/main/java/com/pcdd/sonovel/parse/BookParser.java @@ -62,7 +62,13 @@ public static String replaceCover(Book book) { for (Element e : elements) { String name = e.select(".book-mid-info > .book-info-title > a").text(); - String author = e.select(".book-mid-info > .author > i").text(); + // 起点作者 + String author1 = e.select(".book-mid-info > .author > .name").text(); + // 非起点作者 + String author2 = e.select(".book-mid-info > .author > i").text(); + String author = author1.isEmpty() ? author2 : author1; + + System.out.println(name + " " + author); if (book.getBookName().equals(name) && book.getAuthor().equals(author)) { String coverUrl = e.select(".book-img-box > a > img").attr("src");