bpi

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 32 Imported by: 0

README

bpi-go

bpi-gobpi-rs 的 Go 版本,用于访问哔哩哔哩 HTTP API。首个版本锁定到 bpi-rs 0.2.4 的提交 36cb1104befee33b4281c59a4365d42dfdde45a4,完整实现了 27 个领域客户端和全部 206 条已纳入对齐范围的契约。

本项目遵循常见的 Go 工程实践:

  • 客户端实例彼此隔离,可安全并发使用;
  • 所有网络操作都接收 context.Context
  • 账户或 Cookie 必须显式配置,不会隐式读取文件;
  • 凭据只会发送到受信任的哔哩哔哩主机;
  • 响应缓冲区有明确上限,log/slog 默认静默并会清理敏感信息;
  • 提供类型化参数、响应模型、错误、WBI 签名和 Cookie 刷新;
  • 仅使用 Go 标准库,不引入第三方运行依赖;
  • 契约测试完全离线且可复现,覆盖 JSON、XML、压缩数据和二进制响应。

安装

go get github.com/Yuelioi/bpi-go

当前模块面向 Go 1.25。

快速开始

package main

import (
	"context"
	"log"

	"github.com/Yuelioi/bpi-go"
	"github.com/Yuelioi/bpi-go/ids"
	"github.com/Yuelioi/bpi-go/video"
)

func main() {
	client, err := bpi.NewClient()
	if err != nil {
		log.Fatal(err)
	}

	bvid, err := ids.ParseBVID("BV1xx411c7mD")
	if err != nil {
		log.Fatal(err)
	}
	view, err := client.Video().View(context.Background(), video.ViewByBVID(bvid))
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("%s (%s)", view.Title, view.BVID)
}

身份认证

凭据始终由调用方显式提供。最通用的入口是浏览器或其他凭据来源提供的原始 HTTP Cookie 请求头值:

cookieHeader := os.Getenv("BPI_COOKIE") // 仅为示例,来源由调用方决定
client, err := bpi.NewClient(bpi.WithCookie(cookieHeader))

如果自己的配置层已经把常用字段解析为结构化数据,也可以使用 Account

client, err := bpi.NewClient(bpi.WithAccount(bpi.Account{
	DedeUserID: "...",
	SESSDATA:   "...",
	BiliJCT:    "...",
	Buvid3:     "...",
}))

SDK 不提供 LoadCookie 或账户配置文件加载器,也不会读取文件、环境变量或秘密管理系统。调用方负责取得凭据,再把 Cookie 请求头或 Account 传入客户端。请勿提交 Cookie、账户文件或未经处理的私有 API 响应。

自定义请求与模型恢复

领域客户端是稳定的主要接口。对于尚未建模的端点,调用方仍可复用同一套有界传输和响应包络处理:

request, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil)
if err != nil {
	return err
}
payload, err := bpi.SendPayload[MyPayload](ctx, client, request, "my.endpoint")

当响应不再匹配现有模型时,可以通过 errors.As*bpi.ResponseDecodeError 中取得响应体的私有副本。该内容可能包含账户或隐私数据,只应在本地检查,不得记录到日志或提交到仓库。普通错误文本和结构化日志会有意省略它。

领域与接口对齐

目前支持 activityarticleaudiobangumicheeseclientinfocommentcreativecenterdanmakudynamicelectricfavhistorytoviewliveloginmangamessagemiscnoteopussearchuservideovideo_rankingvipwalletweb_widget 等领域。

自动生成的 API 对齐索引 记录每条 Rust 契约对应的 Go 访问器、方法、参数类型、响应模型和风险级别。迁移说明 介绍 Rust 与 Go 之间的语义对应关系。

仓库结构

bpi 包是一个轻量兼容门面,负责客户端构造、公开别名和 27 个领域访问器。通用的 HTTP、会话、签名、响应和选项逻辑位于 client/。每个领域目录集中存放该领域的客户端实现、参数、模型和契约测试:

bpi.go, domains.go     根兼容门面
client/                通用客户端基础设施
activity/, video/, ... 领域客户端、模型、参数和测试
ids/                   经过校验的哔哩哔哩标识符
internal/contracttest/ 共享的离线契约测试支持

