Metadata-Version: 2.5
Name: djhx-bilix
Version: 1.6.0
Summary: Bilibili CLI and desktop downloader with QR login and verified downloads.
Project-URL: Homepage, https://djhx.site/project/bilix.html
Project-URL: Repository, https://github.com/Koril33/bilix
Project-URL: Issues, https://github.com/Koril33/bilix/issues
Project-URL: Documentation, https://github.com/Koril33/bilix/blob/main/README.md
Project-URL: Changelog, https://github.com/Koril33/bilix/blob/main/CHANGELOG.md
License-Expression: GPL-3.0-only
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
License-File: vendor/ffmpeg/COPYING.GPLv2
License-File: vendor/ffmpeg/COPYING.GPLv3
License-File: vendor/ffmpeg/COPYING.LGPLv2.1
License-File: vendor/ffmpeg/COPYING.LGPLv3
License-File: vendor/ffmpeg/toolchain-licenses/GCC-COPYING3.txt
License-File: vendor/ffmpeg/toolchain-licenses/GCC-RUNTIME-EXCEPTION.txt
License-File: vendor/ffmpeg/toolchain-licenses/MinGW-w64-runtime.txt
License-File: vendor/ffmpeg/toolchain-licenses/winpthreads.txt
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Multimedia :: Video
Requires-Python: >=3.11
Requires-Dist: curl-cffi<0.17,>=0.13
Requires-Dist: platformdirs<5,>=4.3
Requires-Dist: pypng>=0.20220715.0
Requires-Dist: qrcode>=8.2
Requires-Dist: rich<16,>=14
Requires-Dist: typer<0.28,>=0.20
Provides-Extra: gui
Requires-Dist: pyside6-essentials==6.11.2; extra == 'gui'
Description-Content-Type: text/markdown

# BiliX

Bilibili 视频下载器，提供命令行及 PySide6 图形界面，支持扫码登录、批量与多 P 下载、清晰度/编码/音轨选择，以及下载后的媒体校验。

