{"id":13431269,"url":"https://github.com/acgnhiki/blrec","last_synced_at":"2026-01-14T07:36:29.829Z","repository":{"id":38397546,"uuid":"395188794","full_name":"acgnhiki/blrec","owner":"acgnhiki","description":"Bilibili Live Streaming Recorder  哔哩哔哩直播录制","archived":false,"fork":false,"pushed_at":"2025-06-03T14:53:51.000Z","size":4913,"stargazers_count":687,"open_issues_count":131,"forks_count":60,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-09-21T03:53:20.321Z","etag":null,"topics":["angular","bilibili","danmaku","flv","live","python3","recorder","streaming"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acgnhiki.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://afdian.net/@acgnhiki"]}},"created_at":"2021-08-12T04:00:16.000Z","updated_at":"2025-09-20T15:43:30.000Z","dependencies_parsed_at":"2024-02-17T03:31:08.129Z","dependency_job_id":"38917c4f-d6f4-4ed5-be67-52fe7c990fc9","html_url":"https://github.com/acgnhiki/blrec","commit_stats":{"total_commits":133,"total_committers":6,"mean_commits":"22.166666666666668","dds":"0.15037593984962405","last_synced_commit":"c042c737ceed9fd5c3c6148ddc7bb43558370272"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/acgnhiki/blrec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acgnhiki%2Fblrec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acgnhiki%2Fblrec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acgnhiki%2Fblrec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acgnhiki%2Fblrec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acgnhiki","download_url":"https://codeload.github.com/acgnhiki/blrec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acgnhiki%2Fblrec/sbom","scorecard":{"id":162635,"data":{"date":"2025-08-11","repo":{"name":"github.com/acgnhiki/blrec","commit":"47f16f2c4a6b7fc43344bef29393390310f87f23"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 4/29 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":3,"reason":"4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/docker-hub.yml:1","Warn: no topLevel permission defined: .github/workflows/ghcr.yml:1","Warn: no topLevel permission defined: .github/workflows/portable.yml:1","Warn: no topLevel permission defined: .github/workflows/pypi.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v2.0.0-beta.5 not signed: https://api.github.com/repos/acgnhiki/blrec/releases/222787007","Warn: release artifact v2.0.0-beta.4 not signed: https://api.github.com/repos/acgnhiki/blrec/releases/161659835","Warn: release artifact v2.0.0-beta.3 not signed: https://api.github.com/repos/acgnhiki/blrec/releases/135012604","Warn: release artifact v2.0.0-beta.2 not signed: https://api.github.com/repos/acgnhiki/blrec/releases/128017743","Warn: release artifact v2.0.0-beta.1 not signed: https://api.github.com/repos/acgnhiki/blrec/releases/126139725","Warn: release artifact v2.0.0-beta.5 does not have provenance: https://api.github.com/repos/acgnhiki/blrec/releases/222787007","Warn: release artifact v2.0.0-beta.4 does not have provenance: https://api.github.com/repos/acgnhiki/blrec/releases/161659835","Warn: release artifact v2.0.0-beta.3 does not have provenance: https://api.github.com/repos/acgnhiki/blrec/releases/135012604","Warn: release artifact v2.0.0-beta.2 does not have provenance: https://api.github.com/repos/acgnhiki/blrec/releases/128017743","Warn: release artifact v2.0.0-beta.1 does not have provenance: https://api.github.com/repos/acgnhiki/blrec/releases/126139725"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/docker-hub.yml:10"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docker-hub.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/docker-hub.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker-hub.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/docker-hub.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/docker-hub.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/docker-hub.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker-hub.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/docker-hub.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/docker-hub.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/docker-hub.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ghcr.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/ghcr.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ghcr.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/ghcr.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ghcr.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/ghcr.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ghcr.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/ghcr.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ghcr.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/ghcr.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/portable.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/portable.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/portable.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/portable.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/portable.yml:92: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/portable.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pypi.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/pypi.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pypi.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/pypi.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pypi.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/acgnhiki/blrec/pypi.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:3: pin your Docker image by updating python:3.11-slim-buster to python:3.11-slim-buster@sha256:c46b0ae5728c2247b99903098ade3176a58e274d9c7d2efeaaab3e0621a53935","Warn: containerImage not pinned by hash: Dockerfile.mirrors:3: pin your Docker image by updating python:3.11-slim-buster to python:3.11-slim-buster@sha256:c46b0ae5728c2247b99903098ade3176a58e274d9c7d2efeaaab3e0621a53935","Warn: pipCommand not pinned by hash: Dockerfile:11-15","Warn: pipCommand not pinned by hash: Dockerfile.mirrors:11-17","Warn: pipCommand not pinned by hash: .github/workflows/pypi.yml:24","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   8 third-party GitHubAction dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"40 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-q9mw-68c2-j6m5","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-4www-5p9h-95mh","Warn: Project is vulnerable to: GHSA-9gqv-wp59-fq42","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T13:56:56.315Z","repository_id":38397546,"created_at":"2025-08-16T13:56:56.315Z","updated_at":"2025-08-16T13:56:56.315Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","bilibili","danmaku","flv","live","python3","recorder","streaming"],"created_at":"2024-07-31T02:01:01.816Z","updated_at":"2026-01-14T07:36:29.811Z","avatar_url":"https://github.com/acgnhiki.png","language":"Python","funding_links":["https://afdian.net/@acgnhiki"],"categories":["Python","直播相关工具"],"sub_categories":["直播脚本"],"readme":"# Bilibili Live Streaming Recorder (blrec)\r\n\r\n这是一个前后端分离的 B 站直播录制工具。前端使用了响应式设计，可适应不同的屏幕尺寸；后端是用 Python 写的，可以跨平台运行。\r\n\r\n这个工具是自动化的，会自动完成直播的录制, 在出现未处理异常时会发送通知，空间不足能够自动回收空间，还有详细日志记录，因此可以长期无人值守运行在服务器上。\r\n\r\n## 屏幕截图\r\n\r\n![webapp](https://user-images.githubusercontent.com/33854576/128959800-451d03e7-c9f9-4732-ac90-97fdb6b88972.png)\r\n\r\n![terminal](https://user-images.githubusercontent.com/33854576/128959819-70d72937-65da-4c15-b61c-d2da65bf42be.png)\r\n\r\n## 功能\r\n\r\n- 自动完成直播录制\r\n- 同步保存弹幕\r\n- 自动修复时间戳问题：跳变、反跳等。\r\n- 直播流参数改变自动分割文件，避免出现花屏等问题。\r\n- 流中断自动拼接且支持 **无缝** 拼接，不会因网络中断而使录播文件片段化。\r\n- `flv` 文件添加关键帧等元数据，使定位播放和拖进度条不会卡顿。\r\n- 可选录制的画质\r\n- 可自定义文件保存路径和文件名\r\n- 支持按文件大小或时长分割文件\r\n- 支持转换 `flv` 为 `mp4` 格式（需要安装 `ffmpeg`）\r\n- 硬盘空间检测并支持空间不足自动删除旧录播文件。\r\n- 事件通知（支持邮箱、`ServerChan`、`PushDeer`、`pushplus`、`Telegram`、`Bark` ）\r\n- `Webhook`（可配合 `REST API` 实现录制控制，录制完成后压制、上传等自定义需求）\r\n\r\n## 前提条件\r\n\r\n    Python 3.8+\r\n    ffmpeg、 ffprobe\r\n\r\n## 安装\r\n\r\n- 通过 pip 或者 pipx 安装\r\n\r\n    `pip install blrec` 或者 `pipx install blrec`\r\n\r\n    使用的一些库需要自己编译，Windows 没安装 C / C++ 编译器会安装出错，\r\n    参考 [Python Can't install packages](https://stackoverflow.com/questions/64261546/python-cant-install-packages) 先安装好 [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)。\r\n\r\n- 免安装绿色版\r\n\r\n    支持 Windows 10+ 或 Windows Server 2016+，下载后解压运行 `run.bat` 或 `run.ps1` 。\r\n\r\n    不是官方或最新系统可能需要安装系统更新或缺少的 `C` 或 `C++` 运行时库\r\n\r\n    下载\r\n\r\n    - Releases: https://github.com/acgnhiki/blrec/releases\r\n    - 网盘: https://gooyie.lanzoui.com/b01om2zte  密码: 2233\r\n\r\n## 更新\r\n\r\n- 通过 pip 或者 pipx 安装的用以下方式更新\r\n\r\n    `pip install blrec --upgrade` 或者 `pipx upgrade blrec`\r\n\r\n- 免安装绿色版\r\n\r\n    - 下载并解压新版本\r\n    - 确保旧版本已经关闭退出以避免之后出现端口冲突\r\n    - 把旧版本的设置文件 `settings.toml` 复制并覆盖新版本的设置文件\r\n    - 运行新版本的 `run.bat`\r\n\r\n## 卸载\r\n\r\n- 通过 pip 或者 pipx 安装的用以下方式卸载\r\n\r\n    `pip uninstall blrec` 或者 `pipx uninstall blrec`\r\n\r\n- 免安装绿色版\r\n\r\n    删除解压后的文件夹\r\n\r\n\r\n## Docker\r\n\r\n### 环境变量\r\n\r\n- 默认设置文件位置: `ENV BLREC_DEFAULT_SETTINGS_FILE=/cfg/settings.toml`\r\n- 默认日志存放目录: `ENV BLREC_DEFAULT_LOG_DIR=/log`\r\n- 默认录播存放目录: `ENV BLREC_DEFAULT_OUT_DIR=/rec`\r\n- 默认时区: `ENV TZ=\"Asia/Shanghai\"`\r\n\r\n### 默认参数运行\r\n\r\n`sudo docker run -v /etc/blrec:/cfg -v /var/log/blrec:/log -v ~/blrec:/rec -dp 2233:2233 acgnhiki/blrec`\r\n\r\n### 命令行参数用法\r\n\r\n```bash\r\nsudo docker run \\\r\n    -v /etc/blrec:/cfg -v /var/log/blrec:/log -v ~/blrec:/rec \\\r\n    -dp 2233:2233 acgnhiki/blrec \\\r\n    -c /cfg/another_settings.toml \\\r\n    --key-file path/to/key-file \\\r\n    --cert-file path/to/cert-file \\\r\n    --api-key bili2233\r\n```\r\n\r\n## 使用方法\r\n\r\n### 命令行参数用法\r\n\r\n`blrec --help`\r\n\r\n### 默认参数运行\r\n\r\n在命令行终端里执行 `blrec` ，然后浏览器访问 `http://localhost:2233`。\r\n\r\n默认设置文件位置：`~/.blrec/settings.toml`\r\n\r\n默认日志文件目录： `~/.blrec/logs`\r\n\r\n默认录播文件目录: `.`\r\n\r\n### 指定设置文件和录播与日志保存位置\r\n\r\n`blrec -c path/to/settings.toml -o path/to/records --log-dir path/to/logs`\r\n\r\n如果指定的设置文件不存在会自动创建\r\n\r\n**命令行参数会覆盖掉设置文件的对应的设置**\r\n\r\n### 绑定主机和端口\r\n\r\n默认为本地运行，主机和端口绑定为： `localhost:2233`\r\n\r\n需要外网访问，把主机绑定到 `0.0.0.0`，端口绑定则按照自己的情况修改。\r\n\r\n例如：`blrec --host 0.0.0.0 --port 8000`\r\n\r\n### 网络安全\r\n\r\n指定 `SSL` 证书使用 **https** 协议并指定 `api key` 可防止被恶意访问和泄漏设置里的敏感信息\r\n\r\n例如：`blrec --key-file path/to/key-file --cert-file path/to/cert-file --api-key bili2233`\r\n\r\n如果指定了 api key，浏览器第一次访问会弹对话框要求输入 api key。\r\n\r\n输入的 api key 会被保存在浏览器的 `local storage` 以避免每次都得输入\r\n\r\n如果在不信任的环境下，请使用浏览器的隐式模式访问。\r\n\r\n### 关于 api-key\r\n\r\napi key 可以使用数字和字母，长度限制为最短 8 最长 80。\r\n\r\n3 次尝试内 api key 正确客户端 ip 会自动加入白名单，3 次错误后则 ip 会被加入黑名单，黑名单后请求会被拒绝 (403)。\r\n\r\n黑名单和白名单数以及同时尝试连接的 ip 数量限制各为 100，黑名单或白名单到达限制后不再接受除了白名单内的其它 ip 。\r\n\r\n只有重启才会清空黑名单和白名单。\r\n\r\n## 作为 ASGI 应用运行\r\n\r\n    uvicorn blrec.web:app\r\n\r\n或者\r\n\r\n    hypercorn blrec.web:app\r\n\r\n作为 ASGI 应用运行，参数通过环境变量指定。\r\n\r\n- `BLREC_CONFIG` 指定设置文件\r\n- `BLREC_OUT_DIR` 指定录播存放位置\r\n- `BLREC_LOG_DIR` 指定日志存放位置\r\n- `BLREC_API_KEY` 指定 `api key`\r\n\r\n### bash\r\n\r\n    BLREC_CONFIG=path/to/settings.toml BLREC_OUT_DIR=path/to/dir BLREC_API_KEY=******** uvicorn blrec.web:app --host 0.0.0.0 --port 8000\r\n\r\n### cmd\r\n\r\n    set BLREC_CONFIG=D:\\\\path\\\\to\\\\config.toml \u0026 set BLREC_OUT_DIR=D:\\\\path\\\\to\\\\dir \u0026 set BLREC_API_KEY=******** uvicorn blrec.web:app --host 0.0.0.0 --port 8000\r\n\r\n## Webhook\r\n\r\n程序在运行过程中会触发一些事件，如果是支持 `webhook` 的事件，就会给所设置的 `webhook` 网络地址发送 POST 请求。\r\n\r\n关于支持的事件和 `POST` 请求所发送的数据，详见 wiki。\r\n\r\n## REST API\r\n\r\n后端 `web` 框架用的是 `FastApi` , 要查看自动生成的交互式 `API` 文档，访问 `http://localhost:2233/docs` （默认主机和端口绑定）。\r\n\r\n## Progressive Web App（PWA）\r\n\r\n前端其实是一个渐进式网络应用，可以通过地址栏右侧的图标安装，然后像原生应用一样从桌面启动运行。\r\n\r\n**注意：PWA 要在本地访问或者在 `https` 下才支持。**\r\n\r\n---\r\n\r\n## 开发\r\n\r\n1. 克隆代码\r\n\r\n    `git clone https://github.com/acgnhiki/blrec.git`\r\n\r\n2. 进入项目目录\r\n\r\n    `cd blrec`\r\n\r\n3. 创建虚拟环境\r\n\r\n    `python3 -m venv .venv`\r\n\r\n4. 激活虚拟环境\r\n\r\n    `source .venv/bin/activate`\r\n\r\n5. 以可编辑方式安装\r\n\r\n    `pip install -e .[dev]`\r\n\r\n6. 修改代码\r\n\r\n    ……\r\n\r\n7. 运行 blrec\r\n\r\n    `blrec`\r\n\r\n8. 退出虚拟环境\r\n\r\n    `deactivate`\r\n\r\n---\r\n\r\n## 常见问题\r\n\r\n[FAQ](FAQ.md)\r\n\r\n## 更新日志\r\n\r\n[CHANGELOG](CHANGELOG.md)\r\n\r\n---\r\n\r\n## 其它相关工具或项目\r\n\r\n| 名称 | 链接 | 简介 |\r\n| --- | --- | --- |\r\n| 录播姬 | [官网](https://rec.danmuji.org/) | 简单易用成熟稳定的 B 站直播录制工具 |\r\n| rclone | [官网](https://rclone.org/) | 可以挂载网盘用于存放录播文件 |\r\n| alist | [官网](https://alist-doc.nn.ci/) | 网盘文件浏览、播放 |\r\n| filebrowser | [官网](https://filebrowser.org/) | 服务器文件管理 |\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facgnhiki%2Fblrec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facgnhiki%2Fblrec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facgnhiki%2Fblrec/lists"}