Bilibili Video Downloader avatar

Bilibili Video Downloader

Pricing

from $2.99 / 1,000 results

Go to Apify Store
Bilibili Video Downloader

Bilibili Video Downloader

๐Ÿš€ Bilibili Video Downloader (bilibili-video-downloader) lets you download Bilibili videos fast and easilyโ€”save offline in high quality. ๐Ÿ“ฅ Supports simple, secure workflows for creators and viewers. ๐ŸŽฌ Try it today.

Pricing

from $2.99 / 1,000 results

Rating

0.0

(0)

Developer

Scrapers Hub

Scrapers Hub

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Share

๐Ÿ“น Bilibili Video Downloader: The Ultimate Metadata and Media Extraction Tool ๐Ÿš€

In the rapidly evolving landscape of digital content, Bilibili has emerged as a cornerstone of global video sharing, particularly within the ACG (Anime, Comic, and Games) community and the burgeoning field of educational and professional content in Asia. ๐ŸŒ To navigate this vast ocean of data, developers, researchers, and content creators require a tool that is not only powerful but also precise and reliable. โš“ The Bilibili Video Downloader is that toolโ€”a professional-grade Apify actor engineered to bridge the gap between Bilibili's complex infrastructure and your data needs. ๐ŸŒ‰

This documentation provides an exhaustive guide to the Bilibili Video Downloader, covering everything from basic configuration to advanced technical nuances. ๐Ÿ“š By leveraging industry-standard extraction libraries like yt-dlp and integrating seamlessly with the Apify platform's robust proxy and scaling capabilities, this actor ensures that you can extract high-fidelity video metadata, DASH stream links, and subtitles with unparalleled ease. ๐Ÿš„


โœจ Key Features and Capabilities ๐Ÿ› ๏ธ

The Bilibili Video Downloader is built with a focus on depth and accuracy. It doesn't just "scrape" a page; it performs a deep inspection of Bilibili's internal API responses to provide a complete picture of every video.

1. ๐Ÿ“Š High-Fidelity Metadata Extraction

The actor captures a wide array of metadata points, ensuring that you have all the context needed for analysis or archiving:

  • ๐Ÿ“Œ Core Info: Video ID (BVID), Title, Description, and Thumbnail URLs.
  • ๐Ÿ“ˆ Engagement Metrics: Real-time View Counts, Like Counts, and Comment Counts.
  • โฑ๏ธ Temporal Data: Exact video duration and upload timestamps.
  • ๐Ÿท๏ธ Categorization: Full lists of video tags and categories.

2. ๐ŸŽฅ Advanced DASH Stream Recovery

Unlike simple downloaders that only provide a single MP4 link, this tool extracts the full suite of DASH (Dynamic Adaptive Streaming over HTTP) formats. This includes:

  • ๐Ÿงฉ Multiple Codecs: Support for AVC (H.264), HEVC (H.265), and the cutting-edge AV1.
  • ๐Ÿ“บ Resolution Variety: From 360P mobile-optimized streams to breathtaking 4K Ultra HD.
  • โšก Bitrate Precision: Detailed bitrate information for both video and audio tracks, allowing you to choose the perfect balance between quality and file size.
  • ๐ŸŽต Separate Tracks: Independent access to high-quality audio streams (AAC, FLAC where available).

3. ๐Ÿ’ฌ Comprehensive Subtitle Support

Bilibili is a global platform, and its content often features multilingual subtitles. Our downloader identifies and extracts:

  • ๐Ÿ“œ Internal Subtitles: Official subtitles provided by the uploader.
  • ๐Ÿค– Auto-Generated Captions: Machine-translated or AI-generated captions where available.
  • ๐ŸŒ Multiple Languages: Support for Chinese (Simplified/Traditional), English, Japanese, and more.

4. ๐Ÿ‘ค Creator and Channel Insights

