From 78a5ac6e00ded7a7a14025be6683c331fc8dada4 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 10 Sep 2022 16:30:56 +0800 Subject: Update README.md: add example usages. --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index b6489e0..72b42a3 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,65 @@ If you want a Bilibili recorder featured with: Then you should give SLBR *(suck-less bilibili live recorder)* a try. +## Example usage + +### Using config file + +```json5 +{ + "tasks": [ + { + // ID of the live room which the task records + "room_id": 1234, + "download": { + // buffer 16MiB data before flushing to disk + "disk_write_buffer_bytes": 16777216, + // "." is the default value, you can skip this line + "save_directory": "." + }, + "transport": { + // try ipv4 firstly, then ipv6 + "allowed_network_types": [ + "tcp4", + "tcp6" + ] + } + } + ] +} +``` + +### Using command line arguments + +Record live room with `1234` to current working directory: + +```shell +./slbr -s 1234 -o . +``` + +For more usages, run `slbr -h` to get the help menu. Here is a copy (may become outdated): + +``` +usage: slbr [-h|--help] [-c|--config ""] [-s|--room] [-o|--save-to + ""] [-b|--disk-write-buffer ] + + Record bilibili live streams + +Arguments: + + -h --help Print help information + -c --config Specify which configuration file to use. JSON, TOML + and YAML are all supported + -s --room Specify which room to record. The ID is included in + bilibili live webpage url. Set this to run without + config file + -o --save-to Specify the directory where to save records. If not + set, process working directory is used + -b --disk-write-buffer Specify disk write buffer size (bytes). The real + minimum buffer size is determined by OS. Default: + 4194304 +``` + ## The project name is too offensive! You can call it *Simple Lightweight Bilibili live Recorder*. It's all up to you. -- cgit v1.2.3