Use bilix to download BiliBili video and upload to the Internet Archive with metadata and danmaku.
Go to file
ᡥᠠᡳᡤᡳᠶᠠ ᡥᠠᠯᠠ·ᠨᡝᡴᠣ 猫 53c08488fc
fix: catch OSError when string is too long
`OSError: [Errno 36] File name too long`
2024-07-07 04:26:59 +08:00
.github/workflows chore: Refactor import statements to avoid ci fail & update CI 2023-08-29 14:11:05 +08:00
.vscode chore: CRLF to LR 2024-06-15 15:42:49 +08:00
biliarchiver fix: catch OSError when string is too long 2024-07-07 04:26:59 +08:00
.gitattributes chore: CRLF to LR 2024-06-15 15:42:49 +08:00
.gitignore chore: Add queue.txt to .gitignore 2024-06-13 22:56:04 +08:00
bilibili-archive-checker.user.js If BASEURL === "", ask the user to add the BASEURL 2024-01-27 15:24:56 +08:00
build.py build.py: publish to pypi 2023-08-17 04:52:15 +08:00
LICENSE Create LICENSE 2024-04-06 15:45:56 +08:00
poetry.lock dependencies: update 2024-06-16 00:37:06 +08:00
pyproject.toml bump 0.1.12 2024-06-16 00:38:33 +08:00
README.md dependencies: re-lock 2024-02-17 03:49:31 +08:00
requirements.txt feat(api): initial 2023-10-30 23:40:58 +08:00

biliarchiver

Archiving tool for Bilibili based on bilix

PyPI version

Install

pip install biliarchiver

Usage

biliarchiver --help

Basic usage

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.

Rest API

  1. Start server
biliarchiver api
  1. Add videos
curl -X PUT -H "Content-Type: application/json" http://127.0.0.1:8000/archive/BVXXXXXX

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

Debug using another workspace:

poetry --directory /path/to/workspace 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 or update 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