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 🙏

© 2025 – Pkg Stats / Ryan Hefner

bilibili-save-nodejs

v1.0.0

Published

下载B站视频/音频,支持单个URL下载或一键下载UP主所有内容。提供命令行工具和Nodejs的API

Readme

bilibili-download-nodejs

仓库地址

安装

npm i bilibili-save-nodejs

功能

  • [x] 根据 URL 下载单个作品
  • [x] 根据 UP 主的主页 URL 下载所有作品
  • [x] 可选择下载视频或音频

使用方法

使用命令行工具

bili-download

根据命令行菜单选择要下载的内容和形式

夹带私货:一键追星,下载九三的所有视频:

bili-download -d

使用 Node.js API

| 函数名 | 作用 | | --------------------- | ------------------------- | | download | 下载 | | downloadByVedioPath | 根据视频 URL 下载单个作品 | | downloadByHomePath | 根据 UP 主页下载所有作品 |

API 参数

注:三个函数的参数都为对象形式。

download

| 参数名 | 是否必须 | 取值范围 | 含义 | | -------------- | -------- | ------------------------ | ---------------------------------------- | | downloadRange | 是 | ['byAuthor','byVedio'] | 根据作者主页 URL作品 URL | | downloadType | 是 | ['mp4','mp3'] | 下载视频音频 | | downloadPath | 是 | 无 | 合法的作品 URLUP 主页 URL | | downloadFolder | 否 | 无 | 存储目录的完整路径,缺省时使用默认值 |

目录默认值:

  • 视频:根目录下/video文件夹中
  • 音频:根目录下/audio文件夹中

demo:

const { download } = require("bilibili-download-nodejs");
download({
  downloadRange: "byAuthor",
  downloadType: "mp4",
  downloadPath: "https://space.bilibili.com/313580179",
})
  .then(() => console.log("下载成功"))
  .catch((e) => console.log("下载出错"));

downloadByVedioPath & downloadByHomePath

| 参数名 | 是否必须 | 取值范围 | 含义 | | ------ | -------- | --------------- | ---------------------- | | type | 是 | ['mp4','mp3'] | 下载视频音频 | | url | 是 | 无 | 合法的作品 URL | | folder | 是 | 无 | 存储目录的完整路径 |

demo:

const { downloadByVedioPath, downloadByHomePath } = require("./download.js");
const path = require("path");

// 下载单个作品的视频
downloadByVedioPath({
  url: "https://www.bilibili.com/video/BV1AL4y1L7cg",
  type: "mp4",
  folder: path.join(__dirname, "/foo"),
})
  .then(() => console.log("下载成功"))
  .catch((e) => console.log("下载出错"));

// 下载UP主所有作品的音频
downloadByHomePath({
  url: "https://space.bilibili.com/313580179",
  type: "mp3",
  folder: path.join(__dirname, "/bar"),
})
  .then(() => console.log("下载成功"))
  .catch((e) => console.log("下载出错"));