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-tieba-parse

v0.1.2

Published

一个用于解析百度贴吧链接,并生成帖子截图、提取内容的 Koishi 插件。

Readme

koishi-plugin-tieba-parse

npm

一个 Koishi 插件,用于解析百度贴吧链接,并生成帖子截图、提取正文、图片和视频等内容。

✨ 特性

  • 自动识别: 无需指令,在聊天中直接发送百度贴吧帖子链接即可触发。
  • 高度可定制截图:
    • 支持生成帖子长截图。
    • 可自定义截图的宽度和最大高度。
    • 自动净化页面,隐藏无关元素,生成干净的截图。
  • 多维度内容提取:
    • 可选择性地提取帖子标题、1楼的纯文本、全部图片以及视频。
  • 完善的交互:
    • 触发时会引用原消息进行提示,处理完毕后自动撤回提示,保持界面整洁。
  • 登录支持:
    • 提供管理员指令,通过扫码登录获取 Cookie,以解决需要登录才能查看的帖子或绕过验证。

📦 安装

首先,请确保您的 Koishi 项目中已经安装并配置好了 koishi-plugin-puppeteer 依赖。

在 Koishi 的插件市场中搜索 tieba-parse 并进行安装。

📖 使用

对于普通用户

在机器人所在的任何聊天中,直接发送一个百度贴吧的帖子链接即可。插件会自动进行解析和处理。

对于管理员(不登录也能用,但第一楼的内容会被登录的弹窗挡住)

本插件提供了一个指令用于获取登录百度账号所需的 Cookie。 /tieba.login: 在与机器人私聊或在群聊中发送此指令。机器人会回复一张登录二维码,请使用手机百度或百度贴吧 App 扫描。成功登录后,机器人会将获取到的 Cookie 字符串直接回复给您。请将此字符串完整复制到插件的配置项中。

📝 配置项

所有功能均可通过插件配置页进行开关和调整。

解析设置

  • width: 截图的默认宽度(像素)。默认值:800
  • screenshotHeight: 设置截图的最大高度(像素)。设置为 0 则代表不限制高度,截取帖子第一页的所有内容。默认值:0
  • showTitle: 是否在截图上方显示帖子标题。默认值:true
  • extractFirstPostText: 是否在截图前提取并发送1楼的纯文本内容。默认值:true
  • extractFirstPostImages: 是否在截图下方提取并发送1楼的全部图片。默认值:true
  • extractFirstPostVideo: 是否提取并发送1楼的视频(若存在)。默认值:true

登录信息

  • cookie: 用于登录百度贴吧的 Cookie。请通过 /tieba.login 指令获取。

调试

  • debugMode: 启用调试模式。开启后,将在后台控制台输出详细的操作日志,方便排查问题。默认值:false

使用建议

  • 当帖子需要登录才能完整显示时,建议先配置 Cookie,否则首楼正文可能被登录弹窗遮挡。

更新日志

  • v0.1.1:更新新版前端识别逻辑,防止因为默认贴吧新版前端导致的抓取失败情况发生。

⚖️ 免责声明

  1. 工具属性: 本插件是一个基于 Koishi 框架的技术工具,旨在通过聚合公开的互联网信息,为用户提供便利的浏览体验。
  2. 内容来源: 本插件展示的所有文本、图片、视频及截图内容,均来源于百度贴吧平台本身。插件开发者不拥有、不生产、不存储、也不对这些内容的合法性、准确性或完整性做任何保证。
  3. 用户责任: 使用本插件的用户,必须在遵守当地法律法规及百度贴吧平台用户协议的前提下进行。用户通过本插件获取和传播的所有信息,其责任由用户本人承担。严禁使用本插件从事任何非法活动或传播不当内容。
  4. 免责条款: 开发者不对因使用、不当使用或无法使用本插件而导致的任何直接、间接、偶然、特殊或后果性的损害承担任何责任。

您在下载、安装或使用本插件时,即表示您已阅读、理解并同意以上所有条款。