大多数调用方应继续使用 bpi.NewClient(),再通过返回的根客户端访问各领域。底层 client 和领域构造函数保持公开,供需要显式组合的集成场景使用。

本项目使用作者维护的 Flightdeck 管理长期开发计划和跨会话工作记录;对应的普通 Markdown 工作台保存在仓库的 flightdeck/ 目录中。Flightdeck 仅用于开发协作,不是 bpi-go 的运行依赖。

安全验证与 Probe

以下命令均为离线操作:

go run ./cmd/bpi-probe audit
go run ./cmd/bpi-probe api-doc --check
go vet ./...
go test -count=1 ./...
go test -race -count=1 ./...

实时 Probe 默认禁用,只支持读取类契约,并且必须同时通过环境变量和命令行两道开关:

$env:BPI_PROBE = "1"
go run ./cmd/bpi-probe batch-run --read-only --profiles anonymous

运行普通账户或 VIP 账户的 Probe 时,需要分别显式设置 BPI_COOKIE_NORMALBPI_COOKIE_VIP。这些变量只由开发工具读取,SDK 本身不会读取环境变量。Probe 摘要绝不包含响应体、Cookie、CSRF 值、请求参数或账户标识。详情参见 Probe 安全与操作指南

项目文档

本项目采用 MIT 许可证

Documentation

Overview

Package bpi provides the compatibility facade for an idiomatic Go client for Bilibili HTTP interfaces. Shared transport behavior lives in package client, while each public domain package owns its client implementation, parameters, models, and contract tests.

Clients are independent and safe for concurrent use. Every domain network operation accepts a context, and cancellation propagates through the configured net/http transport. Construction does not read configuration files, install global loggers, mutate package state, or perform network I/O.

Credentials must be supplied explicitly. The client scopes session Cookies to approved Bilibili hosts, keeps logging quiet by default, and removes sensitive query values from optional structured logs. Responses are bounded before decoding. A ResponseDecodeError retains an explicit private copy of a mismatched response body for local recovery, but its Error and formatting methods never expose that body.

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingData means a successful response omitted a required payload.
	ErrMissingData = core.ErrMissingData
	// ErrAuthenticationRequired means an operation needs account credentials.
	ErrAuthenticationRequired = core.ErrAuthenticationRequired
)

Functions

func IsPermissionError

func IsPermissionError(err error) bool

IsPermissionError reports whether err represents an authorization failure.

func IsRiskControl

func IsRiskControl(err error) bool

IsRiskControl reports whether err represents Bilibili risk control.

func RequiresLogin

func RequiresLogin(err error) bool

RequiresLogin reports whether err represents an unauthenticated response.

func RequiresVIP

func RequiresVIP(err error) bool

RequiresVIP reports whether err represents a VIP-only response.

func SendOptionalPayload

func SendOptionalPayload[T any](ctx context.Context, client *Client, request *http.Request, operation string) (*T, error)

SendOptionalPayload executes request and returns an optional business payload.

func SendPayload

func SendPayload[T any](ctx context.Context, client *Client, request *http.Request, operation string) (T, error)

SendPayload executes request and returns a required business payload.

Example
package main

import (
	"context"
	"fmt"
	"io"
	"net/http"
	"strings"

	"github.com/Yuelioi/bpi-go"
)

func main() {
	client, err := bpi.NewClient(bpi.WithHTTPClient(&http.Client{Transport: exampleTransport(func(*http.Request) (*http.Response, error) {
		return jsonExampleResponse(`{"code":0,"data":{"value":"custom payload"}}`), nil
	})}))
	if err != nil {
		panic(err)
	}
	request, err := http.NewRequestWithContext(context.Background(), http.MethodGet, "https://api.bilibili.com/x/example", nil)
	if err != nil {
		panic(err)
	}
	payload, err := bpi.SendPayload[struct {
		Value string `json:"value"`
	}](context.Background(), client, request, "example.custom")
	if err != nil {
		panic(err)
	}
	fmt.Println(payload.Value)
}

type exampleTransport func(*http.Request) (*http.Response, error)

func (transport exampleTransport) RoundTrip(request *http.Request) (*http.Response, error) {
	return transport(request)
}

func jsonExampleResponse(body string) *http.Response {
	response := &http.Response{
		StatusCode: http.StatusOK,
		Header:     make(http.Header),
		Body:       io.NopCloser(strings.NewReader(body)),
	}
	return response
}
Output:
custom payload

