喜马拉雅·得到脑图转录 是做什么的?
概览
使用此技能将喜马拉雅公开音频链接转换为得到脑记笔记的转录文本。所有脆弱的步骤请优先使用附带的脚本:喜马拉雅清单提取、得到令牌刷新、本地音频上传/笔记创建、原始转录检索以及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。这与已验证的本地音频流程一致。 - 如果
stream_on_local_audio在写入笔记ID后超时,请保留该笔记ID并直接通过笔记ID获取original。
参考文档
- 当得到的上传、签名、令牌刷新、笔记创建或原始检索失败时,请阅读
references/dedao-local-audio.md。 - 当喜马拉雅专辑/单曲链接无法生成完整清单时,请阅读
references/ximalaya-manifest.md。