chore(app): 优化可执行文件构建命令

This commit is contained in:
Quan
2026-01-31 16:52:42 +08:00
parent fcb58e3c44
commit 728f05b4bf
5 changed files with 10 additions and 10 deletions

View File

@@ -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

View File

@@ -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: |

View File

@@ -96,8 +96,7 @@
<li>运行 <code>python .\main.py</code> 或者 <code>python main.py</code> 命令启动 XHS-Downloader</li>
</ol>
<ol><b>使用 uv 安装项目依赖(推荐)</b>
<li>运行 <code>uv venv</code> 命令创建虚拟环境</li>
<li>运行 <code>uv sync</code> 命令同步环境依赖</li>
<li>运行 <code>uv sync --no-dev</code> 命令同步环境依赖</li>
<li>运行 <code>uv run main.py</code> 命令启动 XHS-Downloader</li>
</ol>
</ol>

View File

@@ -97,8 +97,7 @@
<li>Run the command <code>python .\main.py</code> or <code>python main.py</code> to start XHS-Downloader</li>
</ol>
<ol><b>Install project dependencies using uv (recommended)</b>
<li>Run the command <code>uv venv</code> to create a virtual environment</li>
<li>Run the command <code>uv sync</code> to synchronize environment dependencies</li>
<li>Run the command <code>uv sync --no-dev</code> to synchronize environment dependencies</li>
<li>Run the command <code>uv run main.py</code> to start XHS-Downloader</li>
</ol>
</ol>

View File

@@ -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]