8
n8n 中文网amn8n.com

定时 YouTube 转录与去重,使用 Transcript.io 和 Supabase

高级

这是一个自动化工作流,包含 52 个节点。主要使用 If, Set, Code, Wait, Merge 等节点。 定时 YouTube 转录与去重,使用 Transcript.io 和 Supabase

前置要求
  • Supabase URL 和 API Key
  • 可能需要目标 API 的认证凭证

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "8bdf363d6f1444e891759be2b805fdd240d84e9615b1a1f01b8f4c91c2145754",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "1e662a57-60c5-43eb-abd8-b2bc21172c49",
      "name": "丢弃 URL",
      "type": "n8n-nodes-base.code",
      "position": [
        4864,
        400
      ],
      "parameters": {
        "jsCode": "// Nothing leaves this node\nreturn [];\n"
      },
      "retryOnFail": true,
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "5c844f20-1172-4872-83fe-713390354a00",
      "name": "检查 URL 是否在数据库中",
      "type": "n8n-nodes-base.supabase",
      "onError": "continueRegularOutput",
      "position": [
        4176,
        176
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "source_url",
              "keyValue": "={{ $json.link }}",
              "condition": "eq"
            }
          ]
        },
        "tableId": "content_queue_1",
        "matchType": "allFilters",
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "supabaseApi": {
          "id": "oB3fYG1lWHXnOQN6",
          "name": "Content Automation Hub"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "f98d2813-0e5d-4a0c-a996-79d2c5af6f4e",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        7744,
        -128
      ],
      "webhookId": "b7712f09-26bb-40b4-b76e-7f472eeb7e0d",
      "parameters": {
        "amount": 20
      },
      "typeVersion": 1.1
    },
    {
      "id": "9949e72c-d4c8-4bd9-b4b2-98b3e4d65bc6",
      "name": "频道信息",
      "type": "n8n-nodes-base.set",
      "position": [
        1152,
        352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7f952495-fb69-43fd-a42e-518d631b7456",
              "name": "youtubeChannels",
              "type": "string",
              "value": "={{ $json.source_identifier }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e31aaf93-90c7-4f8a-8e18-833713303936",
      "name": "频道信息 + 频道 ID",
      "type": "n8n-nodes-base.set",
      "position": [
        1648,
        352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "91bee9e2-9c54-4b87-920f-0221e6939c88",
              "name": "rssUrl",
              "type": "string",
              "value": "={{ $json.rssUrl }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "20f63f7f-f2a8-4d22-9649-0868dbd8fd05",
      "name": "最大内容天数",
      "type": "n8n-nodes-base.set",
      "position": [
        1920,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "425d78aa-c900-4156-98f9-4dcc812db7e6",
              "name": "max_content_age_days",
              "type": "string",
              "value": "={{ $json.max_content_age_days }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2bc62093-e2e2-4e7e-baa2-2fda3a292ef5",
      "name": "日期与时间",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        2736,
        -16
      ],
      "parameters": {
        "date": "={{ $json.pubDate || $json.isoDate }}",
        "format": "yyyy-MM-dd",
        "options": {},
        "operation": "formatDate",
        "outputFieldName": "standardizedPubDate"
      },
      "retryOnFail": true,
      "typeVersion": 2
    },
    {
      "id": "17518981-d6d1-4b0f-99e7-edf382ab3c7a",
      "name": "添加到内容队列表",
      "type": "n8n-nodes-base.supabase",
      "onError": "continueRegularOutput",
      "position": [
        7424,
        -656
      ],
      "parameters": {
        "tableId": "content_queue_1",
        "fieldsUi": {
          "fieldValues": [
            {
              "fieldId": "content_type",
              "fieldValue": "youtube"
            },
            {
              "fieldId": "title",
              "fieldValue": "={{ $json.title }}"
            },
            {
              "fieldId": "source_url",
              "fieldValue": "={{ $json.link }}"
            },
            {
              "fieldId": "content_snippet",
              "fieldValue": "={{ $json.transcript }}"
            },
            {
              "fieldId": "status",
              "fieldValue": "new"
            },
            {
              "fieldId": "published_date",
              "fieldValue": "={{ $json.pubDate }}"
            },
            {
              "fieldId": "creator",
              "fieldValue": "={{ $json.author }}"
            }
          ]
        }
      },
      "credentials": {
        "supabaseApi": {
          "id": "oB3fYG1lWHXnOQN6",
          "name": "Content Automation Hub"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "b4a9862d-14ed-472a-a724-e5d293ab506e",
      "name": "转录成功了吗?",
      "type": "n8n-nodes-base.if",
      "position": [
        6720,
        -384
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "fd22fed6-00aa-4d9a-94d5-58bb78f16bd1",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.statusMessage }}",
              "rightValue": "OK"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "adb806fd-b17d-43a2-87f7-0afd2e519a8c",
      "name": "新视频信息",
      "type": "n8n-nodes-base.set",
      "notes": "TEST CONTENT:\n[\n  {\n    \"client_id\": \"80d1c63b-59d6-479b-b7f7-ee91e859987e\",\n    \"max_content_age_days\": \"60\",\n    \"author\": \"Ted Talk\",\n    \"title\": \"Mental Toughness\",\n    \"link\": \"https://www.youtube.com/watch?v=rNxC16mlO60\",\n    \"pubDate\": \"2025-08-14T01:17:49.000Z\",\n    \"isMyContent\": null,\n    \"authority_score\": null,\n    \"niche_keywords\": null\n  }\n]\n",
      "position": [
        6080,
        -352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a87b5163-a235-4806-bb4a-d5795ac3634a",
              "name": "author",
              "type": "string",
              "value": "={{ $json.author }}"
            },
            {
              "id": "eb2aebb9-820b-43a8-81b7-e56d559ec8c4",
              "name": "title",
              "type": "string",
              "value": "={{ $json.title }}"
            },
            {
              "id": "6b2efe1f-c03a-4952-8599-7f9c6581699e",
              "name": "link",
              "type": "string",
              "value": "={{ $json.link }}"
            },
            {
              "id": "e31d8325-c92a-48f2-9741-024f4d4fe0fe",
              "name": "pubDate",
              "type": "string",
              "value": "={{ $json.pubDate }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "5dd2dd09-69ee-4b33-8a37-159b3b144e20",
      "name": "验证频道 ID + 创建 RSS 链接",
      "type": "n8n-nodes-base.code",
      "position": [
        1376,
        352
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// ── Pull the fields we need from the incoming item ─────────────────────────────\nconst channelId       = $json[\"youtubeChannels\"];\nconst authorityScore  = $json[\"authority_score\"];\nconst nicheKeywords   = $json[\"niche_keywords\"];\n\nconsole.log(\n  `Channel: ${channelId}, authority: ${authorityScore}, ` +\n  `keywords: ${nicheKeywords?.length || 0}`\n);\n\n// ── Skip if the channel ID is missing or blank ────────────────────────────────\nif (!channelId || channelId.trim() === '') {\n  return null;\n}\n\n// ── Only keep well-formed YouTube channel IDs (start with “UC”, 24 chars) ─────\nif (channelId.startsWith('UC') && channelId.length === 24) {\n  return {\n    channelId,\n    rssUrl: `https://www.youtube.com/feeds/videos.xml?channel_id=${channelId}`,\n    authority_score: authorityScore,\n    niche_keywords: nicheKeywords,\n    success: true\n  };\n} else {\n  console.log(`❌ Invalid Channel ID format: ${channelId}`);\n  return null;  // Skip invalid IDs\n}"
      },
      "retryOnFail": true,
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "306120f4-df29-4caa-bf83-79cbb41195e4",
      "name": "尝试再次获取 video_id",
      "type": "n8n-nodes-base.code",
      "position": [
        6048,
        -608
      ],
      "parameters": {
        "jsCode": "// YouTube Video ID Extractor - returns `video_id`\nfunction extractYouTubeVideoId(url) {\n  if (!url || typeof url !== 'string') {\n    return null;\n  }\n  const regex = /(?:youtube\\.com\\/(?:[^\\/\\n\\s]+\\/\\S+\\/|(?:v|e(?:mbed)?|shorts)\\/|.*[?&]v=)|youtu\\.be\\/)([a-zA-Z0-9_-]{11})/i;\n  const match = url.match(regex);\n  return match && match[1] ? match[1] : null;\n}\n\nconst input = $input.all();\nconst results = [];\n\nfor (const item of input) {\n  const url =\n    item.json.url ||\n    item.json.video_url ||\n    item.json.youtube_url ||\n    (typeof item.json === 'string' ? item.json : '');\n  const id = extractYouTubeVideoId(url);\n  results.push({\n    original_url: url,\n    video_id: id,\n    is_valid: id !== null,\n    clean_url: id ? `https://www.youtube.com/watch?v=${id}` : null,\n  });\n}\n\nreturn results;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "da478902-afbc-4d5a-8597-0330f88215b1",
      "name": "循环遍历每个频道",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1920,
        352
      ],
      "parameters": {
        "options": {}
      },
      "retryOnFail": true,
      "typeVersion": 3,
      "waitBetweenTries": 3000
    },
    {
      "id": "b29bffc1-bf77-4de1-986d-30a731f115d0",
      "name": "循环遍历最近视频",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3696,
        304
      ],
      "parameters": {
        "options": {}
      },
      "retryOnFail": true,
      "typeVersion": 3
    },
    {
      "id": "12a20fa2-5191-474d-ab53-dfcd2da2fb27",
      "name": "循环遍历新视频",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        4192,
        -352
      ],
      "parameters": {
        "options": {}
      },
      "retryOnFail": true,
      "typeVersion": 3
    },
    {
      "id": "67401f48-da32-4606-8306-9a50eb2c75f8",
      "name": "视频是否足够新?",
      "type": "n8n-nodes-base.if",
      "position": [
        3136,
        160
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "e3ff753e-f5f0-4d69-ace1-d0b9415fb294",
              "operator": {
                "type": "dateTime",
                "operation": "afterOrEquals"
              },
              "leftValue": "={{ $('Date & Time').item.json.standardizedPubDate }}",
              "rightValue": "={{ DateTime.now().minus({ days: $json.max_content_age_days }).toFormat('yyyy-MM-dd') }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "13763184-58b4-4173-baee-2fd8a24ceb1a",
      "name": "是否找到视频 ID?",
      "type": "n8n-nodes-base.if",
      "position": [
        5664,
        -672
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "ddb872f1-00b7-45e4-9d9c-02fbcacc8173",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.is_valid }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4fbc9742-cc2b-453a-a44f-f0fece8a1cbb",
      "name": "合并数据库检查结果",
      "type": "n8n-nodes-base.merge",
      "position": [
        4384,
        304
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "4b68db0f-e6c6-4ce7-af7e-1045b6cbe7d6",
      "name": "添加客户端和年龄规则",
      "type": "n8n-nodes-base.merge",
      "position": [
        2320,
        176
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.2
    },
    {
      "id": "7a9e60b1-12ab-4d4a-8a56-59fca5a03925",
      "name": "带原始日期的数据",
      "type": "n8n-nodes-base.set",
      "position": [
        2544,
        176
      ],
      "parameters": {
        "options": {},
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "dd7a8e83-9e37-43c7-b003-182b8960c0fc",
      "name": "合并格式化日期",
      "type": "n8n-nodes-base.merge",
      "position": [
        2912,
        160
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "1d2e79d2-e3e4-4ecf-b408-17bbf6876367",
      "name": "将转录添加到视频数据",
      "type": "n8n-nodes-base.merge",
      "position": [
        7104,
        -656
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "d95c20a3-faa0-45df-becf-4605674f295b",
      "name": "转录失败",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        7056,
        -112
      ],
      "parameters": {
        "errorMessage": "Transcript Failed"
      },
      "typeVersion": 1
    },
    {
      "id": "cdfff4fa-6dcc-4c90-b213-322376c71126",
      "name": "合并视频 ID 与视频数据",
      "type": "n8n-nodes-base.merge",
      "position": [
        6272,
        -672
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "fd0d633f-6640-43bb-bda4-6bfeb52f8f68",
      "name": "重命名 URL",
      "type": "n8n-nodes-base.set",
      "position": [
        5824,
        -608
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6e3e0929-a6d9-44a8-85f8-aab2a863b15b",
              "name": "url",
              "type": "string",
              "value": "={{ $json.original_url }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "deeb3d63-dfb9-4c25-9760-d21f9a8b98a5",
      "name": "重命名原始 URL",
      "type": "n8n-nodes-base.set",
      "position": [
        4768,
        -672
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "78fb6dce-dd95-4d98-9df6-436a1491683a",
              "name": "original_url",
              "type": "string",
              "value": "={{ $json.link }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "c3777b03-1d5c-4f6b-a006-9ecf2c83bc7f",
      "name": "查找视频 ID",
      "type": "n8n-nodes-base.set",
      "position": [
        4992,
        -672
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f5928422-6fb1-44d8-9c7e-4e3c3fc643ae",
              "name": "video_id",
              "type": "string",
              "value": "={{ $json.original_url.match(/(?:youtube\\.com\\/(?:[^\\/\\n\\s]+\\/\\S+\\/|(?:v|e(?:mbed)?|shorts)\\/|.*[?&]v=)|youtu\\.be\\/)([a-zA-Z0-9_-]{11})/i)?.[1] || null }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "16f57225-471d-4ce0-a120-8adc42a33a6e",
      "name": "视频 ID 是否有效?",
      "type": "n8n-nodes-base.set",
      "position": [
        5216,
        -672
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b0a840da-4cef-4a4c-bfd2-14e0afa06f5d",
              "name": "is_valid",
              "type": "boolean",
              "value": "={{ $json.original_url.match(/(?:youtube\\.com\\/(?:[^\\/\\n\\s]+\\/\\S+\\/|(?:v|e(?:mbed)?|shorts)\\/|.*[?&]v=)|youtu\\.be\\/)([a-zA-Z0-9_-]{11})/i) !== null }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "9e6301d9-1c69-4fda-bcf6-ab21203486ca",
      "name": "清理 URL",
      "type": "n8n-nodes-base.set",
      "position": [
        5440,
        -672
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3add2b91-4a26-4a33-b982-bd90a3bf2790",
              "name": "clean_url",
              "type": "string",
              "value": "={{ $json.video_id ? `https://www.youtube.com/watch?v=${$json.video_id}` : null }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "f0e30110-f0fc-42bd-a14b-ccd0e958d49c",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -912,
        -320
      ],
      "parameters": {
        "width": 736,
        "height": 576,
        "content": "## **高级 YouTube 转录器**"
      },
      "typeVersion": 1
    },
    {
      "id": "b4a594d0-7e22-4dfa-97c2-1fac51fd3fce",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        -320
      ],
      "parameters": {
        "color": 3,
        "width": 3008,
        "height": 976,
        "content": "## **第 1 部分:获取最近视频**"
      },
      "typeVersion": 1
    },
    {
      "id": "800fd1ef-d675-4f4f-a11a-a607cf5366ee",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3408,
        64
      ],
      "parameters": {
        "color": 4,
        "width": 1632,
        "height": 592,
        "content": "## **第 2 部分:仅筛选新内容**"
      },
      "typeVersion": 1
    },
    {
      "id": "8555920f-ea81-4c70-911a-a54c8e5c624c",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4112,
        -816
      ],
      "parameters": {
        "color": 5,
        "width": 3152,
        "height": 848,
        "content": "## **第 3 部分:视频转录**"
      },
      "typeVersion": 1
    },
    {
      "id": "9e423d16-0852-445d-81da-d9e5df423335",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        7312,
        -768
      ],
      "parameters": {
        "width": 320,
        "height": 336,
        "content": "## **第 4 部分:保存到数据库**"
      },
      "typeVersion": 1
    },
    {
      "id": "d433fa8a-61ee-4525-9035-b75feb433fab",
      "name": "查找频道的视频",
      "type": "n8n-nodes-base.rssFeedRead",
      "position": [
        2160,
        448
      ],
      "parameters": {
        "url": "={{ $json.rssUrl }}",
        "options": {}
      },
      "retryOnFail": true,
      "typeVersion": 1.1
    },
    {
      "id": "b6c973cd-73b7-4dac-b9ab-27adc27c2e6e",
      "name": "要跟踪的频道",
      "type": "n8n-nodes-base.set",
      "position": [
        624,
        352
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "71df3a21-e1b2-4906-b0ef-dd0d93f6cca5",
              "name": "source_identifier",
              "type": "array",
              "value": "={{ ['UCaEkuhQejDMyindRnUbISIg', 'UCIPPMRA040LQr5QPyJEbmXA'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "795fbe12-6a67-4059-a62c-5009c4b839f7",
      "name": "拆分输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        896,
        352
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "source_identifier"
      },
      "typeVersion": 1
    },
    {
      "id": "91372563-4b4e-4a46-90ff-89e1eb261840",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        80
      ],
      "parameters": {
        "color": 4,
        "width": 256,
        "height": 448,
        "content": "## 将所有网站拆分为独立的项,以便它们逐个进入循环"
      },
      "typeVersion": 1
    },
    {
      "id": "41cb7972-1246-4741-929b-f7fd6085f247",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        80
      ],
      "parameters": {
        "color": 5,
        "width": 256,
        "height": 448,
        "content": "## 存储您正在跟踪的 YouTube 频道的频道 ID"
      },
      "typeVersion": 1
    },
    {
      "id": "befb4428-08b8-448f-a7ad-58c2d98b5967",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        -320
      ],
      "parameters": {
        "color": 4,
        "width": 256,
        "height": 576,
        "content": "## 过滤掉 X 天前发布的 YouTube 视频。"
      },
      "typeVersion": 1
    },
    {
      "id": "a5531b89-dce9-4098-b60b-04c66a9d97c3",
      "name": "### 替换 Airtable 连接",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -320
      ],
      "parameters": {
        "color": 5,
        "width": 256,
        "height": 576,
        "content": "## 您希望此操作运行频率如何?"
      },
      "typeVersion": 1
    },
    {
      "id": "b1f269e8-e04d-4d51-8bfe-ccffb0677e3b",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        240
      ],
      "parameters": {
        "color": 6,
        "width": 256,
        "height": 288,
        "content": "## 转换为有效的 RSS 源链接"
      },
      "typeVersion": 1
    },
    {
      "id": "d231bab6-52d0-43a3-a6e2-1dec577d5950",
      "name": "便签11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2480,
        -64
      ],
      "parameters": {
        "color": 5,
        "width": 880,
        "height": 448,
        "content": "## 过滤掉早于您首选天数的视频。"
      },
      "typeVersion": 1
    },
    {
      "id": "bd78965a-b40a-4d7a-9220-df4850f6adda",
      "name": "官方字幕/转录",
      "type": "n8n-nodes-base.code",
      "position": [
        6944,
        -400
      ],
      "parameters": {
        "jsCode": "const trackToText = (track) => track.transcript.map(t => t.text).join(' ');\n\nconst results = [];\n\nfor (const cur of $input.all()) {\n  // Parse data field if it’s a string\n  let dataArray;\n  if (typeof cur.json.data === 'string') {\n    try {\n      dataArray = JSON.parse(cur.json.data);\n    } catch {\n      continue;\n    }\n  } else {\n    dataArray = cur.json.data;\n  }\n\n  const item = Array.isArray(dataArray) ? dataArray[0] : null;\n  if (!item || !item.tracks?.[0]) continue;\n\n  results.push({\n    json: {\n      id: item.id,\n      transcript: trackToText(item.tracks[0])\n    }\n  });\n}\n\nreturn results;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "bc132ab8-2b68-459e-b799-38b1461946f4",
      "name": "作者 + 标题 + 链接 + 发布日期",
      "type": "n8n-nodes-base.set",
      "position": [
        3936,
        320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6a9e1676-958b-459f-9759-8923abf17ca9",
              "name": "author",
              "type": "string",
              "value": "={{ $json.author }}"
            },
            {
              "id": "1e46ca11-f2fd-4791-8f99-d6a29cf788ef",
              "name": "title",
              "type": "string",
              "value": "={{ $json.title }}"
            },
            {
              "id": "26062740-7a51-46ef-8b59-1a21794dea12",
              "name": "link",
              "type": "string",
              "value": "={{ $json.link }}"
            },
            {
              "id": "8f7d651d-e422-4145-ae56-cdd596e199b9",
              "name": "pubDate",
              "type": "string",
              "value": "={{ $json.pubDate }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5e4b3e4c-4019-4da8-a31b-148010961c2f",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4448,
        -400
      ],
      "parameters": {
        "width": 688,
        "height": 432,
        "content": "## 过滤掉 YouTube Shorts?"
      },
      "typeVersion": 1
    },
    {
      "id": "5972dd56-a725-4d74-a5bd-b425da95e831",
      "name": "定时触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -80,
        -64
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 1
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5985ba47-bd1e-4450-8ac8-56eaeb7ce8ad",
      "name": "便签13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6352,
        -480
      ],
      "parameters": {
        "width": 336,
        "height": 464,
        "content": "## 免费 YouTube 转录"
      },
      "typeVersion": 1
    },
    {
      "id": "15dd6258-de11-4bce-a5e4-f10896ab965d",
      "name": "从 API 获取转录",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Failures:\n\n[\n  {\n    \"body\": {\n      \"error\": {\n        \"code\": 503,\n        \"message\": \"The model is overloaded. Please try again later.\",\n        \"status\": \"UNAVAILABLE\"\n      }\n    },\n    \"headers\": {\n      \"vary\": \"Origin, X-Origin, Referer\",\n      \"content-type\": \"application/json; charset=UTF-8\",\n      \"date\": \"Wed, 13 Aug 2025 18:07:09 GMT\",\n      \"server\": \"scaffolding on HTTPServer2\",\n      \"x-xss-protection\": \"0\",\n      \"x-frame-options\": \"SAMEORIGIN\",\n      \"x-content-type-options\": \"nosniff\",\n      \"server-timing\": \"gfet4t7; dur=19896\",\n      \"alt-svc\": \"h3=\\\":443\\\"; ma=2592000,h3-29=\\\":443\\\"; ma=2592000\",\n      \"connection\": \"close\",\n      \"transfer-encoding\": \"chunked\"\n    },\n    \"statusCode\": 503,\n    \"statusMessage\": \"Service Unavailable\"\n  }\n]",
      "position": [
        6480,
        -384
      ],
      "parameters": {
        "url": "https://www.youtube-transcript.io/api/transcripts",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "neverError": true,
              "fullResponse": true,
              "responseFormat": "text"
            }
          }
        },
        "jsonBody": "={\n  \"ids\": [\n    \"{{$json.video_id}}\"\n  ]\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "dXT903VZuMUSiH5L",
          "name": "video guy"
        },
        "httpHeaderAuth": {
          "id": "7WXaS18PgenWHxmi",
          "name": "youtube-transcript-io"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "waitBetweenTries": 5000
    },
    {
      "id": "4de16b7e-bd72-4b0d-ab0b-27f8128e1d7d",
      "name": "设置最大视频年龄",
      "type": "n8n-nodes-base.set",
      "position": [
        176,
        -64
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "71683423-567a-428e-8bf5-e2a7b36ddf77",
              "name": "max_content_age_days",
              "type": "string",
              "value": "=60"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "0fd75803-0c94-4fb5-bdfb-10be427e4725",
      "name": "视频是否已在数据库中?",
      "type": "n8n-nodes-base.if",
      "onError": "continueRegularOutput",
      "position": [
        4608,
        304
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "0e8f8e26-63ae-4273-8ccf-4e6cbb47669d",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.source_url }}",
              "rightValue": 0
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2,
      "alwaysOutputData": false
    },
    {
      "id": "68f066dc-0fe0-4df5-9b56-dfda7d69229a",
      "name": "过滤掉 YouTube Shorts",
      "type": "n8n-nodes-base.if",
      "position": [
        4592,
        -336
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "af405725-90d8-4c1a-8497-0a92e273ced7",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{$json.link}}",
              "rightValue": ""
            },
            {
              "id": "2c3a30eb-489f-4ce9-bdf2-9f63c683456e",
              "operator": {
                "type": "string",
                "operation": "notContains"
              },
              "leftValue": "={{ $json.link }}",
              "rightValue": "youtube.com/shorts"
            }
          ]
        }
      },
      "typeVersion": 2.2
    }
  ],
  "pinData": {},
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over New Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Channel Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rename URL": {
      "main": [
        [
          {
            "node": "try to get video_id again",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Date & Time": {
      "main": [
        [
          {
            "node": "Merge Formatted Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Discard URL": {
      "main": [
        [
          {
            "node": "Loop Over Recent Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Channel Info": {
      "main": [
        [
          {
            "node": "Verify Channel ID + Create RSS Link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Up URL": {
      "main": [
        [
          {
            "node": "Was Video ID Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Video ID": {
      "main": [
        [
          {
            "node": "Is Video ID valid?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set Max Video Age",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Channels To Track": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Max Video Age": {
      "main": [
        [
          {
            "node": "Channels To Track",
            "type": "main",
            "index": 0
          },
          {
            "node": "Max Content Age Days",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data with Raw Date": {
      "main": [
        [
          {
            "node": "Date & Time",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Formatted Date",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Is Video ID valid?": {
      "main": [
        [
          {
            "node": "Clean Up URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcript Worked?": {
      "main": [
        [
          {
            "node": "Official Captions/Transcript",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Transcript Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rename Original URL": {
      "main": [
        [
          {
            "node": "Find Video ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Was Video ID Found?": {
      "main": [
        [
          {
            "node": "Merge Video ID With Video Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Rename URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over New Videos": {
      "main": [
        [],
        [
          {
            "node": "Filter Out YouTube Shorts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Max Content Age Days": {
      "main": [
        [
          {
            "node": "Add Client & Age Rules",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Formatted Date": {
      "main": [
        [
          {
            "node": "Is Video Recent Enough?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Channel's Videos": {
      "main": [
        [
          {
            "node": "Loop Over Each Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge DB Check Result": {
      "main": [
        [
          {
            "node": "Is Video Already in Database?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Video Information": {
      "main": [
        [
          {
            "node": "Merge Video ID With Video Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Add Client & Age Rules": {
      "main": [
        [
          {
            "node": "Data with Raw Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Each Channel": {
      "main": [
        [
          {
            "node": "Add Client & Age Rules",
            "type": "main",
            "index": 1
          }
        ],
        [
          {
            "node": "Find Channel's Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Transcript from API": {
      "main": [
        [
          {
            "node": "Transcript Worked?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is Video Recent Enough?": {
      "main": [
        [
          {
            "node": "Loop Over Recent Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Recent Videos": {
      "main": [
        [
          {
            "node": "Loop Over New Videos",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "author + title + link + pubDate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Channel Info + Channel ID": {
      "main": [
        [
          {
            "node": "Loop Over Each Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Out YouTube Shorts": {
      "main": [
        [
          {
            "node": "Rename Original URL",
            "type": "main",
            "index": 0
          },
          {
            "node": "New Video Information",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over New Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "try to get video_id again": {
      "main": [
        [
          {
            "node": "Merge Video ID With Video Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Content Queue Table": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if URL Is In Database": {
      "main": [
        [
          {
            "node": "Merge DB Check Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Transcript to Video Data": {
      "main": [
        [
          {
            "node": "Add to Content Queue Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Official Captions/Transcript": {
      "main": [
        [
          {
            "node": "Add Transcript to Video Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Is Video Already in Database?": {
      "main": [
        [
          {
            "node": "Discard URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Recent Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Video ID With Video Data": {
      "main": [
        [
          {
            "node": "Get Transcript from API",
            "type": "main",
            "index": 0
          },
          {
            "node": "Add Transcript to Video Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "author + title + link + pubDate": {
      "main": [
        [
          {
            "node": "Check if URL Is In Database",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge DB Check Result",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Verify Channel ID + Create RSS Link": {
      "main": [
        [
          {
            "node": "Channel Info + Channel ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级

需要付费吗?

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

工作流信息
难度等级
高级
节点数量52
分类-
节点类型14
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者

On a mission to automate all aspects of social media. Each of my templates covered more in depth in my Skool Community.

外部链接
在 n8n.io 查看

分享此工作流