npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

koishi-plugin-bili-boost

v1.0.0

Published

B站增益插件 - 视频三连、直播点赞等功能

Readme

koishi-plugin-bili-boost

npm

B站增益插件 - 视频三连、直播点赞等功能

✨ 功能特性

  • 视频点赞 - 给视频点赞
  • 视频投币 - 给视频投币(1-2个)
  • 视频收藏 - 收藏视频到默认收藏夹
  • 一键三连 - 点赞+投币+收藏 ⭐
  • 直播点赞 - 给直播间点赞
  • 视频信息 - 查看视频详细信息
  • Cookie 管理 - 管理多个账号的 Cookie

📋 前置要求

本插件需要配合以下两个服务使用:

1. bilibili-cookie-service

用于获取 B站 Cookie(扫码登录)

# 安装并启动
cd bilibili-cookie-service
npm install
npm start  # 默认端口 8888

2. bili-api-service(可选)

用于获取用户信息等(本插件主要直接调用 B站 API)

# 安装并启动
cd bili-api-service
npm install
npm start  # 默认端口 9527

📦 安装

方式 1: 在线安装(推荐)

在 Koishi 插件市场搜索 bili-boost 并安装

方式 2: 本地开发

# 1. 编译插件
cd koishi-plugin-bili-boost
npm install
npm run build

# 2. 链接到 Koishi
npm link
cd /path/to/your/koishi/project
npm link koishi-plugin-bili-boost

⚙️ 配置

在 Koishi 配置文件中添加:

plugins:
  bili-boost:
    # Cookie 服务地址
    cookieServiceUrl: http://localhost:8888
    
    # API 服务地址(可选)
    apiServiceUrl: http://localhost:9527/api
    
    # 默认使用的 Cookie ID(留空自动使用第一个)
    defaultCookieId: ''
    
    # 自动刷新失效的 Cookie
    autoRefreshCookie: true
    
    # API 请求超时时间(毫秒)
    timeout: 10000

🚀 使用方法

步骤 1: 获取 Cookie

  1. 启动 bilibili-cookie-service
  2. 访问 http://localhost:8888
  3. 扫码登录获取 Cookie

步骤 2: 在 Koishi 中使用

# 查看 Cookie 列表
bili.cookie.list

# 设置默认 Cookie(可选)
bili.cookie.set <cookie_id>

# 视频一键三连
bili.triple BV1xx411c7mD

# 单独操作
bili.like BV1xx411c7mD      # 点赞
bili.coin BV1xx411c7mD 2    # 投币2个
bili.fav BV1xx411c7mD       # 收藏

# 直播点赞
bili.live.like 123456

# 查看视频信息
bili.info BV1xx411c7mD

📖 命令列表

Cookie 管理

| 命令 | 说明 | |------|------| | bili.cookie.list | 查看可用的 Cookie 列表 | | bili.cookie.set <id> | 设置默认使用的 Cookie | | bili.cookie.refresh [id] | 刷新 Cookie(可选指定 ID) |

视频操作

| 命令 | 别名 | 说明 | |------|------|------| | bili.like <BV号> | 点赞 | 给视频点赞 | | bili.coin <BV号> [数量] | 投币 | 给视频投币(1-2个) | | bili.fav <BV号> | 收藏 | 收藏视频 | | bili.triple <BV号> | 三连 | 一键三连 ⭐ | | bili.info <BV号> | - | 查看视频信息 |

直播操作

| 命令 | 别名 | 说明 | |------|------|------| | bili.live.like <房间号> | 直播点赞 | 给直播间点赞 |

帮助

| 命令 | 说明 | |------|------| | bili.help | 查看插件帮助 |

💡 使用示例

视频三连

# 完整命令
bili.triple BV1xx411c7mD

# 使用别名
三连 BV1xx411c7mD

# 响应示例
📺 三连操作结果:

✅ 点赞成功
✅ 投币成功
✅ 收藏成功

完成度: 3/3

单独操作

# 点赞
bili.like BV1xx411c7mD
✅ 点赞成功!

# 投币(默认1个)
bili.coin BV1xx411c7mD
✅ 投币成功!(1 个硬币)

