English | 简体中文 | 繁體中文 | 日本語 | Русский
ErisPulse-BilibiliAdapter
ErisPulse Bilibili DM adapter — QR/Cookie login, event-driven DMs, multi-account
Introduction
BilibiliAdapter is a Bilibili direct-message adapter built on bilibili-api-python, providing event-driven DM send/receive.
Highlights:
- Dual login: Dashboard QR-code login (credentials written to config automatically) / manual Cookie credentials
- Event-driven DMs: text / picture messages received in real time as standard OneBot12 events
- Picture in/out: inbound as image segment (URL); outbound supports URL / local path
- Multi-account: one Bilibili account per entry under
accounts, independent session listeners - Safe QR flow: QR session tokens prevent unauthorized polling; credentials shown as passwords in the panel
Installation
epsdk install BilibiliAdapter
или:
pip install ErisPulse-BilibiliAdapter
Configuration
Option 1: QR-code login (recommended)
[BilibiliAdapter.accounts.default]
login_mode = "qrcode"
bot_id = "" # auto-detect
enabled = true
After saving, open Dashboard → Component Config → Bilibili → Add account wizard, choose "Scan QR to log in", scan with the Bilibili APP and credentials are written to config automatically.
Option 2: Cookie credentials
[BilibiliAdapter.accounts.default]
login_mode = "cookie"
sessdata = "YOUR_SESSDATA" # required
bili_jct = "YOUR_BILI_JCT" # required
buvid3 = "YOUR_BUVID3" # optional
dedeuserid = "YOUR_UID" # optional
bot_id = "" # auto-detect
enabled = true
To get cookies: log in to Bilibili in your browser → F12 devtools → Application → Cookies → copy the fields.
Configuration notes (per account):
login_mode:cookie(manual credentials) orqrcode(panel scan, recommended)sessdata/bili_jct: login cookies (required for cookie mode, shown as passwords)buvid3: device fingerprint cookie (optional, reduces risk-control probability)dedeuserid: account UID (optional, default source for bot_id)bot_id: account UID (auto-detected after login when empty)
Messaging examples
from ErisPulse import sdk
bili = sdk.adapter.get("bilibili")
# Send a text DM (target is the peer UID)
await bili.Send.To("user", "123456789").Text("Hello Bilibili!")
# Send a picture (URL or local path)
await bili.Send.To("user", "123456789").Image("https://example.com/pic.jpg")
# Reply (chained modifier)
await bili.Send.To("user", "123456789").Reply("msg_key").Text("Got it!")
# Multi-account
await bili.Send.Using("account2").To("user", "123456789").Text("From the second account")
# OneBot12 standard segments
message = [
{"type": "text", "data": {"text": "line one"}},
{"type": "image", "data": {"file": "https://example.com/img.jpg"}},
]
await bili.Send.To("user", "123456789").Raw_ob12(message)
Standard Api actions
# Self info
result = await bili.Api.get_self_info() # {user_id, user_name, avatar}
# Public user info (nickname / avatar)
result = await bili.Api.get_user_info("123456789")
# Fetch history messages of a session
result = await bili.Api.get_session_msgs("123456789", begin_seqno=0)
# Status & version
result = await bili.Api.get_status()
result = await bili.Api.get_version()
# Multi-account
result = await bili.Api.Using("account2").get_self_info()
Event listening examples
Using the Event module (recommended)
@sdk.adapter.on_message()
async def on_message(event):
if event["platform"] == "bilibili":
sender = event["user_id"] # peer UID
text = event["alt_message"] # plain text content
await event.reply("Got it!") # quick reply
Using platform raw events
@sdk.adapter.on("message")
async def handle_message(event):
if event["platform"] == "bilibili":
raw = event["bilibili_raw"] # raw Bilibili DM payload
print(f"DM from: {raw.get('sender_uid')}")
Platform event mapping
| Bilibili DM event | Adapter event |
|---|---|
| TEXT (text message) | message (text segment) |
| PICTURE (picture message) | message (image segment) |
| WITHDRAW (recall) | logged only |
Important notes:
- Bilibili has no official personal Bot API — this adapter uses the web DM interface via simulated login (unofficial)
- Throttle your sends: high-frequency / bulk DMs easily trigger risk control (DM功能 temporary ban); add rate limiting on the module side
- Do not use for harassment or bulk marketing; follow Bilibili community rules
- Cookies equal full account access — keep them safe; credential fields are masked in the panel
- Only direct chats are supported; fan-group chats are not
- Inbound pictures become image segments (URL); outbound pictures accept URL / local path
- When the login state expires (cookies stale) the adapter logs errors — re-scan or update cookies
Reference links
Metadata
Release files for ErisPulse-BilibiliAdapter 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| erispulse_bilibiliadapter-0.1.0.tar.gz | 12.6 kB | With provenance | Details for erispulse_bilibiliadapter-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| erispulse_bilibiliadapter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for erispulse_bilibiliadapter-0.1.0-py3-none-any.whl |
Total release size: 26.0 kB
Release files / erispulse_bilibiliadapter-0.1.0.tar.gz
| Download URL | erispulse_bilibiliadapter-0.1.0.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74c782961a081fc42b0959d1a903cac79add405ed193930f57c51d79c224e529
|
|
BLAKE2b-256 checksum How to use checksums |
e9ceb405d037b5325022198739949f34757355d53e32223c297609be11aba947
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logRelease files / erispulse_bilibiliadapter-0.1.0-py3-none-any.whl
| Download URL | erispulse_bilibiliadapter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c2c459ad34da76023939d9fca2b963ac8b1ffa995f0c8469900e5e098427700
|
|
BLAKE2b-256 checksum How to use checksums |
d6961c654ec7541b2e6d8c831e9e6f7ffdbc7134fcf8a57c774835c3fbd82c3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logSecurity for ErisPulse-BilibiliAdapter 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for erispulse_bilibiliadapter-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.