Use bilix to download BiliBili video and upload to the Internet Archive with metadata and danmaku.
Go to file
2023-08-17 04:43:02 +08:00
.github/workflows CI: install gettext 2023-08-17 04:39:55 +08:00
.vscode feat(i18n): add en locale 2023-08-17 02:56:03 +08:00
biliarchiver chore: build system 2023-08-17 04:29:14 +08:00
.gitignore feat(i18n): add en locale 2023-08-17 02:56:03 +08:00
bilibili-archive-checker.user.js refactor: better --bvids and lint 2023-08-13 23:57:54 +08:00
build.py chore: build system 2023-08-17 04:29:14 +08:00
poetry.lock refactor: better --bvids and lint 2023-08-13 23:57:54 +08:00
pyproject.toml bump 0.1.1 2023-08-17 04:43:02 +08:00
README.md feat(i18n): detect system language 2023-08-17 03:17:56 +08:00
requirements.txt feat: 使用 browser-cookie3 从浏览器加载 cookies 2023-07-07 00:55:13 +08:00

biliarchiver

基于 bilix 的 BiliBili 存档工具

Install

pip install biliarchiver

Usage

biliarchiver --help

Follow these steps to start archiving:

  1. Initialize a new workspace in current working directory:
biliarchiver init
  1. Provide cookies and tokens following instructions:
biliarchiver auth
  1. Download videos from BiliBili:
biliarchiver down --bvids BVXXXXXXXXX
  • This command also accepts a list of BVIDs or path to a file. Details can be found in biliarchiver down --help.
  1. Upload videos to Internet Archive:
biliarchiver up --bvids BVXXXXXXXXX
  • This command also accepts a list of BVIDs or path to a file. Details can be found in biliarchiver up --help.

Develop

Install

Please use poetry to install dependencies:

poetry install

Build English locale if necessary. Refer to the last section for details.

Run

poetry run biliarchiver --help

Lint

poetry run ruff check .

i18n

To generate and build locales, you need a GNU gettext compatible toolchain. You can install mingw and use sh to enter a bash shell on Windows.

Generate biliarchiver.pot:

find biliarchiver/ -name '*.py' | xargs xgettext -d base -o biliarchiver/locales/biliarchiver.pot

Add a new language:

msginit -i biliarchiver/locales/biliarchiver.pot -o en.po -l en

Update a language:

pnpx gpt-po sync --po biliarchiver/locales/en/LC_MESSAGES/biliarchiver.po --pot biliarchiver/locales/biliarchiver.pot

(Important) Build a language:

msgfmt biliarchiver/locales/en/LC_MESSAGES/biliarchiver.po -o biliarchiver/locales/en/LC_MESSAGES/biliarchiver.mo