Understanding the source is as important as the content. The actor provides:

  • ๐Ÿ“› Uploader Name: The display name of the content creator.
  • ๐Ÿ†” Uploader ID: The unique MID (Member ID) for the creator's profile.
  • ๐Ÿ”— Channel Links: Direct URLs to the creator's Bilibili space.

5. ๐Ÿ—๏ธ Production-Ready Infrastructure

Built to run on the Apify platform, the actor benefits from:

  • ๐ŸŒ Proxy Integration: Full support for Apify Proxy, including Residential and Datacenter groups, to ensure high success rates and bypass geo-restrictions.
  • ๐Ÿ“ฆ Batch Processing: The ability to process hundreds or thousands of URLs in a single run.
  • ๐Ÿ› ๏ธ Robust Error Handling: Sophisticated retry logic and error reporting to ensure your jobs finish even when faced with temporary network issues.

โš™๏ธ Input and Output Configuration ๐Ÿ“‹

This section details the structure of the data you provide to the actor and the structured JSON data it returns. Proper configuration is key to maximizing the efficiency of your scraping tasks.

Input Parameters

The Bilibili Video Downloader uses a streamlined input schema designed for both ease of use and flexibility.

FieldTypeDescriptionRequiredDefault
urlsArrayA list of Bilibili video URLs (e.g., https://www.bilibili.com/video/BV...).Yes[]
proxyConfigurationObjectStandard Apify Proxy configuration settings. Allows you to specify proxy groups (e.g., RESIDENTIAL) and country-specific exit nodes.No{ "useApifyProxy": true }

JSON Input Example

{
"urls": [
"https://www.bilibili.com/video/BV1hj411i7rX/",
"https://www.bilibili.com/video/BV1uT411P79x/"
],
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"]
}
}

Output Data Structure

The actor outputs a list of objects to the Apify dataset. Each object represents a single video and contains the following fields:

FieldTypeDescription
idStringThe Bilibili video identifier (e.g., "BV1hj411i7rX").
titleStringThe full title of the video.
descriptionStringThe video's description text (supports multi-line).
thumbnailStringA high-resolution URL for the video thumbnail.
durationIntegerTotal length of the video in seconds.
view_countIntegerThe number of views at the time of scraping.
like_countIntegerThe number of likes.
comment_countIntegerThe number of comments.
upload_dateIntegerUnix timestamp of the video upload.
uploaderStringThe username of the video uploader.
uploader_idStringThe unique numerical ID of the uploader.
uploader_urlStringLink to the uploader's Bilibili Space.
mediasArrayA list of DASH stream objects (video and audio).
subtitlesObjectA map of available subtitles by language code.
tagsArrayA list of strings representing the video's tags.
urlStringThe original URL processed.
sourceStringAlways "bilibili".
errorBooleanWhether an error occurred during processing.

JSON Output Example

Below is a truncated example of the output generated for a high-quality video:

{
"id": "BV1hj411i7rX",
"title": "ใ€bilibili่ถ…็บง็ง‘ๅญฆๆ™šใ€‘ๅ…จ็จ‹ๅ›ž้กพ๏ผˆไธŠ๏ผ‰",
"description": "่ฟ™้‡Œๆ˜ฏ๏ผŒbilibili่ถ…็บง็ง‘ๅญฆๆ™šใ€‚\nๅฎž้ชŒ๏ผŒๆ˜ฏๆฃ€้ชŒ็ง‘ๆŠ€็š„ๅ”ฏไธ€ๆ ‡ๅ‡†ใ€‚",
"thumbnail": "http://i0.hdslb.com/bfs/archive/848f6f5517e2fac24da4da7c912a6187923defbe.jpg",
"duration": 5966,
"view_count": 2182089,
"like_count": 22447,
"comment_count": 354,
"upload_date": 1698496200,
"uploader": "ๅ“”ๅ“ฉๅ“”ๅ“ฉๅผนๅน•็ฝ‘",
"uploader_id": "8047632",
"uploader_url": "https://space.bilibili.com/8047632",
"medias": [
{
"format_id": "dash-video-80-avc",
"url": "https://upos-hz-mirrorakam.akamaized.net/...",
"extension": "m4s",
"width": 1920,
"height": 1080,
"fps": "30",
"vcodec": "avc1.640032",
"acodec": "none",
"quality": "1080P AVC",
"type": "video"
},
{
"format_id": "dash-audio-30216",
"url": "https://upos-hz-mirrorakam.akamaized.net/...",
"extension": "m4s",
"quality": "41kbps",
"type": "audio"
}
],
"tags": ["bilibili่ถ…็บง็ง‘ๅญฆๆ™š", "็ง‘ๆŠ€", "็ง‘ๆ™ฎ"],
"url": "https://www.bilibili.com/video/BV1hj411i7rX/",
"source": "bilibili",
"error": false
}

