dsh-webwhale-bili: DSH Embedded Workbench for Self-Operated Bilibili Accounts

Preface

When building Bilibili account capabilities within DSH, the common practice is to write separate scripts or scattered pages: login credentials are hard to manage, real write operations are difficult to unify, and interactions/drafts can easily become detached from the host. dsh-webwhale-bili is a client-side plugin released by maintainer shengmk, providing a “Bilibili Workspace” embedded page in the DSH Desktop sidebar. It consolidates Overview, Fodder, Creation, Settings, Health Check, and Controlled Write Bridge into a single interface. Below is an introduction to what it does, how to install it, how to configure it for the first time, and the boundaries to watch out for when using it.

What is this

The plugin injects the host via cordis.patch.yml. The host side is responsible for QR code login, read-only data bridge, and controlled write RPC; the client bundle registers the sidebar and main panel, and does not connect directly to the Bilibili API.

Core Features

Interface and Navigation

With the sidebar entry plus the main panel, the zones include: Overview, Fodder, Creation, Settings, Health Check. Real write operations go through a confirmation queue rather than calling dangerous interfaces directly in the UI.

The first time it opens, there is a configuration guide: Scan login test account → Confirm common configuration → Enter workspace; you can also “Watch Demo” to skip, reopening the guide later from the “Config” header.

The main page provides 12 console items, as well as three usable cards for Fodder / Creation / Settings and several placeholders; clicking a card enters the sub-page within the panel, from which you can return.

Login and Credentials

Bilibili QR code login is generated by the host; the client only gets the data URL, status, and account name. Cookies are written locally to:

~/.dsh/webwhale-bili/credentials.json

File permissions are 0600 and are not included in logs. Entries with videos in comments/replies are rendered as Video "..." external links, opening in a new window.

Owner Authorization and Follows

owners.activeSource is a global radio button, distinguishing manual sources from mutual sources; members carry the source tag; bili.mutual is a read-only mutual list. Follows must go through request/approve before execution and cannot bypass the process.

Read-Only Data Bridge

After login, the host gets account information via nav, gets “Replies to Me” via x/msgfeed/reply, and reads the recent upload list (WBI signature, read-only). The Interaction tab displays real replies, video links, and uploads; it supports inputting a BV number to read comments for a specific video, and saving a single comment as a “Draft” to the content library. All related requests are GET, with no writes to Bilibili.

Auto-Reply (B Mode)

lib/auto-reply.js polls DMs every 90 seconds: Master and low-risk messages from known mutuals are replied to directly; other low-risk messages go to review, high-risk messages to confirmation; non-master @s are ignored. On first startup, only a baseline is established and old messages are not replied to; there is a 10-minute cooldown for the same sender. A kill switch can immediately disable it.

Real Write Bridge (Controlled)

lib/bili-write.js provides capabilities for sending DMs, following, video comments, etc. The naked bili.sendDm / bili.postComment RPCs have been removed: DMs mainly go through B Mode auto-reply, and follows only go through request/approve/execute. The write RPCs require the owner browser principal (browserPeer / connection.admit); model/tool peers cannot approve. Real publishing is permanently disabled.

Local Content Loop (A3–A6)

Supports creating, editing, submitting for approval, approving, and rejecting (rejection reason is mandatory). Approval binds content_id + version; old approvals are marked as approval_stale after editing. When the kill switch is enabled, all write RPCs are rejected, and recovery requires a server-side challenge.

Computer Use (Experimental, Disabled by Default)

The config option computerExperimental=false is the default. Daily follow/unfollow are prohibited from using CU, only follow.request and the API are used. The action queue is allowed only after enabling the experiment. Safe actions have a 60s token, dangerous actions trigger a popup per action. The executor is only for Windows, therefore the README marks Windows 10/11 as the priority environment.

Dependency Check and Health Check

The first configuration or health check checks qrcode, ffmpeg, node: missing qrcode can be installed via npm; ffmpeg is only detected, not silently downloaded (affects frame extraction/covers). The Health Check card detects Node, ffmpeg, credentials, login state, data directory, and the kill switch in real-time.

Installation and Enablement

The plugin runs under DSH process permissions; it is recommended to review the repository source code and the MIT license before installing.