Types

type APIError

type APIError = core.APIError

APIError reports a non-zero Bilibili response code.

type Account

type Account = core.Account

Account contains the four common Cookie values used for a complete Bilibili account projection. It retains the client module's redacted formatting semantics.

type ActivityClient

type ActivityClient = activity.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type ArticleClient

type ArticleClient = article.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type AudioClient

type AudioClient = audio.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type BangumiClient

type BangumiClient = bangumi.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type CheeseClient

type CheeseClient = cheese.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the stable root facade over the shared low-level client module. It is isolated and safe for concurrent use.

func NewClient

func NewClient(options ...Option) (*Client, error)

NewClient constructs a client without reading files, mutating global state, or performing network I/O.

Example (Authenticated)
package main

import (
	"fmt"

	"github.com/Yuelioi/bpi-go"
)

func main() {
	client, err := bpi.NewClient(bpi.WithAccount(bpi.Account{
		DedeUserID: "fixture-user",
		SESSDATA:   "fixture-session",
		BiliJCT:    "fixture-csrf",
		Buvid3:     "fixture-device",
	}))
	if err != nil {
		panic(err)
	}
	fmt.Println(client.HasLoginCookies())
}
Output:
true

func (*Client) Account

func (c *Client) Account() (Account, bool)

Account returns a copy of the current complete account, when available.

func (*Client) Activity

func (c *Client) Activity() ActivityClient

Activity returns the activity domain client.

Example
package main

import (
	"context"
	"fmt"
	"io"
	"net/http"
	"strings"

	"github.com/Yuelioi/bpi-go"
	"github.com/Yuelioi/bpi-go/activity"
)

func main() {
	client, err := bpi.NewClient(bpi.WithHTTPClient(&http.Client{Transport: exampleTransport(func(*http.Request) (*http.Response, error) {
		return jsonExampleResponse(`{"code":0,"data":{"id":4017552,"name":"demo activity"}}`), nil
	})}))
	if err != nil {
		panic(err)
	}
	params, err := activity.NewInfoParams(4_017_552)
	if err != nil {
		panic(err)
	}
	info, err := client.Activity().Info(context.Background(), params)
	if err != nil {
		panic(err)
	}
	fmt.Println(info.Name)
}

type exampleTransport func(*http.Request) (*http.Response, error)

func (transport exampleTransport) RoundTrip(request *http.Request) (*http.Response, error) {
	return transport(request)
}

func jsonExampleResponse(body string) *http.Response {
	response := &http.Response{
		StatusCode: http.StatusOK,
		Header:     make(http.Header),
		Body:       io.NopCloser(strings.NewReader(body)),
	}
	return response
}
Output:
demo activity

func (*Client) Article

func (c *Client) Article() ArticleClient

Article returns the article domain client.

func (*Client) Audio

func (c *Client) Audio() AudioClient

Audio returns the audio domain client.

func (*Client) Bangumi

func (c *Client) Bangumi() BangumiClient

Bangumi returns the bangumi domain client.

func (*Client) CSRF

func (c *Client) CSRF() (string, error)

CSRF returns the current bili_jct Cookie value.

func (*Client) Cheese

func (c *Client) Cheese() CheeseClient

Cheese returns the PUGV/course domain client.

func (*Client) ClearAccount

func (c *Client) ClearAccount()

ClearAccount removes all client session values.

func (*Client) ClientInfo

func (c *Client) ClientInfo() ClientInfoClient

ClientInfo returns the client-information domain client.

func (*Client) Comment

func (c *Client) Comment() CommentClient

Comment returns the comment domain client.

func (*Client) CreativeCenter

func (c *Client) CreativeCenter() CreativeCenterClient

CreativeCenter returns the creator-center domain client.

func (*Client) Danmaku

func (c *Client) Danmaku() DanmakuClient

Danmaku returns the danmaku domain client.

func (*Client) Do

func (c *Client) Do(ctx context.Context, request *http.Request, operation string) (*Response, error)

Do executes request through the shared bounded, credential-scoped transport.

func (*Client) Dynamic

func (c *Client) Dynamic() DynamicClient

Dynamic returns the dynamic-feed domain client.