๐Ÿงฌ Technical Architecture and Extraction Logic ๐Ÿ’ป

The Bilibili Video Downloader is not just a wrapper; it is a sophisticated extraction engine that handles the intricacies of modern web video delivery.

The Power of yt-dlp

At its core, the actor utilizes yt-dlp, the gold standard for video extraction. We have customized the configuration to handle Bilibili's specific security measures, including:

  • ๐Ÿ–ฅ๏ธ Custom User-Agents: Mimicking modern web browsers to avoid "412 Precondition Failed" errors.
  • ๐Ÿ”‘ Header Injection: Providing appropriate Referer and Origin headers to satisfy Bilibili's CORS and anti-hotlinking policies.
  • ๐Ÿ“ก Protocol Handling: Correctly parsing DASH manifests to reconstruct high-quality media streams.

Codec and Quality Mapping

Bilibili provides multiple versions of the same video to ensure compatibility across devices. Our actor maps these to a standardized quality system:

  • ๐ŸŽž๏ธ AVC (Advanced Video Coding): Maximum compatibility, standard quality.
  • ๐Ÿš€ HEVC (High Efficiency Video Coding): Superior compression, used for 4K and HDR content.
  • ๐Ÿ’Ž AV1: The latest in open-source video compression, providing the highest quality at the lowest bitrate.

The actor automatically classifies streams into quality tiers (360P, 480P, 720P, 1080P, 4K) based on the height and internal quality numbers (QN) used by Bilibili.

Handling Asynchronous Operations

The scraper is built using Python's asyncio library. This allows it to:

  • ๐ŸŽ๏ธ Concurrent Processing: Process multiple URLs in parallel (where allowed by platform limits).
  • ๐Ÿ”„ Non-blocking Retries: Perform retries for failed requests without halting the entire scraping job.
  • ๐Ÿƒ Efficient Resource Usage: Minimal CPU and memory overhead compared to browser-based scrapers.

๐Ÿ›ก๏ธ Proxy Configuration and Anti-Blocking ๐ŸŒ

Scraping Bilibili at scale requires a sophisticated approach to network management. Bilibili employs several layers of protection, including rate limiting and geo-fencing.

Why You Need Proxies

  1. ๐Ÿ›‘ Rate Limiting: Making too many requests from a single IP address will lead to temporary bans or CAPTCHAs.
  2. ๐Ÿ—บ๏ธ Geo-Restrictions: Some content on Bilibili is restricted to specific regions (primarily Mainland China). Using a proxy with the correct exit node can bypass these limits.
  3. ๐Ÿ’Ž Data Integrity: Proxies ensure that you are seeing the content as a regular user would, avoiding "shadow-banning" of your IP.

Apify Proxy Integration

The actor is fully integrated with Apify Proxy. We recommend the following settings for optimal performance:

  • ๐Ÿ  Residential Proxies: These are the most reliable as they use IP addresses assigned to real households, making them nearly impossible to distinguish from genuine traffic.
  • ๐Ÿค– Automatic Group Selection: Apify's smart proxy selection can automatically choose the best group for your needs.

Professional Best Practices

To ensure your scraper remains undetected and efficient:

  • โณ Randomized Delays: The actor includes built-in random delays between requests to mimic human behavior.
  • ๐ŸŽญ Rotating Identities: By using a pool of proxies, the actor rotates its "identity" for every request, preventing pattern recognition by Bilibili's anti-bot systems.

๐ŸŒŸ Common Use Cases ๐Ÿ“‚

The Bilibili Video Downloader is used by a diverse range of professionals for various applications:

  • ๐Ÿ“š Media Archiving and Preservation: Digital historians and hobbyists use the tool to save high-quality versions of videos that might otherwise be removed or censored.
  • ๐Ÿ“Š Market and Content Analysis: Marketing teams analyze view counts, likes, and tags to understand trending topics on Bilibili.
  • ๐ŸŽ“ Academic Research: Sociologists and linguists use the metadata and subtitles for large-scale studies on cultural trends.
  • ๐Ÿค– AI and Machine Learning Training: Developers use the extracted data to train recommendation algorithms.

โšก Performance and Scalability ๐Ÿ“ˆ

When running large-scale scraping jobs, performance is paramount. The Bilibili Video Downloader is optimized for high-throughput operations.

Batch Processing

The actor can take a large list of URLs as input. Instead of starting a new actor for every video, it iterates through the list, reusing connections and maintaining efficiency.

Scaling on Apify

You can scale your scraping operations by:

  • Increasing Memory: Allocating more memory to the actor allows it to handle larger datasets and more concurrent operations.
  • Parallel Runs: Running multiple instances of the actor simultaneously to process tens of thousands of URLs in a fraction of the time.

๐Ÿ”— Integration and API Usage ๐Ÿ”Œ

The Bilibili Video Downloader is designed to be a building block in your larger data pipeline.

Calling via Apify API

You can trigger the actor programmatically using a simple POST request:

curl --request POST \
--url https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs?token=YOUR_TOKEN \
--header 'Content-Type: application/json' \
--data '{
"urls": ["https://www.bilibili.com/video/BV1hj411i7rX/"]
}'

Webhooks for Automation

Set up webhooks to automatically notify your backend systems when a scraping job is complete. This allows for fully automated data ingestion pipelines.


๐Ÿ› ๏ธ Error Handling and Troubleshooting ๐Ÿ”

Even the best scrapers encounter issues. Here's how the Bilibili Video Downloader handles them:

Common Error Messages

  • ๐Ÿšซ "Video unavailable": The video may have been deleted, set to private, or restricted in your proxy's region.
  • ๐Ÿ›‘ "412 Precondition Failed": Bilibili has detected the scraper. Try switching to Residential proxies or reducing the frequency of requests.
  • โฒ๏ธ "Timeout": The network connection was lost. The actor will automatically retry up to 3 times before giving up.

Troubleshooting Steps

  1. ๐Ÿ›ก๏ธ Check Your Proxies: Ensure your Apify Proxy subscription is active and that you have enough data.
  2. โœ… Verify URLs: Ensure the URLs are correct and follow the bilibili.com/video/BV... format.
  3. ๐Ÿ“œ Review Logs: The actor provides detailed logs in the Apify console. Look for specific error messages from yt-dlp.

๐Ÿค” Why Choose Bilibili Video Downloader? ๐Ÿ†

In a market saturated with browser extensions and generic "all-in-one" video downloaders, the Bilibili Video Downloader stands out as a specialized, server-side solution. Hereโ€™s why professional users prefer this actor over other alternatives:

1. ๐Ÿ—๏ธ Server-Side Reliability

Browser extensions are often brittle, breaking every time Bilibili updates its frontend. ๐Ÿงฉ Because our actor interacts with Bilibili's underlying data streams and APIs, it is far more resilient to UI changes. ๐Ÿ›ก๏ธ Furthermore, running on Apify's infrastructure means you don't need to keep your computer on; the actor runs in the cloud, handling heavy lifting and large batches while you focus on other tasks. โ˜๏ธ

