知识库 · AI 智能体
Jayson:听完播客就忘?我用小龙虾把60分钟播客变成了可视化知识图
将播客链接一键丢入自动化流水线,3分钟内自动完成下载、转写、知识提炼与4K信息图生成,支持飞书推送。完整代码+踩坑记录,解决听完就忘的痛点。
Jayson:听完播客就忘?我用小龙虾把60分钟播客变成了可视化知识图
3月6日修改
上周听AJ他们聊播客内容,我也经常听播客,常常遇到XXX说"这期干货太多了你一定要听"。点开一看,60分钟。听完之后常常发现,能记住的不到10%。
那天晚上我就想,能不能搭一条自动化流水线,把播客里的知识全部"榨"出来,变成一眼就能看明白的4K知识图?
折腾了两天,还真搞出来了。应AJ老师的邀请今天把完整流程分享出来。Ps:Banana 2上线了,这篇文章也刚好测试了一下,效果文章中可以看到,实例除外哈。
01 为什么播客需要"变成图"
播客消费有三个绕不开的痛点:第一,时间成本高,一期播客动辄40-60分钟,很多人根本听不完。第二,信息提取难,音频是线性的,想回头找某个观点得来回拖进度条。第三,知识留存差,听过就忘是常态。
市面上已经有Podwise、AI好记、通义听悟等工具在做"播客转文字"。但这些工具做到了"转文字",却没做到"转知识图"。
从"听"到"看",从"线性"到"结构化",从"模糊记忆"到"一图了然"。
02 技术栈全景:你需要这些工具
完整流程一共8步:
03 环境准备:10分钟搞定
所有API Key统一放在 .env 文件里。需要准备:SiliconFlow API Key(免费注册)、阿里云百炼API Key(有免费额度)、Exa搜索API Key、飞书App ID和Secret、AI生图API Key。
依赖安装:
Bash
代码块
FFmpeg(音频转码必备)yum install -y ffmpeg# 或 apt install ffmpeg(Ubuntu)# 或 brew install ffmpeg(macOS)# Python 依赖pip install requests dashscope# 可选:Playwright(网页抓取)pip install playwrightplaywright install chromium04 从播客链接到文字稿
Step 1:接收播客链接
支持小宇宙、Apple Podcasts、喜马拉雅、荔枝FM等。
Step 2:下载音频
以小宇宙为例,音频URL藏在页面源码的JSON数据中:
Python
代码块
import re, json, urllib.requestdefdownload_xiaoyuzhou(url): req = urllib.request.Request(url, headers={ 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0)' }) page = urllib.request.urlopen(req).read().decode() # 提取音频URL(在 NEXT_DATA JSON中) match = re.search( r'<script id="NEXT_DATA"[^>]*>(.*?)</script>', page ) if match: data = json.loads(match.group(1)) audio_url = data['props']['pageProps']['episode']['enclosure']['url'] urllib.request.urlretrieve(audio_url, '/data/podcast.m4a') return '/data/podcast.m4a'Step 3:语音转写(重点)
转写之前有个必做步骤:音频预处理。ASR模型对输入格式有要求,必须先用FFmpeg转码:
Bash
代码块
ffmpeg -i /data/podcast.m4a -ac 1 -ar 16000 -b:a 64k /data/podcast.mp3 -y三个参数:-ac 1 单声道,-ar 16000 16kHz采样率,-b:a 64k 压缩比特率。跳过这步转写效果大打折扣。
Python
代码块
import requestsSILICONFLOW_KEY = "你的API Key"with open('/data/podcast.mp3', 'rb') as f: r = requests.post( 'https://api.siliconflow.cn/v1/audio/transcriptions', headers={'Authorization': f'Bearer {SILICONFLOW_KEY}'}, files={'file': ('audio.mp3', f, 'audio/mpeg')}, data={'model': 'FunAudioLLM/SenseVoiceSmall'} )text = r.json()['text']Python
代码块
import dashscopeimport dashscope.audio.asr as asr_moduledashscope.api_key = "你的API Key"all_text = []classCallback: defon_event(self, result): sentence = result.get_sentence() if sentence and sentence.get('text'): all_text.append(sentence['text'])recognition = asr_module.Recognition( model='fun-asr-flash-8k-realtime-2026-01-28', format='mp3', sample_rate=16000, callback=Callback())result = recognition.call('/data/podcast.mp3')final_text = '\n'.join(all_text)05 飞书存档与搜索补充
Step 4:保存到飞书文档
转写稿放到飞书知识库,方便后续查阅。先获取Access Token:
Python
代码块
import requestsAPP_ID = "你的飞书App ID"APP_SECRET = "你的飞书App Secret"resp = requests.post( 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal', json={"app_id": APP_ID, "app_secret": APP_SECRET})token = resp.json()['tenant_access_token']Step 5:Exa搜索补充资料
播客里提到的论文、概念、人物,需要用Exa语义搜索补充背景资料。它能理解搜索意图,比传统关键词匹配更智能。
Python
代码块
import requestsEXA_KEY = "你的Exa API Key"def exa_search(query, num_results=5): r = requests.post( 'https://api.exa.ai/search', headers={'x-api-key': EXA_KEY, 'Content-Type': 'application/json'}, json={ 'query': query, 'num_results': num_results, 'type': 'neural', 'contents': {'text': {'maxCharacters': 2000}} } ) return r.json()['results']06 内容提炼与4K知识图生成
Step 6:提炼内容,建立坐标体系
坐标体系就是给知识图里的每个模块分配编号,像地图坐标一样。每张图必须包含7个模块:
A-01 核心概念 — 主题定义
B-05 技术原理 — 技术逻辑
C-09 应用场景 — 落地方向
D-12 优势特点 — 独特优势
E-15 局限挑战 — 问题与限制
F-17 发展趋势 — 未来方向
G-20 实践建议 — 行动指南
Step 7:生成4K高密度信息图
代码块
波普实验室风格:深蓝背景(#0a1628),荧光粉(#ff6b9d)、荧光绿(#00ff88)、荧光黄(#ffeb3b),赛博朋克+实验室美学。生图API优先级: Google Gemini → 302.ai(付费)
以Google Gemini为例:
Python
代码块
import requests, base64GEMINI_KEY = "你的Gemini API Key"defgenerate_image_gemini(prompt): url = (f"https://generativelanguage.googleapis.com/v1beta/" f"models/gemini-3-pro-image-preview:generateContent?key={GEMINI_KEY}") resp = requests.post(url, json={ "contents": [{"parts": [{"text": prompt}]}], "generationConfig": { "responseModalities": ["image", "text"], "responseMimeType": "image/png"} }) data = resp.json() for part in data['candidates'][0]['content']['parts']: if'inlineData'in part: img_bytes = base64.b64decode(part['inlineData']['data']) withopen('/data/infographic.png', 'wb') as f: f.write(img_bytes) return '/data/infographic.png'实际效果展示:
下面3张图是用这条流水线实际生成的4K知识图(我拿波普实验室风格来自:AJ老师分享的prompt微调了一下,你们也可以让AI做一些小红书风格),每张图对应一期播客的不同主题:
07 发送飞书群 + 踩坑血泪史
Python
代码块
import requests, jsondefupload_and_send_image(image_path, chat_id, token): # 1. 上传图片 withopen(image_path, 'rb') as f: r = requests.post( 'https://open.feishu.cn/open-apis/im/v1/images', files={'image': ('img.png', f, 'image/png')}, data={'image_type': 'message'}, headers={'Authorization': f'Bearer {token}'} ) image_key = r.json()['data']['image_key'] # 2. 发送图片消息 requests.post( 'https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=chat_id', headers={'Authorization': f'Bearer {token}', 'Content-Type': 'application/json'}, json={"receive_id": chat_id, "msg_type": "image", "content": json.dumps({"image_key": image_key})} )踩坑血泪史:
08 常见问题 Q&A
09 进阶方向与我的思考
✓ 写在最后
这个坑我替你踩过了。代码都在上面,拿去改改就能用。有虾的同学,直接去我公众号把我文章链接丢给虾就行。
觉得有用的话,可以关注一下我公众号收藏起来。后面还会分享更多AI自动化的实战方案。
你们平时怎么玩虾的?怎么消化播客内容?欢迎来评论区交流一下。