# Bilibili Video Downloader (`maximedupre/bilibili-video-downloader`) Actor

Download public Bilibili videos as MP4 files, with a separate audio file link. Get the title, uploader, view and like counts, tags, chapters and optional comments for each link. Full links and short b23.tv links both work.

- **URL**: https://apify.com/maximedupre/bilibili-video-downloader.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Videos, Social media, For creators
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $202.50 / 1,000 video downloads

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### 📥 Download Bilibili videos as MP4 with audio links

Bilibili Video Downloader is for creators, researchers, archivists and teams who need Bilibili video files and video details from a list of links. Paste public Bilibili video links and get one result per video. Each result has the MP4 file link, a separate audio file link, the title, uploader, counts, tags, chapters and optional comments.

- Download a Bilibili video as an MP4 file, with a separate audio file link, from a full link or a short b23.tv link.
- Check the video versions Bilibili offers, with resolution, frame rate, codec and bitrate.
- Read view, like, comment, share and favorite counts for each video.
- Collect the uploader name, profile link, followers and verified status.
- Save the public comments of each video, with author, likes and date.

#### 🎬 What you get for each video

Each result is one dataset row for one video. It includes the title, description, duration, thumbnail, publication date, category and tags. It also has chapters and the background music title when Bilibili gives them, and the available video and audio versions.

With a quality of low, medium or high, each row also has a link to the MP4 file and a link to the audio file. These links come straight from Bilibili and expire about 2 hours after the run, so save the files soon. Choose "Details only" to get the video information with no file links.

#### 🚀 How to run it

1. Add your public Bilibili video links to **Video links**. Use one link per row.
2. Pick a **Download quality**. The default is Medium.
3. Turn on **Include comments** if you want public comments too.
4. Start the Actor and open the results in the **Bilibili videos** table.

A link with `?p=2` reads that part of a video with several parts. A part number that does not exist gives no result for that link.

#### ⚙️ Input

**Input fields**

| Field | Type | What it does |
| --- | --- | --- |
| `videoUrls` | array | Required. Public Bilibili video links, one per row. Full `bilibili.com/video/BV...` links, `av` links and short b23.tv links work. Each link must start with `https://`. |
| `maxItems` | integer | Stops after this many videos. Leave it empty or use `0` to process every link. The form has a prefill of `1`, but there is no schema default. |
| `quality` | string | Quality of the MP4 file. `low` is the lowest quality a video offers, `medium` the middle one and `high` the highest. Most videos offer two qualities, so medium and high often give the same file. `none` returns details only, with no file links. Default: `medium`. |
| `includeComments` | boolean | Adds the public comments of each video to its result. Default: `false`. |
| `maxComments` | integer | Maximum comments per video, where available. Use `0` for all available comments. Used only when `includeComments` is on. Default: `20`. |

**Example input**

```json
{
  "videoUrls": [
    {
      "url": "https://www.bilibili.com/video/BV1xx411c7mD"
    }
  ],
  "maxItems": 1,
  "quality": "high",
  "includeComments": false,
  "maxComments": 20
}
```

#### 🧾 Output

**Output fields**

| Field | Type | What it does |
| --- | --- | --- |
| `videoUrl` | string | Link to the Bilibili video page. |
| `title` | string | Title of the video. |
| `description` | string | Description of the video. |
| `duration` | integer | Length of the video in seconds. |
| `thumbnailUrl` | string | Link to the thumbnail image. |
| `publishedAt` | string | Date and time the video was published, in ISO 8601 format. |
| `category` | string | Category of the video. |
| `tags` | array of strings | Tags of the video. |
| `videoFileUrl` | string | Link to download the MP4 file. Not set when you choose details only. |
| `audioFileUrl` | string | Link to download the audio file. Not set when you choose details only. |
| `videoVersions` | array of objects | Video versions Bilibili offers for the video. |
| `videoVersions[].resolution` | string | Resolution, such as `1920x1080`. |
| `videoVersions[].frameRate` | number | Frames per second. |
| `videoVersions[].codec` | string | Video codec. |
| `videoVersions[].bitrate` | integer | Bitrate in bits per second. |
| `audioVersions` | array of objects | Audio versions Bilibili offers for the video. |
| `audioVersions[].codec` | string | Audio codec. |
| `audioVersions[].bitrate` | integer | Bitrate in bits per second. |
| `audioTitle` | string | Title of the background music, when Bilibili gives it. |
| `chapters` | array of objects | Chapters of the video, when Bilibili gives them. |
| `chapters[].title` | string | Chapter title. |
| `chapters[].startTime` | number | Chapter start time in seconds. |
| `uploader.name` | string | Name of the uploader. |
| `uploader.profileUrl` | string | Link to the uploader profile. |
| `uploader.avatarUrl` | string | Link to the uploader avatar image. |
| `uploader.followerCount` | integer | Number of followers of the uploader. |
| `uploader.isVerified` | boolean | Whether Bilibili shows the uploader as verified. |
| `viewCount` | integer | Number of views. |
| `likeCount` | integer | Number of likes. |
| `commentCount` | integer | Number of comments. |
| `shareCount` | integer | Number of shares. |
| `favoriteCount` | integer | Number of times viewers saved the video. |
| `comments` | array of objects | Public comments on the video. Only present when you turn on `includeComments`. |
| `comments[].text` | string | Text of the comment. |
| `comments[].author` | string | Name of the comment author. |
| `comments[].likeCount` | integer | Number of likes on the comment. |
| `comments[].publishedAt` | string | Date and time of the comment, in ISO 8601 format. |