Environment Requirements

DSH Desktop >= 0.2.2-rc.1 且 < 0.3.0
Node.js >= 22
Windows 10/11 优先(Computer Use 执行器仅 Windows)
ffmpeg 可选
  1. Open DSH Desktop: Settings → Plugins → Add Plugin
  2. Paste the repository address:
https://github.com/shengmk/dsh-webwhale-bili

If the interface supports short names, you can also use:

github:shengmk/dsh-webwhale-bili
  1. Wait for DSH to complete installation and dependency installation
  2. Enable dsh-webwhale-bili
  3. Restart DSH (the bundle layer requires a restart)
  4. Refresh the page; “Bilibili Workspace” should appear on the left

Method B: npm Package

In the plugin manager input:

dsh-webwhale-bili

If the short name resolution fails, you can specify the version:

dsh-webwhale-bili@0.1.14

Package page: https://www.npmjs.com/package/dsh-webwhale-bili

Method C: Offline zip

Download the source zip from Releases (e.g., dsh-webwhale-bili-0.1.14-source.zip), unzip it, run npm install --omit=dev in the directory, then add the plugin via local bundle or link: path. After enabling, restarting DSH is still required.

First-time Opening Guide

After the installation steps above, it is recommended to complete the guide when entering the workspace for the first time:

  1. Dependency check (qrcode / ffmpeg / node)
  2. Scan login
  3. Set Master, Persona, and Auto-Reply
  4. Enter workspace

Manual verification of scan: Clicking “Scan login test account” should display a QR code; the status should go through waiting → scanned → success, and the account name should return to the page.

Upgrade and Uninstall

When upgrading, it is recommended to reinstall/update in the plugin manager, keeping the data directory ~/.dsh/webwhale-bili/, and restarting DSH; see MIGRATION.md inside the repository for old library migration instructions. When uninstalling, simply disable/remove it in the plugin manager; data is still retained in that directory by default, and manual deletion is required for a complete cleanup.

Typical Usage Summary

Below summarizes the reproducible flows in the README according to daily paths, making it easy to align with interface operations.

  1. View Interaction: After login, open the interaction-related tab to view real “Replies to Me”, uploads, and video links; if you need to dig into a specific video, input the BV number to pull comments, and you can save a single comment as a draft.
  2. Manage Follows: Under the read-only mutual and owner authorization rules, execute follows via the request/approve flow, not relying on the removed naked RPC.
  3. Manage DMs: Poll and tier-process under B Mode auto-reply and kill switch constraints; non-master @s are not automatically processed.
  4. Manage Drafts and Approval: New or edit drafts in the A3–A6 flow, submit for approval; editing marks old approvals as approval_stale; write operations are constrained by the owner browser identity and the kill switch.
  5. Do Health Check: Use the health check card to verify Node, ffmpeg, credentials, login state, and data directory; install ffmpeg if missing as prompted.

Host-side changes (routing, scanning, tools) require a restart of DSH; only client bundle changes require a page refresh.

Applicable Scenarios and Notes

Who is it for: Developers or operators already using DSH Desktop who need to centrally manage Bilibili test account interactions, DM tiered replies, and drafts/approvals locally, and can accept “real publishing disabled, write operations require strong confirmation”.

Architecture Boundaries (Explicit in README):

  • The client does not import @deepseek-ai/dsh-client-*; React requires the baseline require('react') from the host.
  • The client does not request the Bilibili API directly; QR code and account validation are in the host.
  • Credentials are only saved to 0600 files; UI and audit do not echo cookies.
  • Does not record SESSDATA / bili_jct; Computer Use is disabled by default.

Ecology Note: DSH advocates “Everything is a plugin”; SkillHub is a community directory with no official affiliation with DeepSeek/Huafang. This text does not describe it as an “Official App Store”.

Conclusion

dsh-webwhale-bili brings the Bilibili sidebar workspace, local credential storage, read-only data bridge, and controlled write bridge into a single DSH embedded page. It is suitable for those who need to self-manage test accounts while keeping risks inside the confirmation queue and owner identity. Refer to the repository README and MIGRATION.md for more details and migration.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye