{"id":13430335,"url":"https://github.com/nilaoda/BBDown","last_synced_at":"2025-03-16T05:30:44.759Z","repository":{"id":37413955,"uuid":"282637924","full_name":"nilaoda/BBDown","owner":"nilaoda","description":"Bilibili Downloader. 一个命令行式哔哩哔哩下载器.","archived":false,"fork":false,"pushed_at":"2025-03-10T13:46:37.000Z","size":18853,"stargazers_count":10737,"open_issues_count":184,"forks_count":1335,"subscribers_count":54,"default_branch":"master","last_synced_at":"2025-03-11T16:01:56.518Z","etag":null,"topics":["downloader"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nilaoda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2020-07-26T11:43:28.000Z","updated_at":"2025-03-11T15:26:36.000Z","dependencies_parsed_at":"2023-10-20T22:04:34.425Z","dependency_job_id":"ab37d6c0-cd0b-4a2f-b25d-43bc49159987","html_url":"https://github.com/nilaoda/BBDown","commit_stats":{"total_commits":437,"total_committers":25,"mean_commits":17.48,"dds":0.2723112128146453,"last_synced_commit":"99f9ed49fa81b8488928eef5aef45d4d14aeabd3"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilaoda%2FBBDown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilaoda%2FBBDown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilaoda%2FBBDown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilaoda%2FBBDown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nilaoda","download_url":"https://codeload.github.com/nilaoda/BBDown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830912,"owners_count":20354848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["downloader"],"created_at":"2024-07-31T02:00:52.328Z","updated_at":"2025-03-16T05:30:44.753Z","avatar_url":"https://github.com/nilaoda.png","language":"C#","funding_links":[],"categories":["C\\#","C# #","下载工具","C#（1884）","C#","User Interface"],"sub_categories":["直播脚本","Applications and End User Tools"],"readme":"[![img](https://img.shields.io/github/stars/nilaoda/BBDown?label=%E7%82%B9%E8%B5%9E)](https://github.com/nilaoda/BBDown)  [![img](https://img.shields.io/github/last-commit/nilaoda/BBDown?label=%E6%9C%80%E8%BF%91%E6%8F%90%E4%BA%A4)](https://github.com/nilaoda/BBDown)  [![img](https://img.shields.io/github/release/nilaoda/BBDown?label=%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC)](https://github.com/nilaoda/BBDown/releases)  [![img](https://img.shields.io/github/license/nilaoda/BBDown?label=%E8%AE%B8%E5%8F%AF%E8%AF%81)](https://github.com/nilaoda/BBDown)  [![Build Latest](https://github.com/nilaoda/BBDown/actions/workflows/build_latest.yml/badge.svg)](https://github.com/nilaoda/BBDown/actions/workflows/build_latest.yml)\n\n\u003e 本项目仅供个人学习、研究和非商业性用途。用户在使用本工具时，需自行确保遵守相关法律法规，特别是与版权相关的法律条款。开发者不对因使用本工具而产生的任何版权纠纷或法律责任承担责任。请用户在使用时谨慎，确保其行为合法合规，并仅在有合法授权的情况下使用相关内容。\n\n# BBDown\n一个命令行式哔哩哔哩下载器. Bilibili Downloader.\n\n# 注意\n本软件混流时需要外部程序：\n\n* 普通视频：[ffmpeg](https://www.gyan.dev/ffmpeg/builds/) ，或 [mp4box](https://gpac.wp.imt.fr/downloads/)\n* 杜比视界：ffmpeg5.0以上或新版mp4box.\n\n# 快速开始\n本软件已经以 [Dotnet Tool](https://www.nuget.org/packages/BBDown/) 形式发布  \n\n如果你本地有dotnet环境，使用如下命令即可安装使用\n```\ndotnet tool install --global BBDown\n```\n\n如果需要更新bbdown，使用如下命令\n```\ndotnet tool update --global BBDown\n```\n\n# 下载\nRelease版本：https://github.com/nilaoda/BBDown/releases\n\n自动构建的测试版本：https://github.com/nilaoda/BBDown/actions\n\n# 开始使用\n目前命令行参数支持情况\n```\nDescription:\n  BBDown是一个免费且便捷高效的哔哩哔哩下载/解析软件.\n\nUsage:\n  BBDown \u003curl\u003e [command] [options]\n\nArguments:\n  \u003curl\u003e  视频地址 或 av|bv|BV|ep|ss\n\nOptions:\n  -tv, --use-tv-api                              使用TV端解析模式\n  -app, --use-app-api                            使用APP端解析模式\n  -intl, --use-intl-api                          使用国际版(东南亚视频)解析模式\n  --use-mp4box                                   使用MP4Box来混流\n  -e, --encoding-priority \u003cencoding-priority\u003e    视频编码的选择优先级, 用逗号分割 例: \"hevc,av1,avc\"\n  -q, --dfn-priority \u003cdfn-priority\u003e              画质优先级,用逗号分隔 例: \"8K 超高清, 1080P 高码率, HDR 真彩, 杜比视界\"\n  -info, --only-show-info                        仅解析而不进行下载\n  --show-all                                     展示所有分P标题\n  -aria2, --use-aria2c                           调用aria2c进行下载(你需要自行准备好二进制可执行文件)\n  -ia, --interactive                             交互式选择清晰度\n  -hs, --hide-streams                            不要显示所有可用音视频流\n  -mt, --multi-thread                            使用多线程下载(默认开启)\n  --video-only                                   仅下载视频\n  --audio-only                                   仅下载音频\n  --danmaku-only                                 仅下载弹幕\n  --sub-only                                     仅下载字幕\n  --cover-only                                   仅下载封面\n  --debug                                        输出调试日志\n  --skip-mux                                     跳过混流步骤\n  --skip-subtitle                                跳过字幕下载\n  --skip-cover                                   跳过封面下载\n  --force-http                                   下载音视频时强制使用HTTP协议替换HTTPS(默认开启)\n  -dd, --download-danmaku                        下载弹幕\n  --skip-ai                                      跳过AI字幕下载(默认开启)\n  --video-ascending                              视频升序(最小体积优先)\n  --audio-ascending                              音频升序(最小体积优先)\n  --allow-pcdn                                   不替换PCDN域名, 仅在正常情况与--upos-host均无法下载时使用\n  -F, --file-pattern \u003cfile-pattern\u003e              使用内置变量自定义单P存储文件名:\n  \n                                                 \u003cvideoTitle\u003e: 视频主标题\n                                                 \u003cpageNumber\u003e: 视频分P序号\n                                                 \u003cpageNumberWithZero\u003e: 视频分P序号(前缀补零)\n                                                 \u003cpageTitle\u003e: 视频分P标题\n                                                 \u003cbvid\u003e: 视频BV号\n                                                 \u003caid\u003e: 视频aid\n                                                 \u003ccid\u003e: 视频cid\n                                                 \u003cdfn\u003e: 视频清晰度\n                                                 \u003cres\u003e: 视频分辨率\n                                                 \u003cfps\u003e: 视频帧率\n                                                 \u003cvideoCodecs\u003e: 视频编码\n                                                 \u003cvideoBandwidth\u003e: 视频码率\n                                                 \u003caudioCodecs\u003e: 音频编码\n                                                 \u003caudioBandwidth\u003e: 音频码率\n                                                 \u003cownerName\u003e: 上传者名称\n                                                 \u003cownerMid\u003e: 上传者mid\n                                                 \u003cpublishDate\u003e: 收藏夹/番剧/合集发布时间\n                                                 \u003cvideoDate\u003e: 视频发布时间(分p视频发布时间与\u003cpublishDate\u003e相同)\n                                                 \u003capiType\u003e: API类型(TV/APP/INTL/WEB)\n  \n                                                 默认为: \u003cvideoTitle\u003e\n  -M, --multi-file-pattern \u003cmulti-file-pattern\u003e  使用内置变量自定义多P存储文件名:\n  \n                                                 默认为: \u003cvideoTitle\u003e/[P\u003cpageNumberWithZero\u003e]\u003cpageTitle\u003e\n  -p, --select-page \u003cselect-page\u003e                选择指定分p或分p范围: (-p 8 或 -p 1,2 或 -p 3-5 或 -p ALL 或 -p LAST 或 -p 3,5,LATEST)\n  --language \u003clanguage\u003e                          设置混流的音频语言(代码), 如chi, jpn等\n  -ua, --user-agent \u003cuser-agent\u003e                 指定user-agent, 否则使用随机user-agent\n  -c, --cookie \u003ccookie\u003e                          设置字符串cookie用以下载网页接口的会员内容\n  -token, --access-token \u003caccess-token\u003e          设置access_token用以下载TV/APP接口的会员内容\n  --aria2c-args \u003caria2c-args\u003e                    调用aria2c的附加参数(默认参数包含\"-x16 -s16 -j16 -k 5M\", 使用时注意字符串转义)\n  --work-dir \u003cwork-dir\u003e                          设置程序的工作目录\n  --ffmpeg-path \u003cffmpeg-path\u003e                    设置ffmpeg的路径\n  --mp4box-path \u003cmp4box-path\u003e                    设置mp4box的路径\n  --aria2c-path \u003caria2c-path\u003e                    设置aria2c的路径\n  --upos-host \u003cupos-host\u003e                        自定义upos服务器\n  --force-replace-host                           强制替换下载服务器host(默认开启)\n  --save-archives-to-file                        将下载过的视频记录到本地文件中, 用于后续跳过下载同个视频\n  --delay-per-page \u003cdelay-per-page\u003e              设置下载合集分P之间的下载间隔时间(单位: 秒, 默认无间隔)\n  --host \u003chost\u003e                                  指定BiliPlus host(使用BiliPlus需要access_token, 不需要cookie, 解析服务器能够获取你账号的大部分权限!)\n  --ep-host \u003cep-host\u003e                            指定BiliPlus EP host(用于代理api.bilibili.com/pgc/view/web/season, 大部分解析服务器不支持代理该接口)\n  --area \u003carea\u003e                                  (hk|tw|th) 使用BiliPlus时必选, 指定BiliPlus area\n  --config-file \u003cconfig-file\u003e                    读取指定的BBDown本地配置文件(默认为: BBDown.config)\n  --version                                      Show version information\n  -?, -h, --help                                 Show help and usage information\n\n\nCommands:\n  login    通过APP扫描二维码以登录您的WEB账号\n  logintv  通过APP扫描二维码以登录您的TV账号\n  serve    以服务器模式运行\n```\n\n# 功能\n- [x] 番剧下载(Web|TV|App)\n- [x] 课程下载(Web)\n- [x] 普通内容下载(Web|TV|App)\n- [x] 合集/列表/收藏夹/个人空间解析\n- [x] 多分P自动下载\n- [x] 选择指定分P进行下载\n- [x] 选择指定清晰度进行下载\n- [x] 下载外挂字幕并转换为srt格式\n- [x] 自动合并音频+视频流+字幕流+**章节信息**`(使用ffmpeg或mp4box)`\n- [x] 单独下载视频/音频/字幕\n- [x] 二维码登录账号\n- [x] 多线程下载\n- [x] 支持调用aria2c下载\n- [x] 支持AVC/HEVC/AV1编码\n- [x] **支持8K/HDR/杜比视界/杜比全景声下载**\n- [x] 自定义存储文件名\n\n# TODO\n- [ ] 自动刷新cookie\n- [ ] 支持更多自定义选项\n\n# 使用教程\n\n\u003cdetails\u003e\n\u003csummary\u003e配置文件 (NEW)\u003c/summary\u003e \n\n---\n\n在`1.4.9`或更高版本中，BBDown支持读取本地配置文件以简化命令行的手动输入。\n\n如果用户没有指定`--config-file`，则默认读取程序同目录下的`BBDown.config`文件；若用户指定，则读取特定文件。\n\n一个典型的配置文件:\n```config\n#本文件是BBDown程序的配置文件\n#以#开头的都会被程序忽略\n#然后剩余非空白内容程序逐行读取，对于一个选项，其参数应当在下一行出现\n\n#例如下面将设置输出文件名格式\n--file-pattern\n\u003cvideoTitle\u003e[\u003cdfn\u003e]\n\n--multi-file-pattern\n\u003cvideoTitle\u003e/[P\u003cpageNumberWithZero\u003e]\u003cpageTitle\u003e[\u003cdfn\u003e]\n\n#下面设置下载多个分P时，每个分P的下载间隔为2秒\n--delay-per-page\n2\n\n#开启弹幕下载功能\n--download-danmaku\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e自定义输出文件名格式 (NEW)\u003c/summary\u003e \n\n---\n\n在`1.4.9`或更高版本中，BBDown支持用户自定义合并时的文件名组成。\n|  代码   | 含义  |\n|  ----  | ----  |\n`\u003cvideoTitle\u003e`|视频主标题\n`\u003cpageNumber\u003e`|视频分P序号\n`\u003cpageNumberWithZero\u003e`|视频分P序号(前缀补零)\n`\u003cpageTitle\u003e`|视频分P标题\n`\u003cbvid\u003e`|视频BV号\n`\u003caid\u003e`|视频aid\n`\u003ccid\u003e`|视频cid\n`\u003cdfn\u003e`|视频清晰度\n`\u003cres\u003e`|视频分辨率\n`\u003cfps\u003e`|视频帧率\n`\u003cvideoCodecs\u003e`|视频编码\n`\u003cvideoBandwidth\u003e`|视频码率\n`\u003caudioCodecs\u003e`|音频编码\n`\u003caudioBandwidth\u003e`|音频码率\n`\u003cownerName\u003e`|上传者名称(下载番剧时，该值为\"\")\n`\u003cownerMid\u003e`|上传者mid(下载番剧时，该值为\"\")\n`\u003cpublishDate\u003e`|发布时间(yyyy-MM-dd_HH-mm-ss)\n`\u003capiType\u003e`|API类型（TV/APP/INTL/WEB）\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eWEB/TV鉴权\u003c/summary\u003e  \n\n---\n  \n扫码登录网页账号：\n```\nBBDown login\n```\n然后按照提示操作\n\n扫码登录云视听小电视账号：\n```\nBBDown logintv\n```\n然后按照提示操作\n \n*PS: 如果登录报错`The type initializer for 'Gdip' threw an exception`，请参考 [#37](https://github.com/nilaoda/BBDown/issues/37) 解决*\n\n手动加载网页cookie：\n```\nBBDown -c \"SESSDATA=******\" \"https://www.bilibili.com/video/BV1qt4y1X7TW\"\n```\n手动加载云视听小电视token：\n```\nBBDown -tv -token \"******\" \"https://www.bilibili.com/video/BV1qt4y1X7TW\"\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAPP鉴权\u003c/summary\u003e  \n\n---\n\n\u003e 根据 [#123](https://github.com/nilaoda/BBDown/issues/123#issuecomment-877583825) ，可以填写TV登录产生的`access_token`来给APP接口使用。可复制`BBDownTV.data`到`BBDownApp.data`使程序自动读取.\n\n目前程序无法自动获取鉴权信息，推荐通过**抓包**来获取.\n\n在请求Header中寻找键为`authorization`的项，其值形为`identify_v1 5227************1`，其中的`5227************1`就是token(access_key)\n\n获取后手动通过`-token`命令加载, 或写入`BBDownApp.data`使程序自动读取.\n  \n```\nBBDown -app -token \"******\" \"https://www.bilibili.com/video/BV1qt4y1X7TW\"\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e常用命令\u003c/summary\u003e  \n\n---\n\n下载普通视频：\n```\nBBDown \"https://www.bilibili.com/video/BV1qt4y1X7TW\"\n```\n使用TV接口下载(粉丝量大的UP主基本上是无水印片源)：\n```\nBBDown -tv \"https://www.bilibili.com/video/BV1qt4y1X7TW\"\n```\n当分P过多时，默认会隐藏展示全部的分P信息，你可以使用如下命令来显示所有每一个分P。\n```\nBBDown --show-all \"https://www.bilibili.com/video/BV1At41167aj\"\n```\n选择下载某些分P的三种情况：\n* 单个分P：10\n```\nBBDown \"https://www.bilibili.com/video/BV1At41167aj?p=10\"\nBBDown -p 10 \"https://www.bilibili.com/video/BV1At41167aj\"\n```\n* 多个分P：1,2,10\n```\nBBDown -p 1,2,10 \"https://www.bilibili.com/video/BV1At41167aj\"\n```\n* 范围分P：1-10\n```\nBBDown -p 1-10 \"https://www.bilibili.com/video/BV1At41167aj\"\n```\n下载番剧全集：\n```\nBBDown -p ALL \"https://www.bilibili.com/bangumi/play/ss33073\"\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAPI服务器\u003c/summary\u003e\n\n启动服务器（自定义监听地址和端口）：\n\n```shell\nBBDown server -l http://0.0.0.0:12450\n```\n\nAPI服务器不支持HTTPS配置，如果有需要请自行使用nginx等反向代理进行配置\n\nAPI详细请参考[json-api-doc.md](./json-api-doc.md)\n\u003c/details\u003e\n\n# 演示\n![1](https://user-images.githubusercontent.com/20772925/88686407-a2001480-d129-11ea-8aac-97a0c71af115.gif)\n\n下载完毕后在当前目录查看MP4文件：\n\n![2](https://user-images.githubusercontent.com/20772925/88478901-5e1cdc00-cf7e-11ea-97c1-154b9226564e.png)\n\n# 致谢\n\n* https://github.com/codebude/QRCoder\n* https://github.com/icsharpcode/SharpZipLib\n* https://github.com/protocolbuffers/protobuf\n* https://github.com/grpc/grpc\n* https://github.com/dotnet/command-line-api\n* https://github.com/SocialSisterYi/bilibili-API-collect\n* https://github.com/SeeFlowerX/bilibili-grpc-api\n* https://github.com/FFmpeg/FFmpeg\n* https://github.com/gpac/gpac\n* https://github.com/aria2/aria2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilaoda%2FBBDown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnilaoda%2FBBDown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilaoda%2FBBDown/lists"}