2. ๐Ÿ“บ High-Resolution DASH Support

Many generic downloaders only grab the "legacy" MP4 stream, which is often capped at 720P or has poor bitrate. ๐Ÿ“‰ Bilibili uses DASH (Dynamic Adaptive Streaming over HTTP) to deliver its high-quality content. ๐ŸŽฅ Our tool is specifically designed to parse these complex manifests, giving you access to the true 1080P, 4K, and high-frame-rate (60FPS) versions that other tools miss. ๐Ÿ’Ž

3. ๐Ÿšซ No Installation Required

Thereโ€™s no need to install shady software or bloatware on your machine. ๐Ÿ’ป Everything happens within the secure, sandboxed environment of the Apify platform. ๐Ÿ”’ This is particularly important for corporate users and researchers who must adhere to strict security protocols. ๐Ÿ“‘

4. ๐Ÿ“Š Comprehensive Metadata, Not Just Video

Most tools only give you a video file. ๐ŸŽž๏ธ We give you the entire context. ๐Ÿง  Knowing the view count, tags, and uploader history is often just as valuable as the video itself for data scientists and market researchers. ๐Ÿ“‰


๐Ÿ“– Detailed Step-by-Step Guide for New Users ๐Ÿš€

If you are new to the Apify platform or web scraping in general, follow this guide to get your first dataset in minutes.

Step 1: Sign up for an Apify Account ๐Ÿ‘ค

Visit Apify.com and create a free account. You will receive a starting balance of trial credits that you can use to run this actor. ๐ŸŽ

Step 2: Navigate to the Bilibili Video Downloader ๐Ÿ”

Search for "Bilibili Video Downloader" in the Apify Store. Once youโ€™re on the actor page, click "Try for free." ๐Ÿš€

Step 3: Configure Your Input โŒจ๏ธ

In the "Input" tab, you will see a field for "Bilibili Video URLs." Copy and paste the URLs of the videos you want to scrape. You can enter one URL per line or provide them as a JSON array. ๐Ÿ“‹

  • Example URL: https://www.bilibili.com/video/BV1hj411i7rX/

For a few videos, the default settings will work fine. However, if you are scraping more than 10-20 videos, go to the "Proxy configuration" section and select "Residential." This ensures your requests are not blocked by Bilibili. ๐ŸŒ

Step 5: Click "Run" โ–ถ๏ธ

Hit the big green "Run" button at the bottom of the page. The actor will start up, and you can watch the live logs as it processes each URL. โš™๏ธ

Step 6: Download Your Data ๐Ÿ“ฅ

Once the status changes to "Succeeded," go to the "Dataset" tab. Here, you can preview your data and export it in your preferred format: JSON, CSV, Excel, XML, or even HTML table. ๐Ÿ“Š


๐Ÿ”’ Data Security and Privacy Compliance ๐Ÿ“‘

We take data privacy and security seriously. When using the Bilibili Video Downloader, you can rest assured that:

  • ๐Ÿ›ก๏ธ No Personal Data Stored: The actor does not store any of your personal Bilibili account information. It operates entirely on publicly available data unless you explicitly provide session cookies (advanced feature). ๐Ÿ•ต๏ธ
  • ๐Ÿ”’ Secure Infrastructure: All scraping occurs within Apify's SOC 2 Type II compliant infrastructure. Your input URLs and output data are encrypted at rest and in transit. ๐Ÿ”
  • ๐Ÿ“œ Compliance with Robots.txt: While the actor is designed to be efficient, we encourage users to follow ethical scraping practices and respect the robots.txt files and rate limits of the target platform. โš–๏ธ

๐ŸŒ Bilibili's Content Ecosystem: What Can You Extract? ๐Ÿ“บ