# 投币2个
bili.coin BV1xx411c7mD 2
✅ 投币成功!(2 个硬币)

# 收藏
bili.fav BV1xx411c7mD
✅ 收藏成功!

直播点赞

bili.live.like 123456
✅ 直播间点赞成功!

查看视频信息

bili.info BV1xx411c7mD

📺 视频信息

标题: 【标题】
UP主: UP主名称
播放: 100000
点赞: 10000
投币: 5000
收藏: 3000
分享: 1000

🔗 https://www.bilibili.com/video/BV1xx411c7mD

🔧 Cookie 管理

查看 Cookie 列表

bili.cookie.list

📋 可用的 Cookie 列表:

1. ✅ 用户名1 [默认]
   ID: uuid-1
   UID: 12345678

2. ✅ 用户名2
   ID: uuid-2
   UID: 87654321

设置默认 Cookie

bili.cookie.set uuid-1
✅ 已设置默认 Cookie: 用户名1

刷新 Cookie

# 刷新指定 Cookie
bili.cookie.refresh uuid-1
✅ Cookie 刷新成功: 用户名1

# 刷新所有 Cookie
bili.cookie.refresh
刷新完成:
✅ 成功: 2
❌ 失败: 0

⚠️ 注意事项

Cookie 有效期

  • SESSDATA 有效期通常为 30 天
  • Cookie 失效后需要重新登录
  • 插件会自动检测 Cookie 状态

操作限制

  • 投币: 同一视频最多投 2 个硬币
  • 点赞: 重复点赞会返回"已点赞"
  • 收藏: 收藏到默认收藏夹
  • 三连: 会尝试所有操作,部分失败不影响其他

风控提醒

  • 不要频繁操作,可能触发风控
  • 建议间隔 3-5 秒
  • 被风控后需要在网页端验证

🔗 API 调用流程

用户命令
    ↓
从 Cookie 服务获取 Cookie
    ↓
带 Cookie 调用 B站 API
    ↓
返回操作结果

📊 服务架构

Koishi 插件
    ↓
bilibili-cookie-service  (获取 Cookie)
    ↓
B站官方 API  (执行操作)

🐛 故障排查

问题 1: 没有可用的 Cookie

解决方案:

  1. 确认 bilibili-cookie-service 正在运行
  2. 访问 http://localhost:8888 扫码登录
  3. 运行 bili.cookie.list 确认 Cookie 可用

问题 2: Cookie 失效

解决方案:

# 方法 1: 刷新 Cookie
bili.cookie.refresh

# 方法 2: 重新登录
访问 http://localhost:8888 重新扫码

问题 3: 操作失败

可能原因:

  • Cookie 失效
  • 网络问题
  • 触发风控
  • 视频不存在

解决方案:

  1. 检查视频 BV 号是否正确
  2. 运行 bili.cookie.refresh 刷新 Cookie
  3. 等待几分钟后重试

问题 4: 无法连接 Cookie 服务

解决方案:

# 检查服务是否运行
curl http://localhost:8888/api/health

# 检查配置
bili.help  # 查看配置的服务地址

🔄 工作流程

三连流程

1. 接收命令 bili.triple BV1xx411c7mD
2. 从 Cookie 服务获取 Cookie
3. 获取视频信息(获取 aid)
4. 并发执行:
   - 点赞
   - 投币(1个硬币)
   - 收藏
5. 返回三个操作的结果

Cookie 管理流程

1. Cookie 服务扫码登录 → 保存 Cookie
2. 插件获取 Cookie 列表
3. 选择或自动使用第一个
4. 定期验证 Cookie 有效性
5. 失效时提示重新登录

📚 开发

构建

npm install
npm run build

调试

npm run dev

目录结构

koishi-plugin-bili-boost/
├── src/
│   ├── index.ts                  # 主入口
│   └── services/
│       ├── cookie-manager.ts     # Cookie 管理
│       └── bilibili.ts           # B站 API 调用
├── lib/                          # 编译输出
├── package.json
├── tsconfig.json
└── readme.md

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 许可证

MIT License

🔗 相关项目

📞 支持


提示: 本插件仅用于学习和个人使用,请遵守 B站用户协议和相关法律法规。