From 9ad005c381eeb7dc3c3ff72db61371d0cb708e92 Mon Sep 17 00:00:00 2001 From: Quan Date: Sun, 10 Aug 2025 00:04:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(script):=20=E6=B7=BB=E5=8A=A0=E6=9C=AA?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=8A=B6=E6=80=81=E4=B8=8B=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=8F=90=E5=8F=96=E4=BD=9C=E5=93=81=E9=93=BE=E6=8E=A5=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/Release_Notes.md | 9 +++++---- static/XHS-Downloader.js | 8 +++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/static/Release_Notes.md b/static/Release_Notes.md index 2e6738b..8337840 100644 --- a/static/Release_Notes.md +++ b/static/Release_Notes.md @@ -18,9 +18,10 @@ **用户脚本更新内容:** -**版本号:2.1.1** +**版本号:2.1.2** 1. 修复单张图片的作品下载后文件损坏问题 -2. 脚本设置新增 `菜单始终显示` 配置项 -3. 修复用户脚本 CSS 样式冲突问题 -4. 优化提取作品 ID 的正则表达式 +2. 添加未登录状态下无法提取作品链接的提示 +3. 脚本设置新增 `菜单始终显示` 配置项 +4. 修复用户脚本 CSS 样式冲突问题 +5. 优化提取作品 ID 的正则表达式 diff --git a/static/XHS-Downloader.js b/static/XHS-Downloader.js index 37d216a..55f3095 100644 --- a/static/XHS-Downloader.js +++ b/static/XHS-Downloader.js @@ -1,7 +1,7 @@ // ==UserScript== // @name XHS-Downloader // @namespace https://github.com/JoeanAmier/XHS-Downloader -// @version 2.1.1 +// @version 2.1.2 // @description 提取小红书作品/用户链接,下载小红书无水印图文/视频作品文件 // @author JoeanAmier // @match http*://xhslink.com/* @@ -510,11 +510,17 @@ XHS-Downloader 用户脚本 详细说明: const generateUserUrls = data => data.map(id => `https://www.xiaohongshu.com/user/profile/${id}`).join(" "); + const invalidDetection = data => data.every(([first]) => Boolean(first)); + const extractAllLinks = (callback, order) => { scrollScreenEvent(() => { let data; if (order >= 0 && order <= 2) { data = extractNotesInfo(order); + if (!invalidDetection(data)) { + alert("提取作品链接失败!受平台限制,未登录状态下无法通过账号主页浏览作品!"); + return; + } } else if (order === 3) { data = extractSearchNotes(); } else if (order === 4) {