dmproto

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package dmproto decodes Bilibili's danmaku (bullet-chat) protobuf segments without protoc or any generated code. It reads exactly the one message shape the web danmaku endpoint returns: a DmSegMobileReply whose field 1 is a repeated DanmakuElem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elem

type Elem struct {
	ID       int64  // dmid
	Progress int32  // milliseconds into the video
	Mode     int32  // 1-3 scroll, 4 bottom, 5 top, 6 reverse, 7 advanced, 8 code, 9 BAS
	Fontsize int32  // font size
	Color    uint32 // decimal RGB
	MidHash  string // sender id hash
	Content  string // the text
	Ctime    int64  // unix send time
	Weight   int32  // shielding weight
	Pool     int32  // 0 normal, 1 subtitle, 2 special
	IDStr    string // dmid as string
}

Elem is one decoded danmaku line.

func Decode

func Decode(b []byte) ([]Elem, error)

Decode parses a DmSegMobileReply body and returns its danmaku elements.

Jump to

Keyboard shortcuts

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