用 Telegram 发送 YouTube 链接,自动转录并生成 Shorts 脚本
输入:YouTube 视频链接(通过 Telegram 发送);处理:Supadata 转录 + Gemini 2.5 Pro 生成脚本;输出:Telegram 返回标题与正文
- 给谁
- 需要将长视频快速改写成 YouTube Shorts 脚本的内容创作者、社交媒体运营者
- 你会得到
- 在 Telegram 中发送任意 YouTube 链接,几分钟后收到一段 170–200 词的 Shorts 脚本(含标题与正文)
硬约束
基于 n8n 自托管实例部署。需安装社区节点 n8n-nodes-supadata,并在 n8n 中注册三种凭证:telegramApi(BotFather 创建机器人)、supadataApi(Supadata 官网获取)、googlePalmApi(Gemini API 密钥)。工作流激活后,用户向 Telegram 机器人发送 YouTube 链接即可触发。
他们做了什么
模板作者 taiki 创建了一个 n8n 工作流:用户通过 Telegram 机器人发送 YouTube 链接,工作流调用 Supadata 社区节点获取视频转录,将转录片段拼接为完整文本后,送入 Google Gemini 2.5 Pro 生成一段约 170–200 词的 YouTube Shorts 脚本,并通过 Telegram 将标题与正文返回给用户。
效果如何
作者报告该模板可自动完成转录、摘要与脚本撰写,减少手动操作,支持移动端通过 Telegram 触发。(author_report;本站未实测)
值得知道
1)社区节点 n8n-nodes-supadata 仅兼容自托管 n8n,Cloud 环境无法安装。2)workflow.json 的 connections 中出现 'Edit Fields',但 nodes[] 中对应节点实际名为 'Script mapping'(type=n8n-nodes-base.set),两者为同一节点。3)Gemini 节点使用 models/gemini-2.5-pro,但凭证类型仍标记为 googlePalmApi,这是 n8n 的历史命名。4)模板未提供失败重试或转录为空时的兜底逻辑。5)来源未披露 Supadata 转录服务的费用模型与速率限制。
步骤
准备环境与凭证
确保你运行的是 n8n 自托管版本(社区节点不兼容 Cloud)。在 n8n 设置 > 社区节点中安装 n8n-nodes-supadata。随后在「凭证」页面分别添加:Telegram API(从 BotFather 获取 bot token)、Supadata API(从 https://supadata.com/ 注册获取)、Google Gemini API(即 googlePalmApi 凭证类型,填入 Gemini API key)。
安装社区节点
进入 n8n 界面,点击左侧 Settings > Community Nodes,选择 Install,输入包名 n8n-nodes-supadata 并确认安装。安装完成后,节点面板中会出现 Supadata 节点。
导入模板并配置节点
从 n8n 模板库导入此工作流(或手动按 workflow.json 重建)。检查各节点凭证是否已绑定:Input URL(Telegram Trigger)绑定 telegramApi;Make Transcribe(Supadata)绑定 supadataApi;Google Gemini Chat Model 绑定 googlePalmApi。Script mapping(Set 节点)中已预设表达式 `={{ $json.content.map(item => item.text).join('\n') }}`,用于将 Supadata 返回的转录数组拼接为完整文本。Parsing(Structured Output Parser)中已预设 JSON Schema,要求输出 title 与 script 两个字段。
配置 AI 脚本生成提示词
打开 Create Script(Basic LLM Chain)节点,确认 promptType 为 define,hasOutputParser 为 true。该节点包含两条来源提示词:一条是传入 Gemini 的 system message,定义脚本风格与格式约束;另一条是 user text,将转录全文作为背景信息传入。
运行提示词 · 来源原文。Create Script 节点 messages.messageValues[0].message(system message)
=You are a professional scriptwriter for YouTube Shorts, specializing in trivia across various genres. Based on the background information from the YouTube transcript provided by the user, you will create the ultimate script to captivate viewers. Your expertise lies in crafting scripts that interestingly convey fascinating trivia hidden in science, nature, culture, and daily life. Please use an intelligent yet friendly narrative style. #Conditions The content must be based on accurate information. Structure the script to introduce a lot of trivia at a good tempo, minimizing transitional words. Speak intelligently in a casual tone. The script should be approximately 170-200 words. The opening sentence must be a shocking fact or a line that strongly stimulates the viewer's curiosity. Get straight to the point. Do not include narration or timestamps; generate only the pure script text. Create the script based on the background information from the provided YouTube transcript. Do not use bold text. Use periods to break lines appropriately. #Output Format title: script:
运行提示词 · 来源原文。Create Script 节点 text 字段(user message / background context)
=#background information {{ $json.full_script }}激活并测试
激活工作流。在 Telegram 中向你的机器人发送一条 YouTube 视频链接。工作流将自动执行:获取转录 → 拼接全文 → Gemini 生成脚本 → 解析结构化输出 → 通过 Telegram 返回结果。你应收到一条包含标题和正文的消息。
运行提示词 · 来源原文。Send Summary 节点 text 字段(Telegram 消息模板)
={{ $json.output.title }} {{ $json.output.script }}
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限
这一段是提示词,页面不会在这里插入广告。
你正在协助复现一个 n8n 工作流模板。请先确认对方已具备:1)自托管 n8n 实例;2)BotFather 创建的 Telegram 机器人;3)Supadata 与 Gemini API 密钥。然后指导对方按步骤安装社区节点、导入 workflow、绑定凭证、激活测试。不要替对方执行 API 调用。
搭建前请确认 n8n 为自托管版本;Cloud 用户无法安装此社区节点。
来源
Create YouTube shorts scripts from video links with Gemini AI and Telegram · taiki · n8n.io · 2025-07-09
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。