# Bilibili & Xiaohongshu Video to Text (Chinese Transcript) (`shadowell/cn-video-transcript`) Actor

Turn public Bilibili and Xiaohongshu videos into clean Simplified Chinese transcripts with timestamps. Pay only for videos that are actually transcribed.

- **URL**: https://apify.com/shadowell/cn-video-transcript.md
- **Developed by:** [FENG JIE](https://apify.com/shadowell) (community)
- **Categories:** Videos, AI, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 & Xiaohongshu Video to Text (Chinese Transcript)

Turn public Bilibili (B站) and Xiaohongshu / RedNote (小红书) videos into clean Simplified Chinese transcripts with timestamps. No account or cookies needed. You pay only for videos that are actually transcribed.

### How it works

1. Reads public video metadata (title, author, duration).
2. Downloads the lowest-bitrate audio and transcribes it with faster-whisper (`small` by default). Voice-activity filtering is always on.
3. Music-only / silent audio is detected before ASR and skipped. Prompt echoes and looped hallucinations are filtered out. Traditional characters are converted to Simplified.
4. Each video has a hard ASR time limit of max(60 s, 2 × audio length).

### Input

| Field | Default | Notes |
|---|---|---|
| urls (required) | – | Bilibili links (bilibili.com/video/BV…, b23.tv) or bare BV ids (e.g. `BV1pGnn67EC2`); Xiaohongshu links (xiaohongshu.com/explore/<id>?xsec_token=…, xhslink.com). **Xiaohongshu share links must include the `xsec_token` from the share link; tokens expire.** |
| preferOfficialSubtitles | true | Bilibili only: use a public subtitle track if one is exposed without login |
| model | small | `base` is ~3× faster, less accurate |
| language | zh | Whisper code or `auto` |
| maxDurationMinutes | 30 | Longer videos are skipped (not charged) |
| proxyConfiguration | off | Optional Apify Proxy if Bilibili/Xiaohongshu block datacenter IPs |

### Output (one item per URL)

- `text` – full transcript
- `segments[{start,end,text}]` and `timestampedText` – timestamped segments
- `title`, `author`, `platform`, `videoId`, `durationSec`, `speechSec`, `transcriptSource` (asr | official_subtitle | bilibili_ai_subtitle)
- `status` – `ok`, `no_speech`, `failed` (with `error`) or `skipped`, plus an optional `note`

### Pricing

- **$0.005 per transcribed video** plus **$0.012 per minute of audio** (each started minute).
- Example: a 5-minute video costs about **$0.065**.
- **Free:** failed, timed-out and no-speech videos (such as pure music).

### Max cost

Set a maximum total charge for the run. The run stops before exceeding it: before each video the Actor estimates its cost, and videos that don't fit the remaining budget are skipped (`status: skipped`) and never charged. A transcript is only delivered after its charge is confirmed.

### Notes

- ASR may get some homophones wrong; accuracy also drops on songs, dialects and noisy audio.
- Official subtitles are rarely available without login (Bilibili returns CC/AI subtitles only to logged-in users), so most videos are transcribed from audio.
- Public videos only; no paid, region-locked or private content. Xiaohongshu image notes are rejected; anti-bot pages may cause failures (try the proxy option).
- Media files are not stored or returned.

### Disclaimer

Only process public content you have the right to use. You are responsible for how you use the transcripts and for complying with each platform's terms.

# Actor input Schema

## `urls` (type: `array`):

Public Bilibili (bilibili.com/video/BV..., b23.tv) or Xiaohongshu video note URLs. Xiaohongshu links MUST include ?xsec_token=... (copy the full share link) or be an xhslink.com short link; tokens expire after a while.

## `preferOfficialSubtitles` (type: `boolean`):

Bilibili only. If a public subtitle track is exposed without login, use it instead of ASR. Note: Bilibili returns CC/AI subtitles only to logged-in users (need_login_subtitle). This Actor never logs in, so for most videos ASR is used and the item gets a note explaining why.

## `model` (type: `string`):

faster-whisper model. small (default) = noticeably better Chinese; base = ~3x faster/cheaper, more homophone errors.

## `language` (type: `string`):

Whisper language code (zh, en, ... or 'auto').

## `maxDurationMinutes` (type: `integer`):

Longer videos are skipped.

## `proxyConfiguration` (type: `object`):

Optional. Use Apify Proxy if Xiaohongshu/Bilibili block datacenter IPs. Off by default.

## Actor input object example

```json
{
  "urls": [
    "https://www.bilibili.com/video/BV1pGnn67EC2"
  ],
  "preferOfficialSubtitles": true,
  "model": "small",
  "language": "zh",
  "maxDurationMinutes": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

# 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 = {
    "urls": [
        "https://www.bilibili.com/video/BV1pGnn67EC2"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("shadowell/cn-video-transcript").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 = {
    "urls": ["https://www.bilibili.com/video/BV1pGnn67EC2"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("shadowell/cn-video-transcript").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 '{
  "urls": [
    "https://www.bilibili.com/video/BV1pGnn67EC2"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call shadowell/cn-video-transcript --silent --output-dataset

```

## MCP server setup

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

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/r3gv0eWXiJGNOMuF1/builds/uLYt3a6gsQTHc0gW0/openapi.json