**Example row (quality `high`)**

```json
{
  "videoUrl": "https://www.bilibili.com/video/BV1xx411c7mD",
  "title": "字幕君交流场所",
  "duration": 2055,
  "publishedAt": "2009-09-09T01:09:09.000Z",
  "viewCount": 5627747,
  "likeCount": 278851,
  "commentCount": 89750,
  "shareCount": 29296,
  "favoriteCount": 128609,
  "description": "www",
  "thumbnailUrl": "https://i0.hdslb.com/bfs/archive/transparent.png",
  "category": "音乐综合",
  "uploader": {
    "name": "碧诗",
    "profileUrl": "https://space.bilibili.com/2",
    "avatarUrl": "https://i2.hdslb.com/bfs/face/ef0457addb24141e15dfac6fbf45293ccf1e32ab.jpg",
    "followerCount": 1439371,
    "isVerified": true
  },
  "videoVersions": [
    {
      "resolution": "512x384",
      "frameRate": 15,
      "codec": "hev1.1.6.L120.90",
      "bitrate": 69367
    },
    {
      "resolution": "512x384",
      "frameRate": 14.925,
      "codec": "avc1.64001E",
      "bitrate": 155817
    },
    {
      "resolution": "512x384",
      "frameRate": 15.009,
      "codec": "av01.0.01M.08.0.110.01.01.01.0",
      "bitrate": 206531
    },
    {
      "resolution": "480x360",
      "frameRate": 15,
      "codec": "hev1.1.6.L120.90",
      "bitrate": 64231
    },
    {
      "resolution": "480x360",
      "frameRate": 14.925,
      "codec": "avc1.64001E",
      "bitrate": 155622
    },
    {
      "resolution": "480x360",
      "frameRate": 15.009,
      "codec": "av01.0.01M.08.0.110.01.01.01.0",
      "bitrate": 206445
    }
  ],
  "audioVersions": [
    {
      "codec": "mp4a.40.2",
      "bitrate": 68646
    },
    {
      "codec": "mp4a.40.2",
      "bitrate": 134695
    }
  ],
  "videoFileUrl": "https://upos-hz-mirrorakam.akamaized.net/upgcxcode/31/21/62131/62131-1-48.mp4?e=ig8euxZM2rNcNbRVhwdVhwdlhWdVhwdVhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&oi=3304526551&platform=pc&gen=playurlv3&os=akam&og=hw&trid=622f778b294e4c7f9ad64628cb7d6ccu&nbs=1&mid=0&deadline=1795076060&upsig=1299d806b895b0dd8e985c05c0bcb7ea&uparams=e,uipk,oi,platform,gen,os,og,trid,nbs,mid,deadline&hdnts=exp=1795076060~hmac=7ee1d40ae6e5f54a0c90987324d804488de96c45cba31300dccaaa6e0dc12e42&bvc=vod&nettype=0&bw=382538&lrs=0&V=v3.1.2&agrr=1&buvid=&build=0&dl=0&f=u_0_0&qn_dyeid=d74f40824ca72c5a0002b08f6afe93bc&orderid=1,2",
  "audioFileUrl": "https://upos-hz-mirrorakam.akamaized.net/upgcxcode/31/21/62131/62131_da3-1-30232.m4s?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&platform=pc&oi=3304526551&mid=0&nbs=1&uipk=5&os=akam&trid=e8bef34f1b43457e81defec40338ea7u&deadline=1795076059&gen=playurlv3&og=cos&upsig=37d0814150ddbe6ab3f09a88404164e9&uparams=e,platform,oi,mid,nbs,uipk,os,trid,deadline,gen,og&hdnts=exp=1795076059~hmac=05b4cc80cc84b51cc74a11e44357c7402cbe0b22e44f59e126245c2dcd4c9782&bvc=vod&nettype=0&bw=134737&lrs=0&V=v3.1.2&f=u_0_0&qn_dyeid=22f95324685e87e80058b2936afe93bc&agrr=1&buvid=&build=0&dl=0&orderid=1,2"
}
```