[项目主页](https://djhx.site/project/bilix.html) · [GitHub](https://github.com/Koril33/bilix) · [PyPI](https://pypi.org/project/djhx-bilix/) · [Windows 下载](https://github.com/Koril33/bilix/releases) · [更新记录](CHANGELOG.md)

## 项目状态

**1.6.0** 是首个图形界面版本，提供 Windows 10 x64 单文件绿色版、安装版，以及 Ubuntu 22.04/24.04、Debian 12/13 amd64 的 `.deb`。CLI 保留 1.5.0 增加的 Tab 补全与相近指令提示。下载文件与 SHA256 见 [v1.6.0 发行页](https://github.com/Koril33/bilix/releases/tag/v1.6.0)。

Python 包要求 3.11 或更新版本。Windows GUI/CLI 独立程序和 Linux deb 无需安装 Python/Qt；Windows 包内置 FFmpeg，deb 自动安装系统 FFmpeg 依赖。macOS 暂提供 CLI Python 包，GUI 支持后续加入。

## 安装

安装命令行 Python 版本：

```shell
uv tool install djhx-bilix
blx --help
```

也可使用 `pip install djhx-bilix`。`blx` 与 `bilix` 为同一程序的两个命令名；模块入口为 `python -m djhx_bilix`。更新运行 `uv tool upgrade djhx-bilix`。

Windows 从 [GitHub Releases](https://github.com/Koril33/bilix/releases) 下载，并按发行页的 SHA256 校验文件。GUI 绿色版直接运行 EXE，同时保存配套许可证与源码 ZIP；安装版运行 Setup EXE。CLI 解压 ZIP 后，在 PowerShell 当前目录使用 `./bilix.exe`。

Ubuntu/Debian GUI 安装下载的 deb：

```shell
sudo apt install ./djhx-bilix-gui_1.6.0-1_amd64.deb
bilix-gui
```

也可使用 `uv tool install 'djhx-bilix[gui]'` 或 `pip install 'djhx-bilix[gui]'` 安装 GUI，然后运行 `bilix-gui`。Python 方式需自行安装 FFmpeg 并加入 PATH，或在 GUI 设置/CLI `--ffmpeg` 中指定路径。

从源码开发或运行 GUI：

```shell
uv sync --locked --extra gui --group gui-test
uv run --locked --extra gui bilix-gui
```

GUI 与 CLI 共用下载内核、账号和配置。功能流程见[图形版使用说明](docs/gui-usage.md)，源码构建发行文件见[GUI 构建与发行](docs/gui-build-and-release.md)。首版使用手动升级：绿色版退出后替换 EXE，安装版运行新安装器，deb 通过 `apt` 安装新包；用户配置与下载文件独立保存。

## 快速开始

```shell
blx auth login
blx auth status
blx info BV1j4411W7F7
blx download BV1j4411W7F7 --dry-run
blx download BV1j4411W7F7 --save videos -q 1080p
```

用手机 Bilibili App 扫码并确认；凭据保存在用户配置目录。默认选择当前账号实际可获取的最高视频清晰度与 AAC 音轨。清晰度/编码不可用时提示降级；要求精确匹配时使用 `--strict`。

```shell
blx download BV12R4y1J75d --page 1,3,5-7
blx download --file videos.txt --quiet
blx download BV1j4411W7F7 --codec HEVC --audio best
blx config
blx doctor
```

多 P 默认选择全部，含 `?p=2` 的链接默认选择 P2；`--page` 优先于链接。批量文件每行一个 URL/BV 号，支持 UTF-8/BOM、空行与 `#` 注释。

已有同名文件默认跳过；`--overwrite` 在新文件完成下载、校验与合并后才替换旧文件。失败保留 `.bilix-*` 临时材料，返回非零退出码。详细参数见 `blx download --help` 与 [用法说明](docs/usage.md)。

## 终端体验

1.5.0 支持 Bash、Zsh、Fish、Windows PowerShell 5.1 与 PowerShell 7 的 Tab 补全，覆盖命令、参数、清晰度、编码、音轨和本地路径。PowerShell 当前会话可这样启用：

```powershell
blx completion powershell | Out-String | Invoke-Expression
```

`blx donwload` 会提示相近的 `download`，参数解析错误返回退出码 `2`。启用方式、持久配置与排错见 [补全说明](docs/completion.md)。

## 文档

| 内容 | 文档 |
| --- | --- |
| 命令、下载参数、配置与退出码 | [使用说明](docs/usage.md) |
| 扫码登录、账号权限与排错 | [账号说明](docs/accounts.md) |
| shell 补全与指令纠错 | [终端体验](docs/completion.md) |
| 模块职责与下载事务 | [架构说明](docs/architecture.md) |
| 图形版安装、下载与操作 | [GUI 使用说明](docs/gui-usage.md) |
| GUI 技术与版本选择 | [GUI 技术评估](docs/gui-technology-evaluation.md) |
| Windows/Linux 发行方式与升级方案 | [GUI 发行调研](docs/gui-distribution-and-updates.md) |
| GUI 本地构建和打包 | [GUI 构建与发行](docs/gui-build-and-release.md) |
| Ubuntu/Debian 虚拟机验收 | [Linux 测试矩阵](docs/gui-vm-validation.md) |
| Windows 10 虚拟机验收 | [Windows 测试流程](docs/gui-win10-validation.md) |
| 本地开发、测试与构建 | [构建说明](docs/build.md) |
| 版本、产物、校验与发布 | [发布说明](docs/releasing.md) |
| 旧版本与兼容入口 | [迁移说明](docs/releases.md) |
| 贡献代码或报告问题 | [贡献指南](CONTRIBUTING.md) |
| 安全报告与凭据保护 | [安全政策](SECURITY.md) |
| 依赖与 FFmpeg 分发材料 | [第三方声明](THIRD_PARTY_NOTICES.md) |

项目页面源码为 [site/bilix.html](site/bilix.html)，沿用线上布局与背景图，更新当前命令说明。CSS、背景图与脚本内嵌，无需构建；版本查询失败时仍保留发行页链接。发布时复制到现有网站的 `/project/bilix.html`，见 [页面维护说明](site/README.md)。

## 开发

```shell
uv sync --locked
uv run blx --help
uv run ruff check src tests scripts
uv run ruff format --check src tests scripts
uv run pytest -q
```

GUI 测试需要 `uv sync --locked --extra gui --group gui-test`；无桌面的环境可设置 `QT_QPA_PLATFORM=offscreen`。GUI 发行文件依目标平台分别构建，不把 Windows 编译结果当作 Linux 验证。

唯一业务实现位于 `src/djhx_bilix`。项目使用本地检查与手动发布，不运行 GitHub/Gitea Actions。发布前须完成 [发布说明](docs/releasing.md) 中的凭据、源码与产物检查。

## 许可与使用边界

项目采用 [GPL-3.0-only](LICENSE)，使用、修改与再分发遵循其条款。软件许可与视频内容的版权、平台授权属于不同事项。

仅下载你拥有访问与保存权限的内容，遵守所在地法律、版权要求与平台条款。程序不绕过账号权限、单独购买权限或 DRM；试看媒体明确拒绝下载。软件按许可证提供，不作担保。

扫码凭据、Cookie、二维码链接与签名媒体地址不应出现在公开问题、日志或提交中。见 [安全政策](SECURITY.md)。

## 致谢

项目参考了 [Bilibili API 资料](https://socialsisteryi.github.io/bilibili-API-collect/)、[BBDown](https://github.com/nilaoda/BBDown) 和 [早期实现](https://blog.csdn.net/weixin_47481982/article/details/127666941)。原图标保存在 [docs/assets](docs/assets/bilix-icon.jpg)。本项目并非 Bilibili 官方产品。