func (*Client) Electric

func (c *Client) Electric() ElectricClient

Electric returns the charging-support domain client.

func (*Client) Fav

func (c *Client) Fav() FavClient

Fav returns the favorites domain client.

func (*Client) HasLoginCookies

func (c *Client) HasLoginCookies() bool

HasLoginCookies reports whether the session has a non-empty SESSDATA value.

func (*Client) HistoryToView

func (c *Client) HistoryToView() HistoryToViewClient

HistoryToView returns the history and watch-later domain client.

func (*Client) Live

func (c *Client) Live() LiveClient

Live returns the live-streaming domain client.

func (*Client) Login

func (c *Client) Login() LoginClient

Login returns the login and authenticated-session domain client.

func (*Client) Manga

func (c *Client) Manga() MangaClient

Manga returns the Bilibili Manga domain client.

func (*Client) Message

func (c *Client) Message() MessageClient

Message returns the message domain client.

func (*Client) Misc

func (c *Client) Misc() MiscClient

Misc returns the utility and session-bootstrap domain client.

func (*Client) Note

func (c *Client) Note() NoteClient

Note returns the video-note domain client.

func (*Client) Opus

func (c *Client) Opus() OpusClient

Opus returns the opus domain client.

func (*Client) Search

func (c *Client) Search() SearchClient

Search returns the search domain client.

func (*Client) SetAccount

func (c *Client) SetAccount(account Account) error

SetAccount atomically replaces the client's authenticated session.

func (*Client) SetCookie

func (c *Client) SetCookie(cookieHeader string) error

SetCookie atomically replaces the client's session from a raw HTTP Cookie request-header value.

func (*Client) User

func (c *Client) User() UserClient

User returns the user-profile domain client.

func (*Client) VIP

func (c *Client) VIP() VIPClient

VIP returns the VIP-center domain client.

func (*Client) Video

func (c *Client) Video() VideoClient

Video returns the video domain client.

Example
package main

import (
	"context"
	"fmt"
	"io"
	"net/http"
	"strings"

	"github.com/Yuelioi/bpi-go"
	"github.com/Yuelioi/bpi-go/ids"
	"github.com/Yuelioi/bpi-go/video"
)

func main() {
	client, err := bpi.NewClient(bpi.WithHTTPClient(&http.Client{Transport: exampleTransport(func(*http.Request) (*http.Response, error) {
		return jsonExampleResponse(`{"code":0,"data":{"aid":2,"bvid":"BV1xx411c7mD","owner":{"mid":2},"stat":{"aid":2},"cid":62131}}`), nil
	})}))
	if err != nil {
		panic(err)
	}
	bvid, err := ids.NewBVID("BV1xx411c7mD")
	if err != nil {
		panic(err)
	}
	view, err := client.Video().View(context.Background(), video.ViewByBVID(bvid))
	if err != nil {
		panic(err)
	}
	fmt.Println(view.BVID)
}

type exampleTransport func(*http.Request) (*http.Response, error)

func (transport exampleTransport) RoundTrip(request *http.Request) (*http.Response, error) {
	return transport(request)
}

func jsonExampleResponse(body string) *http.Response {
	response := &http.Response{
		StatusCode: http.StatusOK,
		Header:     make(http.Header),
		Body:       io.NopCloser(strings.NewReader(body)),
	}
	return response
}
Output:
BV1xx411c7mD

func (*Client) VideoRanking

func (c *Client) VideoRanking() VideoRankingClient

VideoRanking returns the video-ranking domain client.

func (*Client) Wallet

func (c *Client) Wallet() WalletClient

Wallet returns the private wallet domain client.

func (*Client) WebWidget

func (c *Client) WebWidget() WebWidgetClient

WebWidget returns the public Web-widget domain client.

type ClientInfoClient

type ClientInfoClient = clientinfo.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type CommentClient

type CommentClient = comment.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type CreativeCenterClient

type CreativeCenterClient = creativecenter.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type DanmakuClient

type DanmakuClient = danmaku.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type DynamicClient

type DynamicClient = dynamic.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type ElectricClient

type ElectricClient = electric.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type Envelope

type Envelope[T any] = core.Envelope[T]

Envelope is the common Bilibili JSON response wrapper.

func DecodeEnvelope

