From 2d913af70db4e0a2ba5cc5aaa723141ea5ba8a16 Mon Sep 17 00:00:00 2001 From: ltaoo Date: Wed, 21 Jan 2026 23:09:05 +0800 Subject: [PATCH] fix: can't batch downloads when live video is present --- internal/interceptor/inject/src/utils.js | 31 ++++++++++++++++++------ pkg/platform/platform_windows.go | 2 -- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/internal/interceptor/inject/src/utils.js b/internal/interceptor/inject/src/utils.js index ad0b84c..97c6d64 100644 --- a/internal/interceptor/inject/src/utils.js +++ b/internal/interceptor/inject/src/utils.js @@ -98,12 +98,29 @@ var WXU = (() => { // id: feed.id, title: feed.description || "直播", url: feed.liveInfo.streamUrl, - cover_url: feed.anchorContact.liveCoverImgUrl, - contact: { - id: feed.anchorContact.username, - avatar_url: feed.anchorContact.headUrl, - nickname: feed.anchorContact.nickname, - }, + cover_url: (() => { + if (feed.anchorContact) { + return feed.anchorContact.liveCoverImgUrl; + } + if (feed.objectDesc) { + return feed.objectDesc.media[0]?.coverUrl; + } + return ""; + })(), + contact: (() => { + if (feed.anchorContact) { + return { + id: feed.anchorContact.username, + avatar_url: feed.anchorContact.headUrl, + nickname: feed.anchorContact.nickname, + }; + } + return { + id: feed.contact.username, + nickname: feed.contact.nickname, + avatar_url: feed.contact.headUrl, + }; + })(), }; } if (!feed.objectDesc) { @@ -283,7 +300,7 @@ var WXU = (() => { params.author = profile.contact.nickname; } if (spec) { - var matched = profile.spec.find((item) => item.fileFormat === spec); + var matched = profile.spec?.find((item) => item.fileFormat === spec); if (matched) { params.spec = matched.fileFormat; } diff --git a/pkg/platform/platform_windows.go b/pkg/platform/platform_windows.go index f0e68f6..3a770dc 100644 --- a/pkg/platform/platform_windows.go +++ b/pkg/platform/platform_windows.go @@ -3,7 +3,6 @@ package platform import ( - "fmt" "os" "runtime" "syscall" @@ -24,7 +23,6 @@ func is_admin() bool { } func need_admin_permission() bool { args := os.Args[1:] - fmt.Println(args) if len(args) == 0 { return true }