> bilibili-live-cli
Personal tool for viewing 弾幕 and other utils in bilibili live streaming.
Why
It will cost too much CPU to open a browser when playing osu!, where the performance of CPU matters when the beatmap becomes more difficult and you need at least 240 FPS to play well.
The main goal of this tool is to provide a cheap way to interact with bilibili live streaming without hurting the game's performance. If you want a better API library, see credits.
Install
You don't have to install it if you have npx
,
npx @hyrious/blivec ...args
Or you can choose to install it globally, which will give you a shortcut name bl
,
npm i -g @hyrious/blivec
bl ...args
Usage
Listen Danmaku
bl <room_id> [--json]
Send Danmaku
bl <room_id> <message>
This command requires a cookie file named cookie.txt
to be put at the current working directory or at your home folder.
Get Stream URL
bl get <room_id> [--json]
DD Mode
bl d <room_id> [--mpv] [--interval=1] [--on-close=quit] [-- ...player_args]
Use ffplay
or mpv
(if --mpv
is specified) to play the stream. If it is not available, wait interval minutes and try again.
--mpv
: Use mpv
instead of ffplay
.--interval=<minutes>
: Wait minutes before trying again. Default is 1 minute.--on-close=<action>
: What to do when the player window is closed.
default
: Restart the player. This is super useful when there is network errors and you don't have to touch the keyboard or mouse to keep watching the stream.quit
: Quit the whole program.ask
: Search stream URLs and ask you for a new one to play or just quit. This is useful when you want to switch the stream quality quickly.
Develop
PR & issues are welcome!
Credits
License
MIT @ hyrious