A toolkit for exporting Bilibili following list, supporting both Python script and browser extension methods.
- ✨ Export complete Bilibili following list
- 📊 Export data in Excel format for easy viewing and analysis
- 🚀 Dual implementation: Python script and browser extension
- 🔄 Automatic pagination handling for large following lists
- 💡 Rich user information (verification status, membership status, etc.)
- UID
- Username
- Bio/Sign
- Following Time
- Verification Status
- Verification Info
- Membership Status
- Clone the repository
git clone https://github.com/fangd123/bilibili-following-exporter.git
cd bilibili-following-exporter
- Install dependencies
pip install -r requirements.txt
- Run the script
python bili_following.py
- Follow the prompts to input:
- Target user's UID
- SESSDATA value from Bilibili cookie (requires login)
Method 1: Using Developer Tools
- Open Chrome and visit Bilibili
- Make sure you are logged in to your Bilibili account
- Press
F12
orRight-click → Inspect
to open Chrome Developer Tools - Go to the "Network" tab in Developer Tools
- Click the "Preserve log" checkbox to keep the network logs
- Refresh the page
- Click on any request to bilibili.com in the network log
- In the request details, find the "Headers" section
- Scroll down to find the "Cookie" field under "Request Headers"
- Find the
SESSDATA=xxx
part in the cookie string - Copy only the value part after
SESSDATA=
(do not include the semicolon at the end)
Method 2: Using Application Tab
- Open Chrome and visit Bilibili
- Make sure you are logged in
- Press
F12
orRight-click → Inspect
to open Developer Tools - Go to the "Application" tab
- If you don't see the Application tab, click the
>>
icon to find it
- If you don't see the Application tab, click the
- In the left sidebar, expand "Cookies" and click on "https://www.bilibili.com"
- Find the row with "SESSDATA" in the Name column
- Copy the value in the "Value" column
Important Notes:
- Cookie values are sensitive information, keep them secure
- Don't share your cookies with others
- Cookies expire after a certain time
- If you log out, the cookie will become invalid
-
Install Tampermonkey browser extension
-
Click here to install the script
-
Visit any Bilibili user space page (e.g., https://space.bilibili.com/xxxxxx)
-
Click the "Export Following List" button in the bottom right corner
- Requires Bilibili account login to access data
- Please maintain reasonable request rates to avoid server strain
- Exported data is for personal use only
- Python version requires Python 3.6 or higher
bilibili-following-exporter/
├── README.md
├── README_CN.md
├── requirements.txt
├── python/
│ └── bili_following.py
└── userscript/
└── bili_following.user.js
- 🎉 Initial release
- ✨ Support for both Python script and browser extension
- 📦 Complete following list export functionality
Contributions are welcome! Feel free to submit Issues and Pull Requests.
- 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
This project is licensed under the MIT License - see the LICENSE file for details
- GitHub: @fangd123
- Thanks to Bilibili for providing the API service
- Thanks to all contributors
This tool is for educational and research purposes only. Please follow Bilibili's user agreement and relevant laws and regulations when using this tool. The project assumes no responsibility for any issues arising from the use of this tool.
- Requirements for Python script:
requests
openpyxl
- Requirements for userscript:
- Modern web browser
- Tampermonkey extension installed
Q: Why can't I export the following list? A: Make sure you:
- Are logged into Bilibili
- Have provided the correct SESSDATA
- Have proper network connectivity
- Are not making too many requests in a short time
Q: Is there a limit to how many followers I can export? A: The tool can handle any number of followers, but larger lists will take longer to export. The script includes appropriate delays to avoid rate limiting.
Q: Can I modify the exported data format? A: Yes, you can modify the Python script or userscript to customize the output format according to your needs.
If you encounter any issues or have suggestions:
- Check the Issues page
- Create a new issue if your problem isn't already listed
- Provide as much detail as possible about your problem
- Add support for following/unfollowing batch operations
- Implement data comparison between different export dates
- Add more data visualization features
- Support for exporting other user data (favorites, etc.)