fix(script): 修复视频作品下载功能

This commit is contained in:
Quan
2026-01-06 13:10:07 +08:00
parent aa183effe9
commit 42d77af735
2 changed files with 12 additions and 4 deletions

View File

@@ -11,9 +11,10 @@
**用户脚本更新内容:**
**版本号2.2.3**
**版本号2.2.4**
1. 新增链接提取/图片下载选择模式开关
2. 修复合辑作品链接提取失败的问题
3. 链接提取选择界面添加序号显示
4. 新增推送下载任务至服务器功能
5. 修复视频作品下载功能

View File

@@ -2,7 +2,7 @@
// @name XHS-Downloader
// @namespace xhs_downloader
// @homepage https://github.com/JoeanAmier/XHS-Downloader
// @version 2.2.3
// @version 2.2.4
// @tag 小红书
// @tag RedNote
// @description 提取小红书作品/用户链接,下载小红书无水印图文/视频作品文件
@@ -219,10 +219,17 @@ KS-Downloader快手、KuaiShouhttps://github.com/JoeanAmier/KS-Download
}
const generateVideoUrl = note => {
// try {
// return [`https://sns-video-bd.xhscdn.com/${note.video.consumer.originVideoKey}`];
// } catch (error) {
// console.error("Error generating video URL:", error);
// return [];
// }
try {
return [`https://sns-video-bd.xhscdn.com/${note.video.consumer.originVideoKey}`];
const video = note.video.media.stream.h265;
return [video[video.length - 1].masterUrl];
} catch (error) {
console.error("Error generating video URL:", error);
console.error("Error extract video URL:", error);
return [];
}
};