# Bilibili Video Downloader — Verified MP4 Downloads (`myagizm/bilibili-video-downloader`) Actor

Download public Bilibili (bilibili.com) videos as fully verified MP4 files. Get a temporary hosted download link and SHA-256 integrity data. Anonymous access up to 360p; no login or access-control bypass.

- **URL**: https://apify.com/myagizm/bilibili-video-downloader.md
- **Developed by:** [MYM](https://apify.com/myagizm) (community)
- **Categories:** Videos, Integrations, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.65 / 1,000 video downloadeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## Bilibili Video Downloader

Download public Bilibili videos as complete, verified MP4 files and receive a temporary hosted download link with SHA-256 integrity metadata.

### What you get

Each successfully delivered video produces one dataset item with:

- A merged MP4 containing verified video and audio streams
- Actual file size, duration, and available resolution (anonymous access is capped at 360p)
- A temporary HTTPS download URL (valid for 24 hours)
- SHA-256 checksum for integrity verification

### Quick start

```json
{
  "videos": ["BV1GJ411x7h7"]
}
```

Accepts a public `bilibili.com/video/BV...` URL or BV id. A `?p=2` URL downloads that page. Up to two videos per run.

### Limits and access

- Public `bilibili.com` videos only. `bilibili.tv` uses a separate numeric-ID catalog and is not supported.
- Anonymous quality: up to 360p where available. DASH audio and video are merged when needed.
- No account login, DRM, paywall, or access-control bypass. Login-gated content and higher qualities are not attempted.
- Maximum file size: 65 MiB per video; maximum duration: one hour. You may set a lower `maxDurationSeconds` cap.
- Download links expire after 24 hours. Save the file before expiry.

### Pricing

Pay per successfully delivered video: **$0.0018 per video** on the Free tier (lower prices on eligible paid tiers). A charge is recorded only after the complete file is downloaded, verified, stored, and its consumer URL is read back successfully. Invalid, unavailable, private, login-gated, oversized, incomplete, or undelivered videos are not charged for this event. Apify platform usage may be charged separately according to your plan.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `videos` | string array | One or two public Bilibili BV ids or `bilibili.com` video URLs. |
| `maxDurationSeconds` | integer | Optional lower duration cap, from 1 to 3,600 seconds; defaults to 3,600. |

### Output

The default dataset contains one row per fully delivered video. The Downloads view includes the BV id, file name, size, duration, height, media streams, hosted URL, expiration, and SHA-256 checksum. Runs with no delivered files fail clearly and do not emit a billable event.

***

## 哔哩哔哩视频下载器

将公开的哔哩哔哩视频下载为完整并经过校验的 MP4 文件，并返回临时下载链接及 SHA-256 完整性校验值。

### 输出内容

每个成功交付的视频会生成一条数据记录，包含：

- 合并后的视频与音频 MP4 文件
- 实际文件大小、时长和可用分辨率（匿名访问最高为 360p）
- 有效期为 24 小时的 HTTPS 下载链接
- SHA-256 校验值

### 快速开始

```json
{
  "videos": ["BV1GJ411x7h7"]
}
```

支持公开的 `bilibili.com/video/BV...` 链接或 BV 号。链接中的 `?p=2` 可指定分 P 视频。每次运行最多处理两个视频。

### 限制与访问范围

- 仅支持公开的 `bilibili.com` 视频。`bilibili.tv` 使用独立的数字 ID 目录，因此不在本 Actor 的支持范围内。
- 匿名访问可用画质最高为 360p；需要时会合并 DASH 视频与音频流。
- 不登录账号，不绕过 DRM、付费限制或访问控制。需要登录的内容和更高画质不会尝试下载。
- 每个视频最大 65 MiB、最长 1 小时；可通过 `maxDurationSeconds` 设置更短的时长上限。
- 下载链接 24 小时后失效，请及时保存文件。

### 价格

仅对成功交付的视频收费：**每个视频 $0.0018**（Free 档；符合条件的付费档价格更低）。只有在完整下载、校验并保存文件，且确认消费者下载链接可用后才会记录一次收费事件。无效、不可用、私有、需要登录、超限、下载不完整或未交付的视频不收取此事件费用。Apify 平台使用费可能根据您的套餐另行计费。

### 输入

| 字段 | 类型 | 说明 |
| --- | --- | --- |
| `videos` | 字符串数组 | 一个或两个公开的 Bilibili BV 号或 `bilibili.com` 视频链接。 |
| `maxDurationSeconds` | 整数 | 可选的较短时长上限，范围 1–3,600 秒，默认 3,600 秒。 |

### 输出

默认数据集每个完整交付的视频包含一条记录。Downloads 视图提供 BV 号、文件名、大小、时长、分辨率、媒体流、下载链接、到期时间和 SHA-256 校验值。没有成功交付文件的运行会明确失败，且不会产生视频交付收费事件。

### Free plan limits

Free Apify plan users may request one video per Apify user ID per UTC day. A requested download counts even if the video is unavailable; this cap keeps large media transfers and temporary storage bounded. Paid Apify plans are unlimited. When blocked by the limit, the Actor exits successfully with 0 new files and no video-delivery charge.

### 免费计划限制

Apify 免费计划用户每个 UTC 日、每个 Apify 用户 ID 最多可请求下载 1 个视频。即使视频不可用，请求仍计数；此限制用于控制大文件传输和临时存储。付费 Apify 套餐不受此限制。达到上限时，Actor 会正常成功退出，不新增文件，也不收取视频交付费用。

# Actor input Schema

## `videos` (type: `array`):

Public bilibili.com video URLs or BV ids. The first page is used by default; add ?p=2 to select another page. Maximum 2 videos per run, 65 MiB and 1 hour per video. Anonymous access is used; login-gated videos/qualities are not bypassed. bilibili.tv is not supported.

## `maxDurationSeconds` (type: `integer`):

Optional lower duration cap. Defaults to 3600 seconds; values above 3600 are clamped. Over-limit videos are rejected before media download and are never charged.

## Actor input object example

```json
{
  "videos": [
    "BV1GJ411x7h7"
  ],
  "maxDurationSeconds": 3600
}
```

# Actor output Schema

## `results` (type: `string`):

The verified MP4 files and their temporary download URLs in the default dataset.

# 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 = {
    "videos": [
        "BV1GJ411x7h7"
    ],
    "maxDurationSeconds": 3600
};

// Run the Actor and wait for it to finish
const run = await client.actor("myagizm/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 = {
    "videos": ["BV1GJ411x7h7"],
    "maxDurationSeconds": 3600,
}

# Run the Actor and wait for it to finish
run = client.actor("myagizm/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 '{
  "videos": [
    "BV1GJ411x7h7"
  ],
  "maxDurationSeconds": 3600
}' |
apify call myagizm/bilibili-video-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,myagizm/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/WcpNRXwL1amgC4eSF/builds/7lczDL6tboxhQVvOP/openapi.json
