fix: 修复部分图文作品下载失败的问题

Closes #264
This commit is contained in:
Quan 2025-07-12 22:10:27 +08:00
parent da0dffb890
commit f56046c810
3 changed files with 9 additions and 7 deletions

View File

@ -41,7 +41,7 @@ class Image:
token: str, token: str,
format_: str, format_: str,
) -> str: ) -> str:
return f"https://ci.xiaohongshu.com/{token}?imageView2/format/{format_}" return f"https://ci.xiaohongshu.com/{token}?imageView2/format/{format_}?"
@staticmethod @staticmethod
def __extract_image_token(url: str) -> str: def __extract_image_token(url: str) -> str:

View File

@ -1,8 +1,9 @@
**项目更新内容:** **项目更新内容:**
1. 修改 API 模式默认端口为 `5556` 1. 修复部分图文作品下载失败的问题
2. 优化提取链接的正则表达式 2. 修改 API 模式默认端口为 `5556`
3. 支持音乐图集作品下载 3. 优化提取链接的正则表达式
4. 支持音乐图集作品下载
***** *****
@ -11,4 +12,5 @@
**版本号2.0.2** **版本号2.0.2**
1. 修复单张图片的作品下载后文件损坏问题 1. 修复单张图片的作品下载后文件损坏问题
2. 修复用户脚本 CSS 样式冲突问题 2. 修复部分图文作品下载失败的问题
3. 修复用户脚本 CSS 样式冲突问题

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name XHS-Downloader // @name XHS-Downloader
// @namespace https://github.com/JoeanAmier/XHS-Downloader // @namespace https://github.com/JoeanAmier/XHS-Downloader
// @version 2.0.2 // @version 2.0.3
// @description 提取小红书作品/用户链接,下载小红书无水印图文/视频作品文件 // @description 提取小红书作品/用户链接,下载小红书无水印图文/视频作品文件
// @author JoeanAmier // @author JoeanAmier
// @match http*://xhslink.com/* // @match http*://xhslink.com/*
@ -158,7 +158,7 @@ XHS-Downloader 用户脚本 详细说明:
images.forEach((item) => { images.forEach((item) => {
let match = item.urlDefault.match(regex); let match = item.urlDefault.match(regex);
if (match && match[1]) { if (match && match[1]) {
urls.push(`https://ci.xiaohongshu.com/${match[1]}?imageView2/format/png`); urls.push(`https://ci.xiaohongshu.com/${match[1]}?imageView2/format/png?`);
} }
}) })
return urls return urls