func DecodeEnvelope[T any](body []byte) (Envelope[T], error)

DecodeEnvelope decodes the common Bilibili response envelope.

type FavClient

type FavClient = fav.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type HTTPError

type HTTPError = core.HTTPError

HTTPError reports a non-successful HTTP status.

type HistoryToViewClient

type HistoryToViewClient = historytoview.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type LiveClient

type LiveClient = live.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type LoginClient

type LoginClient = login.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type MangaClient

type MangaClient = manga.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type MessageClient

type MessageClient = message.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type MiscClient

type MiscClient = misc.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type NoteClient

type NoteClient = note.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type Option

type Option = core.Option

Option configures a Client before it is constructed.

func WithAccount

func WithAccount(account Account) Option

WithAccount initializes the client from a complete structured account.

func WithCookie

func WithCookie(cookieHeader string) Option

WithCookie initializes the client from a raw HTTP Cookie request-header value. The header may contain any valid Cookie pairs.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient supplies the HTTP adapter used by the client.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger enables sanitized structured request logging.

func WithMaxResponseBody

func WithMaxResponseBody(limit int64) Option

WithMaxResponseBody sets the maximum response body buffered in memory.

func WithOrigin

func WithOrigin(origin string) Option

WithOrigin changes the default Origin header for Bilibili requests.

func WithReferer

func WithReferer(referer string) Option

WithReferer changes the default Referer header for Bilibili requests.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the total HTTP request timeout.

func WithUserAgent

func WithUserAgent(userAgent string) Option

WithUserAgent changes the default User-Agent header.

type OpusClient

type OpusClient = opus.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type ParameterError

type ParameterError = core.ParameterError

ParameterError describes an invalid caller-supplied value.

type Response

type Response = core.Response

Response contains a fully buffered successful HTTP response.

type ResponseDecodeError

type ResponseDecodeError = core.ResponseDecodeError

ResponseDecodeError retains a recoverable, explicitly accessed response body.

type ResponseTooLargeError

type ResponseTooLargeError = core.ResponseTooLargeError

ResponseTooLargeError reports that a response exceeded the configured limit.

type SearchClient

type SearchClient = search.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type TransportError

type TransportError = core.TransportError

TransportError wraps a failure from the configured HTTP transport.

type UserClient

type UserClient = user.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type VIPClient

type VIPClient = vip.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type VideoClient

type VideoClient = video.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type VideoRankingClient

type VideoRankingClient = videoranking.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type WalletClient

type WalletClient = wallet.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

type WebWidgetClient

type WebWidgetClient = webwidget.Client

Domain-client aliases preserve the original root package names while each implementation lives beside its domain parameters and models.

Directories

