Bilibili Subtitle Extraction Plugin
Introduction
This is a Dify plugin for extracting subtitles from Bilibili videos. By providing a video ID, the plugin can automatically retrieve and return the subtitle content of the video, facilitating content analysis, learning, or other purposes.
Features
- Extract Bilibili video subtitles using video ID
- Return basic video information such as title and author
- Support multiple video ID formats including BV and AV numbers
- Optional subtitle language selection (dropdown)
- Optional part selection for multi-part videos
- Simple and user-friendly interface design
Prerequisites
To use this plugin, you need to provide the following Cookie information from your Bilibili account:
This information can be obtained from the browser's developer tools after logging into Bilibili.
How to Obtain Credentials
Follow the steps shown in the image above to obtain Cookie information:
- Log in to the Bilibili website
- Open browser developer tools (F12)
- Switch to the Application/Storage tab
- Find the Cookies section on the left
- Click on the bilibili.com domain
- Find and copy the values of SESSDATA, BILI_JCT, and BUVID3
Important Notice: Credentials Will Expire
- Cookie information (SESSDATA, BILI_JCT, BUVID3) has a limited lifespan and will typically expire after some time
- If the plugin encounters authentication failures or cannot retrieve subtitles, please obtain fresh Cookie information
- It is recommended to update credential information regularly to ensure the plugin works properly
Usage
- Install this plugin on the Dify platform
- Configure the necessary Cookie information
- Enter a Bilibili video ID, for example:
- (Optional) Select the subtitle language from the dropdown
- (Optional) Set the part number if the video has multiple parts
- The plugin will automatically extract and return subtitle content
Notes
- Can only extract subtitles from videos that already have subtitles; does not support automatic subtitle generation
- If subtitle language is not selected, the plugin prefers Chinese subtitles, or falls back to the first available subtitle
- Supported subtitle language options (dropdown):
- zh-Hans (Chinese)
- en-US (English)
- ja (Japanese)
- ko (Korean)
- de-DE (German)
- ru (Russian)
- If the provided part number is out of range, the plugin will return an English prompt without fetching subtitles
- Requires valid Bilibili account Cookie information
- Video ID must be a valid Bilibili video ID
- Supports multiple formats including BV and AV numbers
Privacy Statement
This plugin is only used to extract subtitle content from public videos and does not collect or store users' personal information. The provided Cookie information is only used for API access authorization and will not be used for other purposes.
Referenced Projects
This project referenced the following excellent open-source projects during development:
- dify-plugin-Bilibili-Search - A Bilibili search plugin for the Dify platform, providing reference implementation for plugin development
- bilibili-api - A comprehensive Bilibili API library providing rich API interface references
Thanks to the contributors of these projects for their contributions to the open-source community.
License
This project is licensed under the MIT License.