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 🙏

© 2024 – Pkg Stats / Ryan Hefner

bk

v1.1.25

Published

Download bilibili videos;B站视频下载;支持新版BV号;支持分P及一键多P下载;支持多质量选择;

Downloads

141

Readme

bk

下载B站(Bilibili)视频,功能如下:

  1. 视频下载,支持:url/av号/BV号;
  2. 分P检测及下载;
  3. 视频质量选择;
  4. 一次下载所有分P(如某一P没有指定质量,则按最高质量);
  5. 视频转码及合并,可选择格式(支持mp4/mp3);

安装

  1. 安装nodejs (https://nodejs.org), 选择LTS版本;
  2. 命令行(CMD)进行全局安装,执行:
npm i -g bk
  1. [可选]安装ffmpeg (http://ffmpeg.org/download.html) 以支持转码与合并, 选择对应系统版本安装(也可自行搜索"ffmpegp安装"查找方法);

运行

  1. 命令行运行以下命令,然后根据提示选择操作:
bk
  1. [可选]获取B站cookie(具体操作参考最下方)并按提示进行配置,可支持对应账号的视频质量,如不配置也可以(不保证有最高质量选择),注意老cookie会失败,需要更新;
  2. 处理好的视频可以命令执行当前目录下的video目录下找到;
  3. 样例:

样例图

如不能显示图片,点击此处查看


注意的问题

  • 建议在cookie.txt中配置好cookie,后面每次在同一目录启动会自动读取该cookie,但cookie会过期,记得时常更新;
  • ffmpeg如果未安装则转码会失败,但原视频有合适的播放器是可以播放的;

用到的接口

https://api.bilibili.com/x/player/playurl?avid=${avid}&cid=${cid}&qn={qn}&otype=json
https://api.bilibili.com/x/web-interface/view?aid=${avid}

如何获取B站cookie

  1. 使用B站账号登录,推荐使用谷歌浏览器(chrome);
  2. 访问任意一个视频详情页;
  3. 打开"开发者工具"(右上角3个点的选项>更多工具>开发者工具);
  4. 在开发者工具最上方选择"Network"标签;
  5. 刷新这个页面,则会看到很多的网络请求;
  6. 点击其中的第1个或第2个请求,右边看到"Request Headers"的部分,如果其中有"cookie:",且它的值中包含"_uuid=.....;",则这一大段值就是需要的cookie;
  7. 如果请求刷得比较多,再次刷新选择第1个即可,注意它的"Request URL"必须有 "www.bilibili.com" 或 "api.bilibili.com".
  8. cookie配置后将具备与此账号相同的权限(如大会员权限),不配置cookie则是普通权限,仅对下载视频质量的选择有影响;