{"id":19867283,"url":"https://github.com/fython/bili-open-live-go","last_synced_at":"2026-06-09T08:32:26.813Z","repository":{"id":181381446,"uuid":"666679394","full_name":"fython/bili-open-live-go","owner":"fython","description":"哔哩哔哩直播长连协议客户端 Golang 版本","archived":false,"fork":false,"pushed_at":"2023-07-15T11:13:41.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T00:38:59.184Z","etag":null,"topics":["bilibili","bilibili-live","golang","websocket-application"],"latest_commit_sha":null,"homepage":"","language":"Go","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/fython.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":"2023-07-15T07:57:59.000Z","updated_at":"2023-10-12T03:55:14.000Z","dependencies_parsed_at":"2024-11-12T15:33:36.918Z","dependency_job_id":"565e1443-4f3c-47e1-b59e-f095f63444db","html_url":"https://github.com/fython/bili-open-live-go","commit_stats":null,"previous_names":["fython/bili-open-live-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fython/bili-open-live-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fython%2Fbili-open-live-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fython%2Fbili-open-live-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fython%2Fbili-open-live-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fython%2Fbili-open-live-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fython","download_url":"https://codeload.github.com/fython/bili-open-live-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fython%2Fbili-open-live-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34098931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bilibili","bilibili-live","golang","websocket-application"],"created_at":"2024-11-12T15:28:55.732Z","updated_at":"2026-06-09T08:32:26.795Z","avatar_url":"https://github.com/fython.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"bili-open-live-go\n======\n\n[![godoc](https://godoc.org/github.com/fython/bili-open-live-go?status.svg)](https://pkg.go.dev/github.com/fython/bili-open-live-go)\n\n（非官方）基于哔哩哔哩[官方开放平台 API](https://open-live.bilibili.com/)实现的直播长连协议客户端 Golang 版本\n\n\u003e 这个项目还在施工中，API 随时可能发生变化，欢迎有动手能力的小伙伴体验，更欢迎一起共建完善造福社区\n\n# 基本使用\n\n你需要现在官方平台注册为开发者，并创建自己的应用，AppKey 和 AppSecret 通常和账号绑定，申请后官方会发送邮件给你，\n如有疑问请联系官方客服~\n\n## Get it\n\n在你的 Go 项目中安装依赖：\n\n```shell\ngo get -u github.com/fython/bili-open-live-go\n```\n\n## 创建客户端\n\n```go\nimport biliopen \"github.com/fython/bili-open-live-go\"\n\nclient := \u0026biliopen.LiveClient{\n\tAppKey:    yourAppKey,    // 申请得到的 App Key\n\tAppSecret: yourAppSecret, // 申请得到的 App Secret\n\tProjectID: yourProjectID, // 应用项目 ID\n}\nclient.OnDanmaku = func(dm biliopen.Danmaku) {\n    log.Printf(\"收到弹幕：%+v\", dm)\n}\n```\n\n## 建立连接\n\n```go\nctx := context.Background()\nif err := client.Connect(ctx, os.Getenv(\"LIVE_CODE\")); err != nil {\n\tt.Fatal(err)\n}\n```\n\n## More\n\n暂无文档，阅读 `client_test.go` 或源码定义了解更多用法\n\n# 实现清单\n\n- [x] 基本协议实现\n- [x] 弹幕回调\n- [x] 错误码文案 \u0026 抓取脚本\n- [ ] 消息回调字段对齐官方版本 \u0026 抓取版本 \n- [ ] 服务端心跳包超时\n- [ ] 自动重连\n- [ ] Game API 完整实现（此项目主要是为了实现直播间长连协议，暂无计划支持）\n\n# Contacts\n\n欢迎通过 Git Issues 或个人联系方式交流项目\n\nEmail: \u003cfythonx@gmail.com\u003e\n\nTelegram: [@fython](https://t.me/fython)\n\n# Licenses\n\n```\nMIT License\n\nCopyright (c) 2023 Siubeng (fython)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffython%2Fbili-open-live-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffython%2Fbili-open-live-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffython%2Fbili-open-live-go/lists"}