#### 💳 Pricing

This Actor uses pay per event pricing. You pay for each event below, plus a small run start charge of $0.005. Prices fall on higher Apify plans. The amounts below are for the Free plan.

| Event | Price | When it is charged |
| --- | --- | --- |
| Video download | $0.27 | One video with its details and links to an MP4 file and an audio file. |
| Video details | $0.099 | One video with its details and no file links, when you choose "Details only". |
| Comment | $0.002 | One public comment with its text, author, like count and date. |

Comments are charged one by one, so set `maxComments` to control the cost.

#### 🔌 Integrations

Run this Actor from the Apify API, schedule it, or connect it to other tools with Apify integrations.

https://www.youtube.com/watch?v=bNACk1_S_6w\&list=PLObrtcm1Kw6MUrlLNDbK9QRg8VDJg0gOW\&index=4

#### ❓ FAQ

##### Can I download a Bilibili video without a login?

Yes. The Actor reads public videos and needs no Bilibili account or cookie.

##### Do I get the audio too?

Yes. Each result has a separate link to the audio file. The audio is not merged into the MP4 file.

##### Which quality should I choose?

Low gives the lowest quality a video offers, and high gives the highest. Most videos offer two qualities, so medium and high often give the same file. Check `videoVersions` for what Bilibili offers for a video.

##### How long do the download links last?

The links expire about 2 hours after the run. Download the files soon after the run ends.

##### What if I only want the video information?

Set `quality` to `none`. You get the details, counts, tags and versions with no file links, charged as Video details.

##### Can I download one part of a video with several parts?

Yes. Add `?p=` and the part number to the link. The part number must be a positive whole number. If that part does not exist, you get no result for that link.

##### Can I get the comments of a video?

Yes. Turn on `includeComments` and set `maxComments`. Use `0` to get all available comments. Each comment is charged.

##### Does it work with short links?

Yes. Short b23.tv links work, and so do full `bilibili.com/video` links.

### 📝 Changelog

**v0.0** (19-11-2026)

- Initial release.

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~bilibili-video-downloader/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Related Actors

- [Bilibili Video Scraper](https://apify.com/maximedupre/bilibili-video-scraper): collect Bilibili video details in bulk without downloading files.
- [Bilibili Creator Scraper](https://apify.com/maximedupre/bilibili-creator): look up Bilibili creators and their profile data.
- [Douyin Video Downloader](https://apify.com/maximedupre/douyin-video-downloader): download Douyin videos, the Chinese short video app.
- [Douyin Comments Scraper](https://apify.com/maximedupre/douyin-comments-scraper): collect comments from Douyin videos.
- [TikTok Video Downloader](https://apify.com/maximedupre/tiktok-video-downloader): save TikTok videos from links.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

## `videoUrls` (type: `array`):

Public Bilibili video links to process. Add one link per row. Short b23.tv links work too. Each link must be a full URL that starts with https://.

## `maxItems` (type: `integer`):

Stop after this many videos. Leave empty or use 0 to process every link you submit.

## `quality` (type: `string`):

Quality of the MP4 file to download. Low gets the lowest quality a video offers, Medium the middle one, and High the highest one. Most videos offer only two qualities, so Medium and High often give the same file. Choose details only to get video information with no file.

## `includeComments` (type: `boolean`):

Add the public comments of each video to its result. Each comment returned is charged as its own event.

## `maxComments` (type: `integer`):

Up to this many comments per video, where available. Use 0 for all available comments. Only used when Include comments is on.

## Actor input object example

```json
{
  "videoUrls": [
    {
      "url": "https://www.bilibili.com/video/BV1xx411c7mD"
    }
  ],
  "maxItems": 1,
  "quality": "medium",
  "includeComments": false,
  "maxComments": 20
}
```

# Actor output Schema

## `overview` (type: `string`):

Video details and download links for each video.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "videoUrls": [
        {
            "url": "https://www.bilibili.com/video/BV1xx411c7mD"
        }
    ],
    "maxItems": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/bilibili-video-downloader").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "videoUrls": [{ "url": "https://www.bilibili.com/video/BV1xx411c7mD" }],
    "maxItems": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/bilibili-video-downloader").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    {
      "url": "https://www.bilibili.com/video/BV1xx411c7mD"
    }
  ],
  "maxItems": 1
}' |
apify call maximedupre/bilibili-video-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,maximedupre/bilibili-video-downloader"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/2cscHaLOQAnYqN1iG/builds/eTrSFvYFWBBVrTHlv/openapi.json
