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

n8n-nodes-biliup

v0.2.2

Published

n8n community node for uploading videos to Bilibili using biliup

Readme

n8n-nodes-biliup

这是一个 n8n 社区节点,用于管理 Bilibili(B站)账号,支持二维码登录、获取用户信息等功能。

n8n 是一个可扩展的工作流自动化工具

Installation
Operations
Credentials
Usage
Resources

Installation

在 n8n 中,进入 设置 > 社区节点,搜索 n8n-nodes-biliup 并安装。

或参考 n8n 社区节点安装指南

Operations

Auth (认证) - ✅ 已实现

  • Get QR Code - 获取登录二维码 URL
  • Login by QR Code - 扫码登录并生成 cookies.json 文件
  • Check Login Status - 检查当前登录状态

User (用户) - ✅ 已实现

  • Get Info - 获取当前用户信息
  • Get Archive Pre - 获取投稿预处理信息(分区、标签等元数据)

Video (视频) - ✅ 已实现

  • Upload - 上传视频到 Bilibili(支持分片上传、多视频、封面上传)
  • Get Many - 获取已上传视频列表
  • Get - 获取视频详情(支持 BV/AV 号查询)

视频上传功能特性

本节点已集成完整的 Bilibili 视频上传功能,基于 biliup 项目核心逻辑:

支持功能

  • 分片上传:自动将大文件分片上传,提高稳定性
  • 封面上传:支持自定义封面图片
  • 完整元数据:标题、标签、分区、简介等
  • 版权声明:原创/转载选项
  • 定时发布:支持设置发布时间
  • 进度日志:实时显示上传进度

技术实现

  • 采用 Bilibili 官方 UPOS 上传接口
  • 自动获取上传凭证和线路
  • 智能分片(根据文件大小自动调整)
  • 完整的错误处理和重试机制
  • 使用 n8n 二进制数据系统:视频文件通过节点间传递,无需直接访问文件系统

如何使用上传功能

视频上传需要通过 n8n 的二进制数据系统传递文件。典型工作流如下:

[Read Binary Files] → [Biliup Upload]