Bilibili is more than just a "Chinese YouTube." It is a cultural phenomenon with a unique structure. Understanding this ecosystem helps you make the most of the data you extract.

๐Ÿง  The Rise of "Knowledge" Content

In recent years, Bilibili has seen a massive surge in educational content. ๐ŸŽ“ From university-level mathematics to professional software engineering tutorials, the "Knowledge" partition is one of the most active on the site. ๐Ÿ“š Researchers use our tool to archive these tutorials before they are moved behind paywalls. ๐Ÿ”“

๐ŸŽญ Virtual YouTubers (VTubers)

Bilibili is a primary hub for VTubers. ๐ŸฆŠ The metadata extracted by our toolโ€”particularly engagement metrics like likes and commentsโ€”is used by talent agencies to track the performance of their virtual idols and understand audience sentiment. ๐Ÿ“Š

๐ŸŽž๏ธ PGC vs. UGC

The platform features both Professional Generated Content (PGC) like officially licensed anime and User Generated Content (UGC). ๐ŸŽฅ Our downloader is optimized for UGC, providing deep insights into the creative output of millions of independent creators. ๐ŸŽจ


๐Ÿ’ก Advanced Proxy Tips: Country-Specific Scraping ๐Ÿ—บ๏ธ

For users with specific needs, Apify Proxy allows for granular control over your exit nodes.

Bypassing "Not Available in Your Region"

If you encounter videos that are only viewable in Mainland China, you can configure the actor to use a proxy located in China. In the proxyConfiguration object, you can specify the country:

{
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"],
"targetCountry": "CN"
}
}

Improving Speed with Datacenter Proxies

If you are scraping non-restricted, public videos and need high speed at a lower cost, Datacenter proxies are a viable option. However, be aware that Bilibili is more likely to challenge these IPs with CAPTCHAs.


๐Ÿ› ๏ธ Extending the Actor for Custom Needs ๐Ÿงฉ

The Bilibili Video Downloader is built on a modular Python codebase. If you are a developer, you can extend its functionality in several ways:

1. Adding Custom Metadata Fields

By modifying the map_format and main.py files, you can extract additional fields from the yt-dlp info dictionary, such as "chapters," "heatmaps," or "live status."

2. Integration with Cloud Storage

You can modify the actor to automatically upload the extracted media files to an S3 bucket or Google Cloud Storage instead of just providing the URLs.

3. Sentiment Analysis Pipeline

Connect the output of this actor to a Natural Language Processing (NLP) actor to perform real-time sentiment analysis on the video descriptions and comments.


Frequently Asked Questions (FAQ) - Continued

Can I extract "Bullet Comments" (Danmaku)? ๐Ÿ’ฌ

Currently, this actor focuses on video metadata and media streams. Danmaku extraction is a complex task due to the high volume of comments and their unique XML format. This feature is on our roadmap for future updates. ๐Ÿ—บ๏ธ

Does it support 60FPS or HDR? ๐Ÿ“บ

Yes! If the uploader has provided a 60FPS or HDR version, the actor will identify and extract the corresponding DASH streams. Look for these details in the format_note or quality fields of the medias array. โœจ

Why are some media URLs expiring? โฑ๏ธ

Bilibili's media URLs are signed with a temporary token. They are intended for immediate use. If you need to access the video later, you should download the media file to your own storage immediately after scraping. ๐Ÿ’พ


๐Ÿ’ฐ Pricing and Resources ๐Ÿ’Ž

The Bilibili Video Downloader is available on the Apify platform. Usage is billed based on:

  • Compute Units: The amount of CPU and RAM used during the run.
  • Proxy Data: The volume of data transferred through Apify Proxy.

Trial Credits

Every new Apify user gets $5 in trial credits every month. This is enough to scrape hundreds of Bilibili videos for free.

Support and Custom Development

For issues, feature requests, or custom scraper development, please contact the developer or open an issue in the project repository. We offer bespoke scraping solutions for enterprise clients with unique data requirements.

Happy scraping!