π₯ Batch Download Feishu Documents | π³ Wiki Sub-pages Recursion | π Export as Markdown/PDF
δΈζζζ‘£ | English Documentation
- π¦ Batch Download - Download multiple documents at once with batch URL input
- π³ Wiki Sub-pages Recursion - Automatically download all sub-pages under a Wiki page (unique feature)
- π Markdown/PDF Export - Flexible export formats with complete document structure
- π Document Links Recursion - Automatically download all linked documents
- π¨ Web UI - Clean and beautiful web interface
- π Real-time Progress - Live progress bar and status updates
- πΎ Auto-save Config - Credentials saved automatically
- β Credential Validation - Automatic validation when saving config
- π₯οΈ Cross-platform - Works on Windows, macOS, Linux
- Python 3.7+
- Dependencies:
requests- HTTP requestsflask- Web servermarkdown- Markdown conversion (for PDF export)weasyprint- PDF generation (for PDF export)
git clone https://github.com/ACEEE-1222/feishu-batch-downloader.git
cd feishu-batch-downloaderBasic features (Markdown export):
pip install -r requirements.txtOr install manually:
pip install requests flaskFull features (including PDF export):
pip install requests flask markdown weasyprintpython3 web_ui.pyThen open in browser: http://localhost:3000
Step 1: Create Application
- Visit Feishu Open Platform
- Click "Create Enterprise Self-built Application"
- Fill in application name and description
Step 2: Get Credentials
- Enter application management page
- Go to "Credentials & Basic Info"
- Copy separately:
- App ID (format:
cli_xxxxxxxxxx) - App Secret (long string, different from App ID)
- App ID (format:
Step 3: Configure Permissions (Important!)
Method 1: Batch Import (Recommended)
- Go to "Permissions & Scopes" page
- Click "Batch Configure Permissions"
- Paste the following JSON code:
{
"scopes": {
"tenant": [
"docx:document:readonly",
"drive:drive:readonly",
"wiki:wiki:readonly"
],
"user": [
"docx:document:readonly",
"wiki:wiki:readonly"
]
}
}Method 2: Manual Addition
docx:document:readonly- Read document contentdrive:drive:readonly- Read drive fileswiki:wiki:readonly- Read wiki content (Required for Wiki documents)
Step 4: Publish Application
- Go to "Version Management & Release"
- Create version
- Apply for release
- Publish to internal enterprise
Step 5: Save Config in Web UI
- Enter App ID and App Secret
- Click "Save Configuration"
- System will automatically validate credentials
Single Document:
- Paste document link
- Choose save location
- Select export format (Markdown or PDF)
- Click "Start Download"
Batch Download:
- Paste one document link per line
- Choose save location and format
- Click "Start Download"
Wiki Sub-pages Recursion:
- Paste Wiki parent page link
- Check "Recursive Download"
- Automatically downloads all sub-pages
- Real-time progress display
Easiest way for all users:
python3 web_ui.pyOpen browser and visit http://localhost:3000
Features:
- Recursive Wiki: Downloads all sub-pages under a Wiki page
- Recursive Documents: Downloads all linked documents
- Export Format: Choose Markdown or PDF
- Real-time Progress: Progress bar and status updates
For advanced users and automation:
# Configure credentials
python3 feishu_downloader.py config
# Download single document
python3 feishu_downloader.py download DOC_ID
# Download from URL
python3 feishu_downloader.py download https://example.feishu.cn/docx/xxxxx
# Recursive download
python3 feishu_downloader.py download DOC_ID --recursive
# Specify output directory
python3 feishu_downloader.py download DOC_ID -o ~/Documents/feishuWhen entering a Wiki page URL with "Recursive Download" checked:
- Downloads parent page
- Automatically discovers all sub-pages
- Recursively downloads each sub-page
- Shows real-time progress (e.g.,
[1/8],[2/8]...) - Avoids duplicate downloads
Example:
Input: https://my.feishu.cn/wiki/ParentPageID
Output:
βββ Parent Page.md
βββ Sub Page 1.md
βββ Sub Page 2.md
βββ ...
In the text box, enter one document link per line:
https://example.feishu.cn/docx/doc1
https://example.feishu.cn/docx/doc2
https://example.feishu.cn/wiki/wiki1
Click download to process all documents sequentially.
When PDF format is selected:
- Automatically converts Markdown to PDF
- Preserves complete document structure and styles
- Supports Chinese fonts
- Code block syntax highlighting
~/.config/feishu-downloader/config.json
{
"app_id": "cli_xxx",
"app_secret": "xxx"
}- β Text formatting (bold, italic, strikethrough, inline code)
- β Headings (H1-H9)
- β Lists (ordered, unordered)
- β Code blocks
- β Quotes
- β Wiki sub-pages recursion
- β Batch download
- β Markdown (.md)
- β PDF (.pdf)
- β³ Tables
- β³ Image download
- β³ Multi-threaded concurrent download
- Check if
app_idandapp_secretare correct - Ensure application has required permissions
- Make sure application is published
- Verify document URL is correct
- Check if application has access to the document
- Ensure document exists and is not deleted
- Wiki documents require
wiki:wiki:readonlypermission
Tool automatically handles rate limiting with retry. If frequently triggered:
- Reduce concurrent downloads
- Increase download interval
Make sure PDF export dependencies are installed:
pip install markdown weasyprintfeishu-batch-downloader/
βββ feishu_downloader.py # Core download logic (CLI)
βββ web_ui.py # Web UI server
βββ templates/
β βββ index.html # Web UI interface
βββ requirements.txt # Python dependencies
βββ README.md # English documentation
βββ README_CN.md # Chinese documentation
βββ LICENSE # MIT License
Contributions are welcome! Feel free to submit Pull Requests.
- Fork the project
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is licensed under the MIT License - see LICENSE file for details
- Feishu Open Platform for API documentation
- Open source community contributors
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Discussions
- Knowledge Base Backup - Batch backup Feishu knowledge base documents
- Wiki Export - Export entire Wiki space with all pages
- Document Migration - Migrate Feishu documents to other platforms
- Offline Reading - Download as Markdown/PDF for offline access
- Version Control - Include documents in Git version management
- Automated Backup - Integrate into CI/CD for automatic backups
- β Single/batch document download
- β Wiki sub-pages recursion
- β Markdown and PDF export
- β Web UI interface
- β Real-time progress display
- β Automatic credential validation
Made with β€οΈ by Open Source Community