喜马拉雅得到思维导图转录 是做什麼的?
概览
使用此技能将公开的喜马拉雅音频链接转换为得到思维导图笔记转录。优先使用捆绑的脚本处理所有脆弱步骤:喜马拉雅清单提取、得到令牌刷新、本地音频上传/笔记创建、原始转录检索以及Markdown导出。
不要将长文本转录粘贴到聊天中。将用户可见的转录交付物保存在当前工作区的 outputs/ 目录下。
工作流程
- 创建工作目录:
mkdir -p work/ximalaya_dedao outputs/ximalaya_dedao
- 准备得到认证文件。如果用户在工作区中已有令牌文件,则读取现有令牌文件。切勿在聊天或日志中打印令牌。
node <skill>/scripts/dedao_refresh_token.mjs \
--refresh-token-file work/dedao_current_refresh_token.txt \
--token-file work/dedao_current_token.txt \
--out-refresh-token-file work/dedao_current_refresh_token.txt \
--response-file work/ximalaya_dedao/dedao_refresh_response.json
- 构建喜马拉雅清单:
node <skill>/scripts/ximalaya_manifest.mjs \
--url "https://xima.tv/..." \
--out work/ximalaya_dedao/manifest.json
如果清单报告 complete: false,请在创建得到笔记之前阅读 references/ximalaya-manifest.md 并修复缺失页面。不要静默处理不完整的专辑。
- 创建得到本地音频笔记:
node <skill>/scripts/ximalaya_to_dedao_batch.mjs create \
--manifest work/ximalaya_dedao/manifest.json \
--token-file work/dedao_current_token.txt \
--refresh-token-file work/dedao_current_refresh_token.txt \
--out-refresh-token-file work/dedao_current_refresh_token.txt \
--out-dir outputs/ximalaya_dedao
- 为每篇笔记拉取
original转录 JSON:
node <skill>/scripts/ximalaya_to_dedao_batch.mjs originals \
--manifest work/ximalaya_dedao/manifest.json \
--token-file work/dedao_current_token.txt \
--refresh-token-file work/dedao_current_refresh_token.txt \
--out-refresh-token-file work/dedao_current_refresh_token.txt \
--out-dir outputs/ximalaya_dedao
- 导出 Markdown 交付物:
node <skill>/scripts/export_transcripts.mjs \
--manifest work/ximalaya_dedao/manifest.json \
--notes outputs/ximalaya_dedao/note_ids.json \
--originals outputs/ximalaya_dedao/originals \
--out-dir outputs/ximalaya_dedao_transcripts
- 在最终响应前验证:
node -e "const fs=require('fs'); const idx=JSON.parse(fs.readFileSync('outputs/ximalaya_dedao_transcripts/index.json','utf8')); console.log(idx.episode_count, idx.total_text_char_count, idx.missing_files||0)"
find outputs/ximalaya_dedao_transcripts/episodes -maxdepth 1 -name 'p*.md' | wc -l
质量关卡
- 比较清单剧集数、笔记ID数、原始JSON数和导出的Markdown文件数。
- 在导出前检查空的或过小的
originals/pNN.json文件。 - 如果沙箱内喜马拉雅DNS或得到API调用失败,请使用网络升级重新运行相同的重要命令。
- 对于喜马拉雅
.m4a音频,得到可能拒绝type=m4a;在上传已下载的字节时传递--upload-type mp3。这与已验证的本地音频流程匹配。 - 如果在写入笔记ID后
stream_on_local_audio超时,请保留笔记ID并按笔记ID获取original。
参考资料
- 当得到上传、签名、令牌刷新、笔记创建或原始检索失败时,请阅读
references/dedao-local-audio.md。 - 当喜马拉雅专辑/曲目链接无法生成完整清单时,请阅读
references/ximalaya-manifest.md。