From caf106c3f899342411000981cd86da22cac1fdea Mon Sep 17 00:00:00 2001 From: XuanRan_Nyan <31968665+xxxxuanran@users.noreply.github.com> Date: Sun, 21 Dec 2025 21:03:52 +0800 Subject: [PATCH] Fix(Huya): refactor anticode generation using getCdnTokenInfoEx API (#1575) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix(Huya): refactor anticode generation using getCdnTokenInfoEx API * chore: cleanup * chore: get random sHuYaUA * chore: 代码复用 --- app/(app)/dashboard/page.tsx | 2 +- app/(app)/logviewer/page.tsx | 19 +- app/ui/Player.tsx | 15 +- biliup/plugins/huya.py | 486 +-- biliup/plugins/huya_wup/packet/__init__.py | 12 +- biliup/plugins/huya_wup/packet/__util.py | 42 +- .../plugins/huya_wup/packet/getCdnTokenEx.py | 60 + .../huya_wup/packet/getCdnTokenInfo.py | 74 - .../plugins/huya_wup/packet/getLivingInfo.py | 60 - biliup/plugins/huya_wup/test_wup.py | 47 - biliup/plugins/huya_wup/wup.py | 1 + .../huya_wup/wup_struct/BeginLiveNotice.py | 134 - .../huya_wup/wup_struct/MultiStreamInfo.py | 27 - .../plugins/huya_wup/wup_struct/StreamInfo.py | 69 - .../wup_struct/StreamSettingNotice.py | 34 - biliup/plugins/huya_wup/wup_struct/UserId.py | 18 +- .../plugins/huya_wup/wup_struct/WSUserInfo.py | 2 +- .../huya_wup/wup_struct/WebSocketCommand.py | 7 +- package-lock.json | 3677 +++++++++++------ package.json | 6 +- 20 files changed, 2801 insertions(+), 1991 deletions(-) create mode 100644 biliup/plugins/huya_wup/packet/getCdnTokenEx.py delete mode 100644 biliup/plugins/huya_wup/packet/getCdnTokenInfo.py delete mode 100644 biliup/plugins/huya_wup/packet/getLivingInfo.py delete mode 100644 biliup/plugins/huya_wup/test_wup.py delete mode 100644 biliup/plugins/huya_wup/wup_struct/BeginLiveNotice.py delete mode 100644 biliup/plugins/huya_wup/wup_struct/MultiStreamInfo.py delete mode 100644 biliup/plugins/huya_wup/wup_struct/StreamInfo.py delete mode 100644 biliup/plugins/huya_wup/wup_struct/StreamSettingNotice.py diff --git a/app/(app)/dashboard/page.tsx b/app/(app)/dashboard/page.tsx index 4d4c82e..f33b750 100644 --- a/app/(app)/dashboard/page.tsx +++ b/app/(app)/dashboard/page.tsx @@ -191,7 +191,7 @@ const Dashboard: React.FC = () => { {Object.entries(plugins) .filter(([key]) => key !== 'Cookie') .map(([key, Plugin]) => ( - + ))} diff --git a/app/(app)/logviewer/page.tsx b/app/(app)/logviewer/page.tsx index 6c4c23f..2c8c5d9 100644 --- a/app/(app)/logviewer/page.tsx +++ b/app/(app)/logviewer/page.tsx @@ -17,14 +17,6 @@ interface LogContentProps { } const LogContent = ({ logs, logContainerRef, isLoading }: LogContentProps) => { - if (isLoading) { - return ( -
- -
- ) - } - // 判断滚动条是否接近底部 const isScrolledToBottom = () => { const containers = document.getElementsByClassName('log-container'); @@ -53,6 +45,14 @@ const LogContent = ({ logs, logContainerRef, isLoading }: LogContentProps) => { } }, [logs]); + if (isLoading) { + return ( +
+ +
+ ) + } + return (
{ @@ -211,7 +212,7 @@ export default function LogViewer() { activeKey={activeTab} onChange={handleFileChange} tabBarExtraContent={ -
+