{"id":21479265,"url":"https://github.com/bambooom/douban-backup","last_synced_at":"2025-10-05T10:12:57.440Z","repository":{"id":38329242,"uuid":"334328646","full_name":"bambooom/douban-backup","owner":"bambooom","description":"同步豆瓣标记条目到 Notion/NeoDB","archived":false,"fork":false,"pushed_at":"2025-05-13T03:58:32.000Z","size":410,"stargazers_count":143,"open_issues_count":2,"forks_count":319,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-13T04:30:32.551Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bambooom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-01-30T04:37:49.000Z","updated_at":"2025-05-13T03:58:36.000Z","dependencies_parsed_at":"2023-02-14T04:30:51.628Z","dependency_job_id":"cc127cb2-2b9c-4874-b6b5-b0d4201717e7","html_url":"https://github.com/bambooom/douban-backup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bambooom%2Fdouban-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bambooom%2Fdouban-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bambooom%2Fdouban-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bambooom%2Fdouban-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bambooom","download_url":"https://codeload.github.com/bambooom/douban-backup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T11:24:23.893Z","updated_at":"2025-10-05T10:12:52.394Z","avatar_url":"https://github.com/bambooom.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![sync-rss](https://github.com/bambooom/douban-backup/actions/workflows/sync-rss.js.yml/badge.svg)\n\n\u003e 详细教程 -\u003e https://zhuzi.dev/posts/2021-06-05-douban-backup-sync-notion/\n\u003e\n\u003e 油猴脚本 -\u003e https://greasyfork.org/en/scripts/420999\n\n\n```\n.\n├── archive     # 不再使用的实验时的爬虫脚本\n├── cols.json   # 可修改自定义的 Notion 表格列名\n├── .env        # 如果需要在本地 debug，可以添加这个文件\n├── scripts     # 长期不需要使用的脚本，但未来有可能需要使用\n├── src         # 会保持更新正在使用的脚本👩🏻‍💻👈\n└── userscript  # 导出时可使用的油猴脚本\n```\n\n\n## 从豆瓣 RSS 数据同步到 Notion 数据库\n\n\u003cdetails\u003e\n  \u003csummary\u003e使用油猴脚本 \u003ccode\u003eexport.user.js\u003c/code\u003e导出的 CSV 数据样例（one row）\u003c/summary\u003e\n  \u003cpre\u003e\n{\n  '标题': '无间双龙：这份爱，才是正义 / ウロボロス～この愛こそ正  義。',\n  '个人评分': '5',\n  '打分日期': '2015/03/21',\n  '我的短评': '5星打的绝对不是剧情！为建国，为toma，为一众cast就  是如此任性ˊ_\u003eˋ(1 有用)',\n  '上映日期': '2015/01/16',\n  '制片国家': '日本',\n  '条目链接': 'https://movie.douban.com/subject/25953663/'\n}\n  \u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eNotion 数据库 properties 样例数据\u003c/summary\u003e\n  \u003cpre\u003e\n{\n  '条目链接': {\n    id: '=jBf',\n      type: 'url',\n        url: 'https://movie.douban.com/subject/26277363/'\n  },\n  'IMDb 链接': {\n    id: '@ME}',\n      type: 'url',\n        url: 'https://www.imdb.com/title/tt5419278'\n  },\n  '主演': { id: 'X{lL', type: 'rich_text', rich_text: [[Object]] },\n  '个人评分': {\n    id: 'Z^ph',\n    type: 'multi_select',\n    multi_select: [ { id: 'FRXk', name: '5', color: 'pink' } ]\n    // multi_select: [], // empty array if no value for rating\n  },\n  '打分日期': {\n    id: 'e\\\\{[',\n      type: 'date',\n        date: { start: '2021-01-19', end: null }\n  },\n  '类型': {\n    id: 'pzY\u003e',\n      type: 'multi_select',\n        multi_select: [[Object], [Object]]\n  },\n  '海报': {\n    id: 't@Fv',\n    type: 'files',\n    files: [\n    {\n      name: 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2524998570.jpg'\n    }\n  ]\n  },\n  '我的短评': { id: 'wG?R', type: 'rich_text', rich_text: [[Object]] },\n  '上映年份': { id: 'xghA', type: 'number', number: 2016 },\n  '导演': { id: 'y]UL', type: 'rich_text', rich_text: [[Object]] },\n  '标题': { id: 'title', type: 'title', title: [[Object]] }\n}\n  \u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e豆瓣RSS 数据解析之后的例子\u003c/summary\u003e\n  \u003cpre\u003e\n#竹子哟竹子#✨ 的收藏\n{\n  creator: '#竹子哟竹子#✨',\n  title: '想看白蛇传·情',\n  link: 'http://movie.douban.com/subject/34825976/',\n  pubDate: 'Mon, 31 May 2021 15:14:58 GMT',\n  'dc:creator': '#竹子哟竹子#✨',\n  content:\n    `\u003ctable\u003e\u003ctr\u003e \u003ctd width=\"80px\"\u003e\u003ca href=\"https://movie.douban.com/subject/34825976/\" title=\"白蛇传·情\"\u003e \u003cimg src=\"https://img9.doubanio.com/view/photo/s_ratio_poster/public/p2645106865.webp\" alt=\"白蛇传·情\"\u003e\u003c/a\u003e\u003c/td\u003e \u003ctd\u003e \u003cp\u003e推荐: 很差/较差/还行/推荐/力荐\u003c/p\u003e \u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e`,\n  contentSnippet: '',\n  guid: 'https://www.douban.com/people/MoNoMilky/interests/2898270366',\n  isoDate: '2021-05-31T15:14:58.000Z'\n}\n{\n  creator: '#竹子哟竹子#✨',\n  title: '想看大宋提刑官',\n  link: 'http://movie.douban.com/subject/2239292/',\n  pubDate: 'Mon, 31 May 2021 15:12:13 GMT',\n  'dc:creator': '#竹子哟竹子#✨',\n  content: '\\n' +\n    '\\n' +\n    '    \u003ctable\u003e\u003ctr\u003e\\n' +\n    '    \u003ctd width=\"80px\"\u003e\u003ca href=\"https://movie.douban.com/subject/2239292/\" title=\"大宋提刑官\"\u003e\\n' +\n    '    \u003cimg src=\"https://img1.doubanio.com/view/photo/s_ratio_poster/public/p2397544089.jpg\" alt=\"大宋提刑官\"\u003e\u003c/a\u003e\u003c/td\u003e\\n' +\n    '    \u003ctd\u003e\\n' +\n    '\u003cp\u003e推荐: 还行\u003c/p\u003e\u003cp\u003e备注: 测试\n    短评第 2 行\u003c/p\u003e'\n    '    \u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\\n',\n  contentSnippet: '推荐: 还行\\n备注: 测试\\n短评第 2 行',\n  guid: 'https://www.douban.com/people/MoNoMilky/interests/2898265663',\n  isoDate: '2021-05-31T15:12:13.000Z'\n}\n  \u003c/pre\u003e\n\u003c/details\u003e\n\n---\n\nRSS 的好处一个是轻量，但又包含了个人标记的最重要的几个数据：名字、条目链接、时间、评分、短评。\n所以需求可以转换为，定时获取 RSS 更新，并对新的条目进行抓取信息并同步到 notion database。\n\n但需要注意的是，豆瓣的 RSS 数据每次都只保留 10 个，并且包括想看、想听、想读。本人的脚本同步到 Notion 的部分仅处理看过、听过、读过的条目，如果某一天集中标记数量过多，可能使 RSS 数据并未全部被 workflow 获取。\n这种情况的时候请自己手动触发脚本的运行，或者将脚本运行间隔时间改短，比如每个小时或者每两个小时。\n\nGitHub 免费用户的开源仓库，actions 暂时是完全免费，也不计时间。\n\n[查看 workflow 运行结果 -\u003e](https://github.com/bambooom/douban-backup/actions/workflows/sync-rss.js.yml)\n\n## 同时同步标记到 NeoDB\n\n\u003e [NeoDB 文档](https://neodb.social/developer/)\n\n在文档页面先生成一个 Token，然后给 repo 添加一个 secret 叫 `NEODB_API_TOKEN`。\n即可开启在豆瓣的标记会同步到 NeoDB 的功能。\n\n\n## todo\n- [x] ~~补全 notion 中的海报~~\n  - 同步时会正常插入海报信息，海报图片是豆瓣上的图片的 URL，所以在 notion 中显示不稳定。但因为 notion API 不支持上传文件，所以也无法直接插入图片。暂时不做任何优化。\n- [x] ~~userscript 添加导出 在* 和 想* 的功能~~\n  - 想* 的部分已更新\n  - 在* 的部分感觉个人需求实在不太大，已搁置\n- [x] 豆瓣的标记同步更新到 NeoDB\n- [ ] 添加 *在\\** 或者 *想\\** 列表，考虑一下如何显示？\n- [ ] 从别处更新条目，比如 NeoDB，因为部分条目在豆瓣被删除或未创建\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbambooom%2Fdouban-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbambooom%2Fdouban-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbambooom%2Fdouban-backup/lists"}