douban-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDouban Collection Export
豆瓣收藏导出
Export Douban user collections (books, movies, music, games) to CSV files.
Douban has no official data export; the official API shut down in 2018.
将豆瓣用户收藏(书籍、电影、音乐、游戏)导出为CSV文件。
豆瓣没有官方数据导出功能,官方API已于2018年关停。
What This Skill Can Do
本工具可实现的功能
- Full export of all book/movie/music/game collections via Frodo API
- RSS incremental sync for daily updates (last ~10 items)
- CSV output with UTF-8 BOM (Excel-compatible), cross-platform (macOS/Windows/Linux)
- No login, no cookies, no browser required
- Pre-flight user ID validation (fail fast on wrong ID)
- 通过Frodo API全量导出所有书籍/电影/音乐/游戏收藏
- 支持RSS增量同步每日更新内容(最近约10条条目)
- 输出带UTF-8 BOM的CSV格式(兼容Excel),跨平台支持(macOS/Windows/Linux)
- 无需登录、无需Cookie、无需浏览器即可运行
- 预校验用户ID,ID错误时可快速报错
What This Skill Cannot Do
本工具不支持的功能
- Cannot export reviews (长评), notes (读书笔记), or broadcasts (广播)
- Cannot filter by single category in one run (exports all 4 types together)
- Cannot access private profiles (returns 0 items silently)
- 无法导出长评、读书笔记或广播内容
- 单次运行无法按单个分类筛选导出(会同时导出4类内容)
- 无法访问私密个人主页(会静默返回0条数据)
Why Frodo API (Do NOT Use Web Scraping)
为什么使用Frodo API(请勿使用网页爬虫)
Douban uses PoW (Proof of Work) challenges on web pages, blocking all HTTP scraping.
We tested 7 approaches — only the Frodo API works. Do NOT attempt web scraping,
+, with cookies, or Jina Reader.
browser_cookie3requestscurlSee references/troubleshooting.md for the complete
failure log of all 7 tested approaches and why each failed.
豆瓣在网页上部署了PoW(Proof of Work,工作量证明)校验机制,会拦截所有HTTP爬虫请求。
我们测试了7种方案,仅Frodo API可用。请勿尝试网页爬虫、+、带Cookie的或Jina Reader方案。
browser_cookie3requestscurl完整的7种测试方案的失败记录及失败原因可查看references/troubleshooting.md。
Security & Privacy
安全与隐私说明
The API key and HMAC secret in the script are Douban's public mobile app credentials,
extracted from the APK. They are shared by all Douban app users and do not identify you.
No personal credentials are used or stored. Data is fetched only from .
frodo.douban.com脚本中的API密钥和HMAC密钥是豆瓣公开的移动端应用凭证,从APK中提取得到,所有豆瓣APP用户共用该凭证,不会识别你的身份。本工具不会使用或存储任何个人凭证,仅从获取数据。
frodo.douban.comFull Export (Primary Method)
全量导出(主要使用方式)
bash
DOUBAN_USER=<user_id> python3 scripts/douban-frodo-export.pyFinding the user ID: Profile URL — the ID is after .
If the user provides a full URL, the script auto-extracts the ID.
douban.com/people/<ID>//people/Environment variables:
- (required): Douban user ID (alphanumeric or numeric, or full profile URL)
DOUBAN_USER - (optional): Override output directory
DOUBAN_OUTPUT_DIR
Default output (auto-detected per platform):
- macOS:
~/Downloads/douban-sync/<user_id>/ - Windows:
%USERPROFILE%\Downloads\douban-sync\<user_id>\ - Linux:
~/Downloads/douban-sync/<user_id>/
Dependencies: Python 3.6+ standard library only (works with or ).
python3uv runExample console output:
Douban Export for user: your_douban_id
Output directory: /Users/you/Downloads/douban-sync/your_douban_id
=== 读过 (book) ===
Total: 639
Fetched 0-50 (50/639)
Fetched 50-100 (100/639)
...
Fetched 597-639 (639/639)
Collected: 639
=== 在读 (book) ===
Total: 75
...
--- Writing CSV files ---
书.csv: 996 rows
影视.csv: 238 rows
音乐.csv: 0 rows
游戏.csv: 0 rows
Done! 1234 total items exported to /Users/you/Downloads/douban-sync/your_douban_idbash
DOUBAN_USER=<user_id> python3 scripts/douban-frodo-export.py查找用户ID: 个人主页URL格式为,ID就是后面的部分。如果用户提供完整URL,脚本会自动提取ID。
douban.com/people/<ID>//people/环境变量说明:
- (必填):豆瓣用户ID(字母数字或纯数字格式,也可直接传入完整个人主页URL)
DOUBAN_USER - (可选):自定义输出目录
DOUBAN_OUTPUT_DIR
默认输出路径(根据平台自动识别):
- macOS:
~/Downloads/douban-sync/<user_id>/ - Windows:
%USERPROFILE%\Downloads\douban-sync\<user_id>\ - Linux:
~/Downloads/douban-sync/<user_id>/
依赖要求: 仅需Python 3.6+标准库即可运行(支持或方式启动)。
python3uv run控制台输出示例:
Douban Export for user: your_douban_id
Output directory: /Users/you/Downloads/douban-sync/your_douban_id
=== 读过 (book) ===
Total: 639
Fetched 0-50 (50/639)
Fetched 50-100 (100/639)
...
Fetched 597-639 (639/639)
Collected: 639
=== 在读 (book) ===
Total: 75
...
--- Writing CSV files ---
书.csv: 996 rows
影视.csv: 238 rows
音乐.csv: 0 rows
游戏.csv: 0 rows
Done! 1234 total items exported to /Users/you/Downloads/douban-sync/your_douban_idRSS Incremental Sync (Complementary)
RSS增量同步(补充功能)
bash
DOUBAN_USER=<user_id> node scripts/douban-rss-sync.mjsRSS returns only the latest ~10 items (no pagination). Use Full Export first, then RSS for daily updates.
bash
DOUBAN_USER=<user_id> node scripts/douban-rss-sync.mjsRSS仅返回最近约10条内容(无分页),请先完成全量导出,再使用RSS做每日增量更新。
Output Format
输出格式说明
Four CSV files per user:
Downloads/douban-sync/<user_id>/
├── 书.csv (读过 + 在读 + 想读)
├── 影视.csv (看过 + 在看 + 想看)
├── 音乐.csv (听过 + 在听 + 想听)
└── 游戏.csv (玩过 + 在玩 + 想玩)Columns:
title, url, date, rating, status, comment- : ★ to ★★★★★ (empty if unrated)
rating - : YYYY-MM-DD (when the user marked it)
date - Safe to run multiple times (overwrites with fresh data)
- Row counts may be slightly below Douban's displayed count due to delisted items
每个用户会生成4个CSV文件:
Downloads/douban-sync/<user_id>/
├── 书.csv (读过 + 在读 + 想读)
├── 影视.csv (看过 + 在看 + 想看)
├── 音乐.csv (听过 + 在听 + 想听)
└── 游戏.csv (玩过 + 在玩 + 想玩)字段包含:
title, url, date, rating, status, comment- :评分从★到★★★★★(未评分则为空)
rating - :格式为YYYY-MM-DD,为用户标记该条目的时间
date - 支持多次运行,会用最新数据覆盖旧文件
- 由于部分条目已下架,导出的行数可能略低于豆瓣页面显示的数量
Workflow
使用流程
- Ask for Douban user ID (from profile URL, or accept full URL)
- Run:
DOUBAN_USER=<id> python3 scripts/douban-frodo-export.py - Verify: row counts in console output should match, check with
wc -l <output_dir>/*.csv - (Optional) Set up RSS sync for daily incremental updates
- 询问用户的豆瓣ID(可从个人主页URL获取,也支持直接传入完整URL)
- 运行命令:
DOUBAN_USER=<id> python3 scripts/douban-frodo-export.py - 校验导出结果:控制台输出的行数应与预期匹配,可使用命令检查
wc -l <output_dir>/*.csv - (可选)配置RSS同步实现每日增量更新
Troubleshooting
故障排查
See references/troubleshooting.md for:
- Frodo API auth details (HMAC-SHA1 signature computation)
- Common errors (code 996 signature error, rate limits, pagination quirks)
- Complete failure log of all 7 tested approaches with root causes
- Alternative approaches (豆伴 extension, Tampermonkey script, browser console)
- API endpoint reference with response format
查看references/troubleshooting.md可获取以下内容:
- Frodo API鉴权详情(HMAC-SHA1签名计算方法)
- 常见错误说明(错误码996签名错误、速率限制、分页异常)
- 7种测试方案的完整失败日志及根本原因
- 替代方案说明(豆伴插件、Tampermonkey脚本、浏览器控制台方案)
- API接口参考及响应格式说明