8
n8n 中文网amn8n.com

YouTube视频摘要生成器

中级

这是一个Document Extraction, AI Summarization领域的自动化工作流,包含 10 个节点。主要使用 Code, HttpRequest, GoogleSheets, ManualTrigger, ChainLlm 等节点。 使用Supadata转录、DeepSeek AI和Google Sheets总结YouTube视频

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "IujAbWspOQ3QpsMl",
  "meta": {
    "instanceId": "cd438fd1eca1b4215129611b59e2a783bbecd4a7fc04e24e9ac21de3d46ce6cc",
    "templateCredsSetupCompleted": true
  },
  "name": "YouTube视频摘要生成器",
  "tags": [],
  "nodes": [
    {
      "id": "b2dfa97e-48c1-4c6d-aa8a-3b89ee30ea70",
      "name": "当点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5a3e1726-d2c9-4fb8-9dc3-44fd1c14ff23",
      "name": "DeepSeek聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "position": [
        780,
        220
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "deepSeekApi": {
          "id": "jPnyKkmqHRq5dXfZ",
          "name": "DeepSeek account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "721e9e8b-c387-4c9e-8328-8ef20700525c",
      "name": "生成摘要",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        840,
        0
      ],
      "parameters": {
        "text": "=Summarize the following video transcript in a structured, clear, and concise manner. Focus on the key points, main ideas, and essential takeaways. Avoid unnecessary details and redundant information. Ensure that the summary is logically organized and easy to understand.\nGuidelines for summarization:\n\nIdentify core topics: Capture the main subject of the discussion.\n\nExtract key points: Highlight the most important arguments, insights, and conclusions.\n\nUse clear and precise language: Ensure readability and logical flow.\n\nMaintain neutrality: Avoid opinions or interpretations that are not in the transcript.\n\nFormat for clarity: If the transcript includes multiple sections or topics, structure the summary using bullet points or short paragraphs.\n\nExpected Output Format:\nReturn the summary as a structured text response, using either paragraphs or bullet points, depending on the complexity of the content. If applicable, include subheadings for better organization.\nSummarize the following video transcript in a structured JSON format. \\n\\n Focus on key points, main ideas, and important takeaways.\nHere is the transcript: {{ $json.Transcript }}",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=Summarize the following video transcript in a clear and concise way. Focus on key points and main ideas. The output must be in pure JSON format, without additional characters, without JSON keywords, without backticks, without comments, and without markdown. Return the response as a correct JSON array WITHOUT any additional descriptions, comments, Markdown, 'json', or backticks. The response must start with [ and end with ]. If no suggestions can be generated, return an empty array []. The structure of the response should be:[{       \\\"summary\\\": \\\"Short structured summary of the video.\\\",       \\\"key_points\\\": [\\\"Point \", \\\"Point \", \\\"Point \"],       \\\"topics\\\": [\\\"Topic\", \\\"Topic\\\"]     }]  "
            }
          ]
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.7
    },
    {
      "id": "e83ad09b-cf11-4482-bf9d-816ba07bb975",
      "name": "添加摘要到文件",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1320,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Url": "={{ $('Get URL to Transcript').item.json.Url }}",
            "Status": "Done",
            "Summary": "=Summary:\n{{ $json.summary }} \nKey Points:\n{{ $json.key_points }}\nTopics:\n{{ $json.topics }}"
          },
          "schema": [
            {
              "id": "Url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Transcript",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Transcript",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Url"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1314611397,
          "cachedResultUrl": "",
          "cachedResultName": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1eOEzWh5wWXimIGQ1h5exKGZdPd5S1e7K7erePo-f6eQ",
          "cachedResultUrl": "",
          "cachedResultName": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "8697bDzanPk5JVnu",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "f8fe7ac8-5b2c-423b-999e-465b22eef8d8",
      "name": "添加转录文本到文件",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        660,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Url": "={{ $('Get URL to Transcript').item.json.Url }}",
            "Transcript": "={{ $json.content }}"
          },
          "schema": [
            {
              "id": "Url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Transcript",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Transcript",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Url"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1314611397,
          "cachedResultUrl": "",
          "cachedResultName": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1eOEzWh5wWXimIGQ1h5exKGZdPd5S1e7K7erePo-f6eQ",
          "cachedResultUrl": "",
          "cachedResultName": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "8697bDzanPk5JVnu",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "6f8017d6-d14a-411a-9e48-3f707e46d2d4",
      "name": "获取转录文本URL",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        220,
        0
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": true
        },
        "filtersUI": {
          "values": [
            {
              "lookupValue": "Pending",
              "lookupColumn": "Status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1314611397,
          "cachedResultUrl": "",
          "cachedResultName": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1eOEzWh5wWXimIGQ1h5exKGZdPd5S1e7K7erePo-f6eQ",
          "cachedResultUrl": "",
          "cachedResultName": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "8697bDzanPk5JVnu",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "a33faf41-8e19-40b8-80fd-d24ea542018b",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "disabled": true,
      "position": [
        200,
        -240
      ],
      "parameters": {
        "width": 600,
        "height": 380,
        "content": "## 生成转录文本"
      },
      "typeVersion": 1
    },
    {
      "id": "954acc03-f58d-4008-883f-c2981a0dbeb9",
      "name": "生成转录文本",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        440,
        0
      ],
      "parameters": {
        "url": "=https://api.supadata.ai/v1/youtube/transcript?url={{ $json.Url }}&text=true",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "ADD HERE YOUR API KEY"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f12e32a1-7a5e-4134-8545-46d61f8ab188",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "disabled": true,
      "position": [
        820,
        -240
      ],
      "parameters": {
        "width": 620,
        "height": 380,
        "content": "## 生成摘要"
      },
      "typeVersion": 1
    },
    {
      "id": "0e7b2c56-4c3a-46dc-80bf-e84e5522d182",
      "name": "清理代码",
      "type": "n8n-nodes-base.code",
      "position": [
        1140,
        0
      ],
      "parameters": {
        "jsCode": "return items.map(item => {\n  const rawText = $input.first().json.text;\n\n \n  const cleaned = rawText\n    .replace(/^```json\\s*/, '')\n    .replace(/\\s*```$/, '')\n    .trim();\n\n  let parsed;\n  try {\n    parsed = JSON.parse(cleaned);\n  } catch (e) {\n    throw new Error('Error aprsing field \"text\".');\n  }\n\n  const data = parsed[0];\n\n  return {\n    json: {\n      summary: data.summary,\n      key_points: data.key_points.join('\\n'),\n      topics: data.topics.join(', ')\n    }\n  };\n});"
      },
      "typeVersion": 2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "67fcc39e-309f-4608-9573-2635129c020a",
  "connections": {
    "Clear code": {
      "main": [
        [
          {
            "node": "Adding Summary to file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Summary": {
      "main": [
        [
          {
            "node": "Clear code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DeepSeek Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Summary",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Generating transcript": {
      "main": [
        [
          {
            "node": "Adding transcript to file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get URL to Transcript": {
      "main": [
        [
          {
            "node": "Generating transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Adding Summary to file": {
      "main": [
        [
          {
            "node": "Get URL to Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Adding transcript to file": {
      "main": [
        [
          {
            "node": "Generate Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get URL to Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 文档提取, AI 摘要总结

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量10
分类2
节点类型7
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

外部链接
在 n8n.io 查看

分享此工作流