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

bilibili-get

v1.6.0

Published

Bilibili video downloader.

Downloads

58

Readme

bilibili-get

Build Status Coverage Status npm version

youtube-dl like command-line tool resolving & downloading media files from bilibili.

Features

  • Video quality selection
  • Auto-merging video segments
  • Premium account bangumi (with -C option)

WARNING using proxy with cookie may get your account banned since March 2019.

bilibili-get supports downloading video from following type of urls:

| URL | Playlist | Example | | ------------------------------- | :------: | ------------------------------------------------------- | | User-uploaded Video | | https://www.bilibili.com/video/av18182135 | | User-uploaded Video (multipart) | ✓ | https://www.bilibili.com/video/av1041170 | | User-uploaded Video (multipart) | | https://www.bilibili.com/video/av1041170/index_5.html | | Movie Bangumi | | https://www.bilibili.com/bangumi/play/ss12364/ | | TV Bangumi (A) | ✓ | https://bangumi.bilibili.com/anime/5796 | | Bangumi Episode (A) | | https://bangumi.bilibili.com/anime/5786/play#100367 | | TV Bangumi (B) | ✓ | https://www.bilibili.com/bangumi/play/ss5796 | | Bangumi Episode (B1) | | https://www.bilibili.com/bangumi/play/ep100611 | | Bangumi Episode (B2) | | https://www.bilibili.com/bangumi/play/ss21769#173345 | | TV Bangumi (C) | ✓ | https://www.bilibili.com/bangumi/media/md8892/ | | URL Redirect | | https://acg.tv/av106 |

Installation

Install via NPM:

npm install -g bilibili-get

bilibili-get uses aria2 and ffmpeg for downloading and video segment merging. They can be easily installed with a package manager.

For Homebrew users:

brew install ffmpeg aria2

For Linux/Windows users, make sure to have aria2 > 1.23.0 installed.

Usage

bilibili-get https://www.bilibili.com/video/av18182135

bilibili-get exposes similar interface with youtube-dl.

Usage: bilibili-get [options] <url>


Options:

  -o, --output [pattern]              set output pattern (default: av%(aid)s %(title)s%(#index&&"\(")s%(index)s%(#index&&"\)")s%(#index_title&&" ")s%(index_title)s.%(ext)s)
  -f, --output-format [format]        set merged output format [flv/mkv/mp4]
  -q, --quality [value]               set video quality (default: 0)
  -l, --list-formats                  list available format/quality for video(s)
  -x, --http-proxy [server]           set HTTP proxy for metadata extractor
  -C, --cookie [cookieString]         set cookie string
  -O, --download-options [key=value]  set extra aria2c command-line options (default: )
  -d, --dry-run                       run the program without any download
  -s, --silent                        suppress video quality output
  -V, --version                       output the version number
  -h, --help                          output usage information

The -o flag accepts an output template string in python string formatting method. Besides typical string formatting options, bilibili-get supports JavaScript expressions replacement expressed by syntax like %(#1+1)d.

And some of the variables are:

  • aid - the XXXXXX in avXXXXXX
  • cid - media resource id
  • ext - extension name of the output file (can be set by -f option)
  • title - title of video or bangumi
  • index - part# of a part in video or episode# of an episode in bangumi
  • index_title - a part name or bangumi episode title
  • episode_id - id of a bangumi episode
  • bangumi_id - id of a bangumi
  • quality - quality id of resolved video
  • format - format name corresponding to the video quality

Examples

List video quality/format

bilibili-get https://www.bilibili.com/video/av18182135 -l

Quality

bilibili-get https://www.bilibili.com/video/av18182135 -q 64  # 720P
bilibili-get https://www.bilibili.com/video/av18182135 -q 80  # 1080P
bilibili-get https://www.bilibili.com/video/av18182135 -q 112 # 1080P 4Kbps

Merge parts to MKV file

bilibili-get https://www.bilibili.com/video/av18182135 -f mkv

Bangumi

bilibili-get -o 'av%(aid)s - %(title)s/%(index)s%(#index_title&&" - ")s%(index_title)s.%(ext)s' -f mkv https://www.bilibili.com/bangumi/play/ss1512

Cookie of premium account

bilibili-get -C 'DedeUserID=XXXXXX; DedeUserID__ckMd5=b199851b45c91f32; sid=XXXXXXXX; SESSDATA=cf33becc%2C1241112410%2A332c1323;' -q 112 -f mkv https://www.bilibili.com/bangumi/play/ss1512

Multiple connection download

bilibili-get https://www.bilibili.com/video/av18182135 -O split=5 -O max-connection-per-server=5

Download speed limit

bilibili-get https://www.bilibili.com/video/av18182135 -O max-download-limit=300K

License

(The MIT License)