Bilibili Download Userscript
A powerful userscript for downloading videos from Bilibili with an intuitive floating control panel and batch download queue system.
🎬 Features
- 🎯 Smart Video Detection: Automatically detects video information from Bilibili pages
- 📥 Multiple Download Methods: Support for direct download, RPC, and AriaNG
- 🎛️ Floating Control Panel: Clean, draggable interface with quality/format selection
- 📋 Batch Download Queue: Add multiple videos and download them sequentially
- 🔧 Quality Selection: Choose from 360P to 8K Ultra HD
- 📱 Responsive Design: Works on all Bilibili video pages
- ⚡ Real-time Progress: Live download progress with speed/size tracking
- 🎨 Modern UI: Beautiful gradient design with smooth animations
🚀 Installation
Method 1: Direct Installation
- Download
belibeli-download-only.user.js
from this repository
Open your browser and install a userscript manager:
Open the downloaded .user.js
file in your browser
Click "Install" when prompted by your userscript manager
Method 2: Manual Installation
- Copy the entire content of
belibeli-download-only.user.js
- Open your userscript manager
- Create a new userscript
- Paste the code and save
🎮 Usage
Basic Usage
- Navigate to any Bilibili video page
- Look for the floating download button (📥) in the bottom-right corner
- Click it to open the control panel
- Select your preferred quality and format
- Click "🎬 Download Current" to download the video
Advanced Features
Batch Download Queue
- On video list pages, hover over video thumbnails
- Click the "+" button that appears to add videos to queue
- Open the control panel and click "▶ Start Queue" to download all queued videos
Quality & Format Options
- Quality: 360P, 480P, 720P, 1080P, 4K, 8K
- Format: MP4, DASH, FLV
- Method: Direct Download, RPC, AriaNG
RPC Download Setup
For advanced users who want to use external download managers:
- Set up an RPC server (like aria2 with RPC enabled)
- Configure the RPC settings in the control panel:
- Domain: Your RPC server address (default:
http://localhost
)
- Port: RPC port (default:
16800
)
- Token: Authentication token (if required)
🔧 Configuration
Environment Variables (for advanced users)
// In the userscript, you can modify these settings:
const CONFIG = {
download_type: 'blob', // 'blob' | 'rpc' | 'ariang' | 'web'
format: 'mp4', // 'mp4' | 'flv' | 'dash'
base_api: 'https://api.bilibili.com/x/player/playurl',
video_quality: '80', // Default quality (80 = 1080P)
// RPC Settings
rpc_domain: 'http://localhost',
rpc_port: '16800',
rpc_token: '',
// AriaNG Settings
ariang_host: 'http://ariang.injahow.com/'
};
🎯 Supported Pages
The script works on all Bilibili video pages:
- ✅ Regular videos (
/video/av123456
or /video/BV1xx411x7xD
)
- ✅ Bangumi/Anime (
/bangumi/play/ep123456
or /bangumi/play/ss12345
)
- ✅ Courses (
/cheese/play/ep123456
or /cheese/play/ss12345
)
- ✅ Video lists and collections
🛠️ Technical Details
Architecture
- Modular Design: Clean separation of concerns with dedicated classes
- Error Handling: Robust error handling with retry mechanisms
- API Integration: Uses official Bilibili APIs for reliable downloads
- Cross-browser: Compatible with all modern browsers
Classes Overview
VideoInfo
: Handles video information extraction
DownloadManager
: Manages download operations
APIRequest
: Handles API communications
DownloadQueue
: Manages batch download queue
UIController
: Controls the user interface
MessageSystem
: Handles user notifications
Security & Privacy
- ✅ No data collection
- ✅ No external tracking
- ✅ Uses only official Bilibili APIs
- ✅ Respects user's download choices
- ✅ No malicious code
🐛 Troubleshooting
Common Issues
Script not loading:
- Make sure your userscript manager is enabled
- Check that the script is enabled for Bilibili domains
- Try refreshing the page
Download fails:
- Check your internet connection
- Try a different quality setting
- Some videos may have region restrictions
Queue not working:
- Make sure you're on a video list page
- Try refreshing the page
- Check browser console for errors
Debug Mode
Open browser console and use:
// Get current video info
window.BilibiliDownload.getVideoInfo()
// Get download URL for current video
window.BilibiliDownload.getVideoURL()
// Access configuration
window.BilibiliDownload.config
📝 Changelog
v1.1.0 (Latest)
- ✨ Complete UI redesign with floating control panel
- 🎯 Improved video detection and API integration
- 📋 Added batch download queue system
- 🔧 Enhanced error handling and retry mechanisms
- 🎨 Modern gradient design with smooth animations
- 📱 Better mobile responsiveness
v1.0.0
- 🎬 Initial release with basic download functionality
- 📥 Support for multiple download methods
- ⚙️ Quality and format selection
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
)
- Commit your changes (
git commit -m 'Add some AmazingFeature'
)
- Push to the branch (
git push origin feature/AmazingFeature
)
- Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
⚠️ Disclaimer
This userscript is for educational purposes only. Please respect Bilibili's terms of service and copyright laws. The author is not responsible for any misuse of this script.
🙏 Acknowledgments
- Thanks to the Bilibili community for inspiration
- Built with jQuery for cross-browser compatibility
- Uses official Bilibili APIs for reliable operation
📞 Support
If you encounter any issues or have suggestions:
- Check the troubleshooting section above
- Open an issue on GitHub
- Provide detailed information about your problem
Happy downloading! 🎬📥