mirror of
https://github.com/saveweb/biliarchiver.git
synced 2024-09-19 11:05:28 -07:00
Use bilix to download BiliBili video and upload to the Internet Archive with metadata and danmaku.
0bc8ce39f8
The code changes add new API endpoints for archiving videos from user, favlist, and collection sources. It includes the necessary functions to run the corresponding commands and process the output. This feature enhances the functionality of the application by allowing users to easily archive videos from different sources. |
||
---|---|---|
.github/workflows | ||
.vscode | ||
biliarchiver | ||
.gitattributes | ||
.gitignore | ||
bilibili-archive-checker.user.js | ||
build.py | ||
LICENSE | ||
poetry.lock | ||
pyproject.toml | ||
README.md | ||
requirements.txt |
biliarchiver
Archiving tool for Bilibili based on bilix
Install
pip install biliarchiver
Usage
biliarchiver --help
Basic usage
Follow these steps to start archiving:
- Initialize a new workspace in current working directory:
biliarchiver init
- Provide cookies and tokens following instructions:
biliarchiver auth
- 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
.
- 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
- Start server
biliarchiver api
- 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