Yu Mingtao114 downloadsSync your Douyin favorites into Obsidian notes with metadata, tags, transcripts and video attachments.
Sync your Douyin (抖音) favorites into Obsidian notes — preserving captions, tags, covers, videos, and Whisper transcripts.
Backend required: This plugin communicates with a local Python backend service. Please set up douyin-favorites-sync-backend first.
douyin_id frontmatterDesktop only — the plugin uses Node.js
fsto copy video/image attachments into the vault.
Obsidian Plugin (TypeScript) Local Backend (Python/FastAPI)
┌─────────────────────────┐ ┌──────────────────────────┐
│ Ribbon icon / Commands │ │ FastAPI + SQLite │
│ Settings Tab │ ◄──────► │ /api/health │
│ Vault Writer │ HTTP │ /api/sync/favorites │
│ Status Bar │ │ /api/jobs/extract (job) │
└─────────────────────────┘ │ /api/config/vault │
│ Web UI (history / auth) │
└──────────────────────────┘
main.js, manifest.json, styles.css into your vault's .obsidian/plugins/douyin-favorites-sync/ directoryhttp://127.0.0.1:8765) and sync options in the settings panelCtrl/Cmd+P):| Command | Description |
|---|---|
| 立即同步抖音收藏 | Fetch favorites and import new items now |
| 检查后端连接状态 | Ping the backend (/api/health) |
Notes are saved as <Note Folder>/<author ≤24 chars>-<title ≤56 chars>.md (duplicates get a -2 suffix); attachments go to <Attachment Folder>/<douyin_id>/.
npm install
npm run dev # Watch mode
npm run build # Production build → main.js
Each Douyin favorite generates a Markdown file (headings in Chinese; Heavy mode embeds the local video file instead of a link):
---
type: douyin
content_type: video
douyin_id: "7456789012345"
author: "Author Name"
source: "https://www.douyin.com/video/..."
create_time: "2025-01-01T00:00:00.000Z"
tags:
- douyin
- tag1
---
# Note Title
![[attachments/douyin/7456789012345/video.mp4]] (Heavy mode)
[Watermark-free video link](https://...) (Light mode)
## 配图

## 文案
Video description text...
## 转写
Whisper speech transcription text...
| Setting | Description | Default |
|---|---|---|
| Backend URL | Local Python backend service address | http://127.0.0.1:8765 |
| Note Folder | Vault path for Douyin notes | Douyin |
| Attachment Folder | Path for video/image attachments | attachments/douyin |
| Sync Mode | Light or Heavy | light |
| Auto Sync | Enable daily automatic sync | On |
| Daily Sync Time | Format HH:MM | 09:00 |
| Whisper Model | Speech-to-text model for Heavy mode (tiny → large-v3) |
small |
| Open Last Note | Auto-open the newest note after a manual sync | Off |
| Extract Delay | Wait between items during Heavy extraction, anti rate-limit (0–60 s) | 10 |
The Obsidian community review flags a Direct Filesystem Access warning because this plugin uses the Node.js
fsmodule. Here is exactly what happens:
What fs is used for:
A single call to fs.readFile() in src/vaultWriter.ts reads binary files (video .mp4, cover images) from the local backend's download directory into the Obsidian vault.
Why it's needed:
The Obsidian Vault API (vault.createBinary, vault.modifyBinary) only accepts data that is already inside the Obsidian process. When the Python backend downloads a video to a temp directory (outside the vault), the plugin must use Node.js fs to read the binary data before passing it to the Vault API.
What fs does NOT do:
Data flow:
Backend downloads video/image → fs.readFile() from backend's temp dir
→ App.vault.createBinary() writes into vault
All vault writes (notes, attachments) go through the Obsidian Vault API only. The plugin is desktop-only because Node.js fs is not available on mobile Obsidian.
| Problem | Fix |
|---|---|
| "Cannot connect to backend" | Make sure the backend is running (./start-backend.sh); verify the URL/port in settings; run the "检查后端连接状态" command |
| Heavy extraction is slow on the first item | The first Heavy run downloads the Whisper model (internet required); pick tiny/base for speed. No system FFmpeg needed — audio decoding is bundled |
| Settings changes don't take effect | Restart the plugin, or Cmd+P → "Reload app without saving" |
| Old notes keep the old format | Existing notes are never modified; only new imports use the current template |
| Sync succeeded but no new notes | Already-imported items are skipped via douyin_id deduplication |
main.js missing after manual install |
Build from source: npm install && npm run build |
将抖音收藏自动同步为 Obsidian 笔记,保留文案、标签、封面、视频和语音转写文本。
需要后端:本插件通过 HTTP 与本地 Python 后端服务通信,请先部署 douyin-favorites-sync-backend。
douyin_id frontmatter 自动跳过已导入的内容仅支持桌面端 — Heavy 模式需要通过 Node.js
fs将视频/图片附件写入 Vault。
设置页 — 后端连接状态、同步模式、文件夹配置:

生成的笔记 — frontmatter、内嵌视频(Heavy 模式)、文案、转写,以及底部状态栏:

main.js、manifest.json、styles.css 复制到 Vault 的 .obsidian/plugins/douyin-favorites-sync/ 目录http://127.0.0.1:8765)和同步选项Ctrl/Cmd+P):| 命令 | 说明 |
|---|---|
| 立即同步抖音收藏 | 立即拉取收藏并导入新内容 |
| 检查后端连接状态 | 探测后端 /api/health |
笔记保存为 笔记文件夹/作者(≤24字)-标题(≤56字).md,重名自动追加序号;附件存于 附件文件夹/<douyin_id>/。
npm install
npm run dev # 监听模式
npm run build # 生产构建 → main.js
| 配置 | 说明 | 默认值 |
|---|---|---|
| 后端地址 | 本地 Python 后端服务地址 | http://127.0.0.1:8765 |
| 笔记文件夹 | 存放抖音笔记的 Vault 路径 | Douyin |
| 附件文件夹 | 存放视频/图片附件的路径 | attachments/douyin |
| 同步模式 | Light 或 Heavy | light |
| 自动同步 | 是否启用每日自动同步 | 开启 |
| 每日同步时间 | 格式 HH:MM | 09:00 |
| Whisper 模型 | Heavy 模式语音转写模型(tiny → large-v3) |
small |
| 创建后打开笔记 | 手动同步完成后自动打开最新导入的笔记 | 关闭 |
| 提取间隔 | Heavy 提取时每条内容的等待秒数,防限流(0–60 秒) | 10 |
Obsidian 社区评审会因本插件使用了 Node.js
fs模块而标记 Direct Filesystem Access 警告。以下是具体说明:
fs 的用途:
仅在 src/vaultWriter.ts 中调用一次 fs.readFile(),用于从本地后端服务的下载目录读取二进制文件(视频 .mp4、封面图片),然后写入 Obsidian Vault。
为什么需要:
Obsidian Vault API(vault.createBinary、vault.modifyBinary)只能处理 Obsidian 进程内已有的数据。当 Python 后端将视频下载到 Vault 外部的临时目录后,插件必须通过 Node.js fs 读取二进制数据,再传递给 Vault API。
fs 不会做什么:
数据流:
后端下载视频/图片 → fs.readFile() 从后端临时目录读取
→ App.vault.createBinary() 写入 Vault
所有 Vault 写入操作(笔记、附件)均通过 Obsidian Vault API 完成。本插件仅支持桌面端,因为移动端 Obsidian 不提供 Node.js fs。
| 现象 | 处理 |
|---|---|
| 提示无法连接后端 | 确认后端已运行(./start-backend.sh);核对设置中的地址端口;运行命令「检查后端连接状态」 |
| Heavy 首条提取很慢 | 首次 Heavy 运行需联网下载 Whisper 模型;追求速度可换 tiny/base。无需安装系统 FFmpeg,音频解码已内置 |
| 改了设置没生效 | 重启插件,或 Cmd+P →「Reload app without saving」 |
| 旧笔记格式没更新 | 已有笔记不会被改动,仅新导入的笔记使用当前模板 |
| 同步成功但没有新笔记 | 已导入内容按 douyin_id 去重自动跳过 |
手动安装后提示 main.js 不存在 |
源码安装需执行 npm install && npm run build |
This tool is intended for personal study and research purposes only. By using this software, you agree that:
This project is an independent implementation and is not affiliated with or endorsed by Douyin / ByteDance.
本工具仅供个人学习研究使用。使用本软件即表示您同意:
本项目为独立实现,与抖音 / 字节跳动无任何关联或授权。