示例工作流

  1. 读取视频文件

    • 使用 "Read Binary Files" 节点读取本地视频文件
    • 或使用 "HTTP Request" 节点从 URL 下载视频
    • 视频数据会存储在二进制属性中(默认名称为 data
  2. 配置上传节点

    • Resource: Video
    • Operation: Upload
    • Video Binary Property: data (或你的二进制属性名称)
    • Title: 视频标题
    • Type ID: 分区 ID(如 171 = 电子竞技)
    • Tags: 标签(逗号分隔)
    • Description: 视频简介
    • Copyright: 1=原创, 2=转载
    • Cover Binary Property: (可选)封面图片的二进制属性名称
    • Dynamic Text: (可选)动态文字
  3. 执行工作流

    • 节点会自动:
      1. 获取上传凭证
      2. 分片上传视频
      3. 上传封面(如果提供)
      4. 提交稿件信息
    • 查看日志可看到详细上传进度

完整示例

假设你有一个视频文件 /path/to/video.mp4 和封面 /path/to/cover.jpg

{
  "nodes": [
    {
      "name": "Read Video",
      "type": "n8n-nodes-base.readBinaryFiles",
      "parameters": {
        "filePaths": "/path/to/video.mp4"
      }
    },
    {
      "name": "Read Cover",
      "type": "n8n-nodes-base.readBinaryFiles",
      "parameters": {
        "filePaths": "/path/to/cover.jpg",
        "property": "cover"
      }
    },
    {
      "name": "Upload to Bilibili",
      "type": "n8n-nodes-biliup.biliup",
      "parameters": {
        "resource": "video",
        "operation": "upload",
        "videoBinaryProperty": "data",
        "coverBinaryProperty": "cover",
        "title": "我的视频标题",
        "tid": 171,
        "tag": "游戏,实况",
        "desc": "这是视频简介",
        "copyright": 1
      }
    }
  ]
}

注意事项

  1. 二进制数据:视频必须通过二进制数据传递(使用 Read Binary Files、HTTP Request 等节点)
  2. 文件大小:建议单个文件不超过 4GB
  3. 格式支持:MP4、FLV、AVI 等常见格式
  4. 网络要求:需要稳定的网络连接
  5. Cookies:必须配置有效的登录 cookies

Credentials

配置 Biliup API 凭据时需要提供:

Cookies (JSON) - Bilibili 登录 cookies,格式为 JSON 对象:

{
  "SESSDATA": "xxx",
  "bili_jct": "xxx",
  "DedeUserID": "xxx",
  "DedeUserID__ckMd5": "xxx"
}

如何获取 Cookies

推荐方式:使用工作流二维码登录(3 分钟完成)

详细教程请查看:QR_LOGIN_WORKFLOW.md

快速步骤

  1. 创建工作流并添加以下节点:
[Manual Trigger] → [Biliup: Get QR Code] → [Code] → [Biliup: Login by QR Code]
  1. Get QR Code 节点配置:

    • Resource: Auth
    • Operation: Get QR Code
  2. Code 节点(生成二维码图片):

const qrcodeUrl = $json.qrcodeUrl;
const qrImageUrl = `https://qrcode.show/${encodeURIComponent(qrcodeUrl)}?type=svg&size=300`;

return {
  json: {
    qrcodeUrl: qrcodeUrl,
    qrcodeKey: $json.qrcodeKey,
    qrImageUrl: qrImageUrl,
    message: `请在浏览器打开此链接查看二维码:${qrImageUrl}`,
  }
};
  1. Login by QR Code 节点配置:

    • Resource: Auth
    • Operation: Login by QR Code
    • QR Code Key: {{ $json.qrcodeKey }}
  2. 执行流程:

    • 执行到 Code 节点,复制输出中的 qrImageUrl
    • 在浏览器打开链接,用 Bilibili App 扫描二维码
    • 确认登录后,执行 Login by QR Code 节点
    • 在 Binary 标签页下载 cookies.json 文件
  3. 配置凭据:

    • 打开下载的 cookies.json 文件
    • 复制内容到 Biliup API 凭据的 Cookies (JSON) 字段

方法三:手动从浏览器获取

  1. 使用浏览器登录 bilibili.com
  2. 打开开发者工具 (F12)
  3. 进入 Application/Storage > Cookies
  4. 复制 SESSDATAbili_jctDedeUserID 等关键 cookies
  5. 按 JSON 格式组织后填入凭据配置

Prerequisites

无需额外依赖!

本节点直接调用 Bilibili 官方 API,无需安装任何外部程序或服务器。

Usage

示例 1: 二维码登录获取 Cookies

步骤 1: 获取二维码

  1. 添加 Biliup 节点
  2. Resource: Auth
  3. Operation: Get QR Code
  4. 执行后获得输出:
    {
      "success": true,
      "qrcodeUrl": "https://passport.bilibili.com/...",
      "qrcodeKey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
  5. 使用手机 App 扫描 qrcodeUrl

步骤 2: 扫码登录

  1. 添加第二个 Biliup 节点
  2. Resource: Auth
  3. Operation: Login by QR Code
  4. QR Code Key: {{$json.qrcodeKey}} (从步骤1获取)
  5. Max Attempts: 30 (可选,默认30次)
  6. Poll Interval: 2000 (可选,默认2秒,单位毫秒)
  7. 执行节点,等待扫码确认
  8. 登录成功后,在输出的 cookies 字段查看 cookies
  9. 下载二进制输出中的 cookies.json 文件

示例 2: 检查登录状态

  1. 配置好 Biliup API 凭据(填入 cookies)
  2. 添加 Biliup 节点
  3. Resource: Auth
  4. Operation: Check Login Status
  5. 执行后查看 isLoggedIn 字段

示例 3: 获取用户信息

  1. 配置好 Biliup API 凭据
  2. 添加 Biliup 节点
  3. Resource: User
  4. Operation: Get Info
  5. 执行后获得用户资料

Troubleshooting

Cookies 过期

Bilibili cookies 有效期通常为几个月。如果出现登录失败:

  1. 使用 Check Login Status 操作确认状态
  2. 如果已过期,重新执行二维码登录流程
  3. 更新凭据中的 cookies

二维码登录超时

如果 Login by QR Code 操作超时:

  1. 检查 Max Attempts 参数是否足够大
  2. 确保在超时前扫码并确认
  3. 二维码有效期为180秒,过期需重新获取

Resources

License

MIT