{"id":13431586,"url":"https://github.com/iyear/biligo","last_synced_at":"2025-10-05T20:58:47.551Z","repository":{"id":65675991,"uuid":"419978996","full_name":"iyear/biligo","owner":"iyear","description":"🚀 BiliBili API SDK in Golang","archived":false,"fork":false,"pushed_at":"2023-05-07T06:41:50.000Z","size":144,"stargazers_count":88,"open_issues_count":5,"forks_count":19,"subscribers_count":3,"default_branch":"v0","last_synced_at":"2025-09-12T02:35:44.234Z","etag":null,"topics":["bilibili","bilibili-api","bilibili-download","golang","sdk-go"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/iyear/biligo","language":"Go","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/iyear.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}},"created_at":"2021-10-22T05:39:52.000Z","updated_at":"2025-08-27T11:56:32.000Z","dependencies_parsed_at":"2024-02-26T19:57:56.485Z","dependency_job_id":null,"html_url":"https://github.com/iyear/biligo","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/iyear/biligo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyear%2Fbiligo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyear%2Fbiligo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyear%2Fbiligo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyear%2Fbiligo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iyear","download_url":"https://codeload.github.com/iyear/biligo/tar.gz/refs/heads/v0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iyear%2Fbiligo/sbom","scorecard":{"id":499072,"data":{"date":"2025-08-11","repo":{"name":"github.com/iyear/biligo","commit":"2b51a7f5ef332f20dbb0b04107ee6c1d5dc21f9d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"Code-Review","score":1,"reason":"Found 3/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":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"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":-1,"reason":"no releases found","details":null,"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 'v0'"],"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 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":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2021-0265 / GHSA-ppj4-34rq-v8j9","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"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-19T21:20:11.874Z","repository_id":65675991,"created_at":"2025-08-19T21:20:11.874Z","updated_at":"2025-08-19T21:20:11.874Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278518900,"owners_count":26000177,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"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-api","bilibili-download","golang","sdk-go"],"created_at":"2024-07-31T02:01:04.297Z","updated_at":"2025-10-05T20:58:47.529Z","avatar_url":"https://github.com/iyear.png","language":"Go","funding_links":[],"categories":["开发"],"sub_categories":["直播脚本"],"readme":"![](https://socialify.git.ci/iyear/biligo/image?description=1\u0026font=Raleway\u0026forks=1\u0026issues=1\u0026logo=https%3A%2F%2Fraw.githubusercontent.com%2Fiyear%2Fbiligo%2Fv0%2Flogo%2Fbilibili.png\u0026owner=1\u0026pattern=Circuit%20Board\u0026stargazers=1\u0026theme=Light)\n\n## 简介\n![](https://img.shields.io/github/go-mod/go-version/iyear/biligo?style=flat-square)\n![](https://img.shields.io/badge/license-GPL-lightgrey.svg?style=flat-square)\n![](https://img.shields.io/github/v/release/iyear/biligo?color=red\u0026style=flat-square)\n![](https://img.shields.io/github/last-commit/iyear/biligo?style=flat-square)\n[![Go Reference](https://pkg.go.dev/badge/github.com/iyear/biligo.svg)](https://pkg.go.dev/github.com/iyear/biligo)\n\n**v0版本不保证对外函数、结构的不变性，请勿大规模用于生产环境**\n\n`BiliBili API` 的 `Golang` 实现，目前已经实现了 100+ API，还在进一步更新中\n\n### 特性\n\n- 良好的设计，支持自定义 `client` 与 `UA`\n- 完善的单元测试，易懂的函数命名，极少的第三方库依赖\n- 代码、结构体注释完善，无需文档开箱即用\n- 其他功能性代码，例如 `AV/BV`互转，`GetVideoZone()`获取分区信息...\n- 配套工具 [biligo-live](https://github.com/iyear/biligo-live) 封装直播 `WebSocket` 协议\n### 说明\n\n- 该项目永远不会编写直接涉及滥用的接口\n- 该项目仅供学习，请勿用于商业用途。任何使用该项目造成的后果由开发者自行承担\n\n### 参考\n\n\u003e 感谢以下所有项目的贡献者\n\nhttps://github.com/SocialSisterYi/bilibili-API-collect\n\nhttps://github.com/MoyuScript/bilibili-api\n\n## 快速开始\n\n### 安装\n请让 `biligo` 永远保持在最新版本\n\n```shell\ngo get -u github.com/iyear/biligo\n```\n\n```go\nimport \"github.com/iyear/biligo\"\n```\n\n### 使用\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\tbg \"github.com/iyear/biligo\"\n\t\"log\"\n)\n\nfunc main() {\n\tb, err := bg.NewBiliClient(\u0026bg.BiliSetting{\n\t\t// 均来自Web登录的Cookie\n\t\tAuth: \u0026bg.CookieAuth{\n\t\t\t// DedeUserID\n\t\t\tDedeUserID: \"YOUR_DedeUserID\",\n\t\t\t// SESSDATA\n\t\t\tSESSDATA: \"YOUR_SESSDATA\",\n\t\t\t// bili_jct\n\t\t\tBiliJCT: \"YOUR_BiliJCT\",\n\t\t\t// DedeUserID__ckMd5\n\t\t\tDedeUserIDCkMd5: \"YOUR_DedeUserIdCkMd5\",\n\t\t},\n\t\t// DEBUG 模式将输出请求和响应\n\t\tDebugMode: true,\n\t\t// Client: myClient,\n\t\t// UserAgent: \"My UA\",\n\t})\n\n\tif err != nil {\n\t\tlog.Fatal(\"failed to make new bili client; error: \", err)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"mid: %d, uname: %s,userID: %s,rank: %s\\n\", b.Me.MID, b.Me.UName, b.Me.UserID, b.Me.Rank)\n\tfmt.Printf(\"birthday: %s,sex: %s\\n\", b.Me.Birthday, b.Me.Sex)\n\tfmt.Printf(\"sign: %s\\n\", b.Me.Sign)\n}\n```\n\n### 例子\n\n同目录下的 `example` 文件夹\n\n### 说明\n\n共有两种 `Client`\n\n一种为 `BiliClient`，必须提供有效的 `Auth` 信息，公共接口不在此提供\n\n另一种为 `CommClient` ，只提供公共接口\n\n一些接口同时在两种 `Client` 中，因为其中某些字段在登录与非登录状态下有所区别\n\n## 约定\n\n\u003e 除了维护API列表、 `example` 目录、测试文件，不会有任何其他的专用文档。请利用好注释和测试。\n\n\u003e 常规的函数命名方式\n\u003e\n\u003e 由于API众多，函数名显得冗长。只能尽可能简化，但不会失去原有语义，这是无文档的基础\n\n除无对应分类的API外，其余对应分类API均以 `分类名+动作+描述` 命名 \n\n无对应分类的API以 `动作+描述` 命名 例如: `VideoGetTags` `VideoIsFavoured` `VideoSetFavour`\n\n- `Video` - `视频`\n- `Audio` - `音频`\n- `Fav` - `收藏夹`\n- `Chan` - `频道`\n- `Space` - `个人空间`\n- `Danmaku` - `弹幕`\n- `Emote` - `表情`\n- `Charge` - `充电`\n- `Dyna` - `动态`\n- `Live` - `直播`\n- `Followings` - `关注` \n\n\n\u003e 结构体编写规范\n\n嵌套可分离可不分离，结构体和数组用指针。\n\n具体看 `types.go` 即可\n\n\u003e 只要以下名词出现在该库的任何地方，可能将不做任何解释，请提交PR时尽可能遵守以下约定\n\n- `aid` - `稿件av` (库中所有参数均使用 `aid` ， `bvid` 请开发者自行使用 `BV2AV()`)\n- `cid` - `稿件分P的ID` (单P视频中`aid` ≠ `cid`) 或 `频道ID`\n- `mid` - `B站ID`\n- `mlid` - `收藏夹ID`\n- `auid` - `音频ID`\n- `dmid` - `弹幕ID`\n- `dyid` - `动态ID`\n- `dfid` - `定时发布动态ID`\n- `oid` - 根据上下文不同分别指代以上不同的ID，具体看注释\n- `ID` 而不是 `Id`\n- `URL` 而不是 `Url`\n\n\u003e 关于大接口\n\n对于评论、搜索这种超大的响应，可能不会做对应的接口，一方面这种接口经常变更，另一方面大多数的响应字段是无用的，所以请开发者自行使用 `Raw() or RawParse() + gjson` 获取需要的数据\n\n示例：\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\tbg \"github.com/iyear/biligo\"\n\t\"github.com/tidwall/gjson\"\n\t\"log\"\n)\n\nfunc GetComments() {\n\tresp, err := bg.NewCommClient(\u0026bg.CommSetting{}).RawParse(\n\t\tbg.BiliApiURL,\n\t\t\"x/v2/reply/main\",\n\t\t\"GET\",\n\t\tmap[string]string{\n\t\t\t\"next\": \"0\",\n\t\t\t\"type\": \"1\",\n\t\t\t\"oid\":  \"591018280\",\n\t\t\t\"mode\": \"3\",\n\t\t\t\"plat\": \"1\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\tfor i, r := range gjson.Get(string(resp.Data), \"replies.#.content.message\").Array() {\n\t\tfmt.Printf(\"[%d] %s\\n\\n\", i+1, r.String())\n\t}\n}\n```\n\n## 维护与贡献\n- 这个库的日常维护基本都是体力活\n- 安全水平有限，部分新接口我无法分析\n- 欢迎 `typo` 和 完善注释、文档的PR\n- 不接受无脑无贡献的催更\n- 尽量遵守约定提交PR\n- 由于项目特殊性，随时可能删库，随时可能弃坑\n## 已实现API\n\n[v0](https://github.com/iyear/biligo/blob/v0/API.md)\n\n## 留言\n### 1\n这个库是在暑假开始写的，其实写到一半已经不想写了，`90%`的代码都是在重复着查接口、写响应结构体、测试的过程，只是看到 `python` 有一套还在更新的 `SDK`，想着还是为 `Golang` 也写一套\n\n后来某天突然想把这个项目给弄完 ，所以目前动态与直播的部分基本没写\n\n### 2\n\n`map[string]string` 而不是 `map[string]interface{}` 因为在这个项目里 `interface{}` 的无约束很容易在一些特定的参数下忘记转换。\n\n## LICENSE\n\nGPL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiyear%2Fbiligo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiyear%2Fbiligo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiyear%2Fbiligo/lists"}