From 728f05b4bf2c00469d95f5965ebe0d82374ec906 Mon Sep 17 00:00:00 2001 From: Quan Date: Sat, 31 Jan 2026 16:52:42 +0800 Subject: [PATCH] =?UTF-8?q?chore(app):=20=E4=BC=98=E5=8C=96=E5=8F=AF?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=96=87=E4=BB=B6=E6=9E=84=E5=BB=BA=E5=91=BD?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Manually_build_executable_programs.yml | 4 ++-- .github/workflows/Release_build_executable_program.yml | 4 ++-- README.md | 3 +-- README_EN.md | 3 +-- source/application/video.py | 6 ++++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Manually_build_executable_programs.yml b/.github/workflows/Manually_build_executable_programs.yml index b63c98e..33916ee 100644 --- a/.github/workflows/Manually_build_executable_programs.yml +++ b/.github/workflows/Manually_build_executable_programs.yml @@ -30,14 +30,14 @@ jobs: if: runner.os == 'Windows' run: | echo "DATE=$(Get-Date -Format 'yyyyMMdd')" >> $env:GITHUB_ENV - pyinstaller --icon=./static/XHS-Downloader.ico --add-data "static:static" --add-data "locale:locale" --collect-all fastmcp --runtime-hook ./source/expansion/pyi_rth_beartype.py main.py + pyinstaller --icon=./static/XHS-Downloader.ico --add-data "static:static" --add-data "locale:locale" --collect-all fastmcp --collect-all rich --runtime-hook ./source/expansion/pyi_rth_beartype.py main.py shell: pwsh - name: 构建 Mac 可执行文件 if: runner.os == 'macOS' run: | echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV - pyinstaller --icon=./static/XHS-Downloader.icns --add-data "static:static" --add-data "locale:locale" --collect-all fastmcp --runtime-hook ./source/expansion/pyi_rth_beartype.py main.py + pyinstaller --icon=./static/XHS-Downloader.icns --add-data "static:static" --add-data "locale:locale" --collect-all fastmcp --collect-all rich --runtime-hook ./source/expansion/pyi_rth_beartype.py main.py - name: 上传文件 uses: actions/upload-artifact@v4 diff --git a/.github/workflows/Release_build_executable_program.yml b/.github/workflows/Release_build_executable_program.yml index c385a60..e7368e0 100644 --- a/.github/workflows/Release_build_executable_program.yml +++ b/.github/workflows/Release_build_executable_program.yml @@ -34,13 +34,13 @@ jobs: - name: 构建 Win 可执行文件 if: runner.os == 'Windows' run: | - pyinstaller --icon=./static/XHS-Downloader.ico --add-data "static:static" --add-data "locale:locale" --collect-all fastmcp --runtime-hook ./source/expansion/pyi_rth_beartype.py main.py + pyinstaller --icon=./static/XHS-Downloader.ico --add-data "static:static" --add-data "locale:locale" --collect-all fastmcp --collect-all rich --runtime-hook ./source/expansion/pyi_rth_beartype.py main.py shell: pwsh - name: 构建 Mac 可执行文件 if: runner.os == 'macOS' run: | - pyinstaller --icon=./static/XHS-Downloader.icns --add-data "static:static" --add-data "locale:locale" --collect-all fastmcp --runtime-hook ./source/expansion/pyi_rth_beartype.py main.py + pyinstaller --icon=./static/XHS-Downloader.icns --add-data "static:static" --add-data "locale:locale" --collect-all fastmcp --collect-all rich --runtime-hook ./source/expansion/pyi_rth_beartype.py main.py - name: 创建压缩包 run: | diff --git a/README.md b/README.md index 00b6169..23d3557 100644 --- a/README.md +++ b/README.md @@ -96,8 +96,7 @@
  • 运行 python .\main.py 或者 python main.py 命令启动 XHS-Downloader
    1. 使用 uv 安装项目依赖(推荐) -
    2. 运行 uv venv 命令创建虚拟环境
    3. -
    4. 运行 uv sync 命令同步环境依赖
    5. +
    6. 运行 uv sync --no-dev 命令同步环境依赖
    7. 运行 uv run main.py 命令启动 XHS-Downloader
    diff --git a/README_EN.md b/README_EN.md index cbde0fa..f5e6a15 100644 --- a/README_EN.md +++ b/README_EN.md @@ -97,8 +97,7 @@
  • Run the command python .\main.py or python main.py to start XHS-Downloader
    1. Install project dependencies using uv (recommended) -
    2. Run the command uv venv to create a virtual environment
    3. -
    4. Run the command uv sync to synchronize environment dependencies
    5. +
    6. Run the command uv sync --no-dev to synchronize environment dependencies
    7. Run the command uv run main.py to start XHS-Downloader
    diff --git a/source/application/video.py b/source/application/video.py index e7ac35a..b0cbdb2 100644 --- a/source/application/video.py +++ b/source/application/video.py @@ -38,8 +38,10 @@ class Video: match preference: case "resolution": items.sort(key=lambda x: x.height) - case "bitrate" | "size": - items.sort(key=lambda x: x.preference) + case "bitrate": + items.sort(key=lambda x: x.videoBitrate) + case "size": + items.sort(key=lambda x: x.size) case _: raise ValueError(f"Invalid video preference value: {preference}") return [b[0]] if (b := items[-1].backupUrls) else [items[-1].masterUrl]