Path Synopsis
Package activity contains validated parameters and response models for the Bilibili activity domain.
Package activity contains validated parameters and response models for the Bilibili activity domain.
Package article contains validated parameters and stable response models for Bilibili article endpoints.
Package article contains validated parameters and stable response models for Bilibili article endpoints.
Package audio contains validated parameters and stable response models for Bilibili audio endpoints.
Package audio contains validated parameters and stable response models for Bilibili audio endpoints.
Package bangumi contains validated parameters and response models for the Bilibili bangumi domain.
Package bangumi contains validated parameters and response models for the Bilibili bangumi domain.
Package cheese contains validated parameters and stable response models for Bilibili PUGV/course endpoints.
Package cheese contains validated parameters and stable response models for Bilibili PUGV/course endpoints.
Package client implements the shared HTTP, session, signing, response, and request-policy module used by every bpi-go domain.
Package client implements the shared HTTP, session, signing, response, and request-policy module used by every bpi-go domain.
Package clientinfo contains validated parameters and response models for Bilibili client-information endpoints.
Package clientinfo contains validated parameters and response models for Bilibili client-information endpoints.
cmd
bpi-probe command
Command bpi-probe audits the committed contract snapshot, generates the Go parity catalog, and runs explicitly gated read-only live probes.
Command bpi-probe audits the committed contract snapshot, generates the Go parity catalog, and runs explicitly gated read-only live probes.
bpi-sourcegen command
Command bpi-sourcegen creates a deterministic inventory of the bpi-rs domain-client and promoted-contract surface used by the Go port.
Command bpi-sourcegen creates a deterministic inventory of the bpi-rs domain-client and promoted-contract surface used by the Go port.
Package comment contains validated parameters and response models for the Bilibili comment domain.
Package comment contains validated parameters and response models for the Bilibili comment domain.
Package creativecenter contains parameters and stable response models for Bilibili's authenticated creator-center read APIs.
Package creativecenter contains parameters and stable response models for Bilibili's authenticated creator-center read APIs.
Package danmaku contains validated parameters for Bilibili danmaku JSON, XML, and protobuf endpoints.
Package danmaku contains validated parameters for Bilibili danmaku JSON, XML, and protobuf endpoints.
Package dynamic contains validated parameters and stable response models for Bilibili's dynamic-feed endpoints.
Package dynamic contains validated parameters and stable response models for Bilibili's dynamic-feed endpoints.
Package electric contains parameters and stable response models for Bilibili's public and account-scoped charging APIs.
Package electric contains parameters and stable response models for Bilibili's public and account-scoped charging APIs.
Package fav contains parameters and stable response models for Bilibili favorite-folder read endpoints.
Package fav contains parameters and stable response models for Bilibili favorite-folder read endpoints.
Package historytoview contains private account-history and watch-later read parameters and response models.
Package historytoview contains private account-history and watch-later read parameters and response models.
Package ids provides validated Bilibili identifier types.
Package ids provides validated Bilibili identifier types.
internal
bpierr
Package bpierr contains shared error implementations used across the root and domain packages.
Package bpierr contains shared error implementations used across the root and domain packages.
contracttest
Package contracttest contains shared adapters for cross-package domain contract tests.
Package contracttest contains shared adapters for cross-package domain contract tests.
probe
Package probe implements the offline audits, catalog generation, and explicitly gated read-only network runner used by cmd/bpi-probe.
Package probe implements the offline audits, catalog generation, and explicitly gated read-only network runner used by cmd/bpi-probe.
sign
Package sign implements deterministic signing primitives used by Bilibili request policies.
Package sign implements deterministic signing primitives used by Bilibili request policies.
testutil
Package testutil contains offline adapters used by bpi domain tests.
Package testutil contains offline adapters used by bpi domain tests.
Package live contains parameters and stable response models for Bilibili's promoted live read APIs.
Package live contains parameters and stable response models for Bilibili's promoted live read APIs.
Package login contains parameters and response models for Bilibili login and authenticated-session state.
Package login contains parameters and response models for Bilibili login and authenticated-session state.
Package manga contains validated parameters and stable response models for Bilibili Manga endpoints.
Package manga contains validated parameters and stable response models for Bilibili Manga endpoints.
Package message contains parameters and stable response models for Bilibili notification and private-message counters.
Package message contains parameters and stable response models for Bilibili notification and private-message counters.
Package misc contains validated parameters and stable response models for Bilibili session bootstrap and utility endpoints.
Package misc contains validated parameters and stable response models for Bilibili session bootstrap and utility endpoints.
Package note contains validated parameters and stable response models for Bilibili video notes.
Package note contains validated parameters and stable response models for Bilibili video notes.
Package opus contains validated parameters and response models for public Bilibili opus feeds.
Package opus contains validated parameters and response models for public Bilibili opus feeds.
Package search contains validated parameters and response models for Bilibili search endpoints.
Package search contains validated parameters and response models for Bilibili search endpoints.
Package user contains validated parameters and stable response models for Bilibili user-domain endpoints.
Package user contains validated parameters and stable response models for Bilibili user-domain endpoints.
Package video contains validated parameters and response models for the Bilibili video domain.
Package video contains validated parameters and response models for the Bilibili video domain.
Package videoranking contains validated parameters and response models for Bilibili video-ranking endpoints.
Package videoranking contains validated parameters and response models for Bilibili video-ranking endpoints.
Package vip contains parameters and stable response models for Bilibili VIP center endpoints.
Package vip contains parameters and stable response models for Bilibili VIP center endpoints.
Package wallet contains private wallet read parameters and response models.
Package wallet contains private wallet read parameters and response models.
Package webwidget contains validated parameters and response models for Bilibili's public Web-widget endpoints.
Package webwidget contains validated parameters and response models for Bilibili's public Web-widget endpoints.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL