8
n8n 中文网amn8n.com

[n8n] YouTube 频道高级 RSS 源生成器

高级

这是一个Marketing领域的自动化工作流,包含 20 个节点。主要使用 Set, Code, Merge, Switch, Aggregate 等节点。 带有 Telegram 格式化的 YouTube 高级 RSS 生成器

前置要求
  • 可能需要目标 API 的认证凭证
  • HTTP Webhook 端点(n8n 会自动生成)

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移

无法加载工作流预览

导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {},
  "name": "[n8n] YouTube 频道高级 RSS 源生成器",
  "tags": [
    {
      "id": "Q29tbWVudHBpY2tlcg",
      "name": "Commentpicker",
      "createdAt": "2024-04-16T14:29:17.942Z",
      "updatedAt": "2024-04-16T14:29:17.942Z"
    },
    {
      "id": "Rm9ybVRyaWdnZXI",
      "name": "FormTrigger",
      "createdAt": "2024-04-16T14:29:17.942Z",
      "updatedAt": "2024-04-16T14:29:17.942Z"
    },
    {
      "id": "SHR0cFJlcXVlc3Q",
      "name": "HttpRequest",
      "createdAt": "2024-04-16T14:29:17.942Z",
      "updatedAt": "2024-04-16T14:29:17.942Z"
    },
    {
      "id": "QWdncmVnYXRl",
      "name": "Aggregate",
      "createdAt": "2024-04-16T14:29:17.942Z",
      "updatedAt": "2024-04-16T14:29:17.942Z"
    },
    {
      "id": "UmVzcG9uZFRvV2ViaG9vaw",
      "name": "RespondToWebhook",
      "createdAt": "2024-04-16T14:29:17.942Z",
      "updatedAt": "2024-04-16T14:29:17.942Z"
    },
    {
      "id": "Q29kZQ",
      "name": "Code",
      "createdAt": "2024-04-16T14:29:17.942Z",
      "updatedAt": "2024-04-16T14:29:17.942Z"
    }
  ],
  "nodes": [
    {
      "name": "n8n 表单触发器",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -300,
        -260
      ],
      "webhookId": "68a70315-9f74-4cf5-9c68-828396b0f23b",
      "parameters": {
        "path": "Youtube",
        "formTitle": "Youtube RSS Generator",
        "formFields": {
          "values": [
            {
              "fieldLabel": "youtube Channel username or ID",
              "requiredField": true
            }
          ]
        },
        "responseMode": "responseNode",
        "formDescription": "=Youtube Username Example: @username\n\nYoutube ID Example: UCxxxxxxxxxxxxxxxxxx\n\nYoutube Video URL Example 1: https://www.youtube.com/watch?v=mn-br82ENxc\n\nYoutube Video URL Example 2: https://youtu.be/mn-br82ENxc\n\nYoutube Channel URL Example 1: https://www.youtube.com/@NewMedia_Life\n\nYoutube Channel URL Example 2: https://www.youtube.com/channel/UC_UDAiqQj-QfgTixKkW51qA"
      },
      "typeVersion": 2
    },
    {
      "name": "获取频道 ID",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "3rd party API request",
      "position": [
        700,
        -440
      ],
      "parameters": {
        "url": "https://commentpicker.com/actions/youtube-channel-id.php",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        },
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "=https://www.googleapis.com/youtube/v3/channels?part=id,snippet,statistics,contentDetails,status&forHandle={{ $item(\"0\").$node[\"Set Channel Username\"].json[\"channel name\"] }}"
            },
            {
              "name": "token",
              "value": "={{ $item(\"0\").$node[\"Get Temporary Token\"].json[\"data\"] }}"
            },
            {
              "name": "isPremium",
              "value": "false"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "authority",
              "value": "commentpicker.com"
            },
            {
              "name": "cookie",
              "value": "ezosuibasgeneris-1=690da322-c7c8-44e2-6154-8591a44d12aa; ezoab_186623=mod99-c; active_template::186623=pub_site.1711138973; lp_186623=https://commentpicker.com/youtube-channel-id.php; fontsLoaded=true; PHPSESSID=12ltjv3rr293h943c8h35nh3cg"
            },
            {
              "name": "referer",
              "value": "https://commentpicker.com/youtube-channel-id.php"
            },
            {
              "name": "user-agent",
              "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.1
    },
    {
      "name": "设置 XML URL",
      "type": "n8n-nodes-base.set",
      "notes": "🤖Generate XML Feed URL",
      "position": [
        900,
        -440
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "bf0ea151-e325-4860-af02-76e51f692f2c",
              "name": "rss",
              "type": "string",
              "value": "=https://www.youtube.com/feeds/videos.xml?channel_id={{ $json.items[0].id }}"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 3.3
    },
    {
      "name": "设置频道用户名",
      "type": "n8n-nodes-base.set",
      "position": [
        520,
        -440
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0837a847-4c6b-4b39-bb90-f200233bf7e1",
              "name": "channel name",
              "type": "string",
              "value": "={{ $item(\"0\").$node[\"Switch\"].json[\"value\"] }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "name": "设置 XML 源 URL",
      "type": "n8n-nodes-base.set",
      "notes": "🤖Generate XML Feed URL",
      "position": [
        900,
        -260
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "bf0ea151-e325-4860-af02-76e51f692f2c",
              "name": "rss",
              "type": "string",
              "value": "=https://www.youtube.com/feeds/videos.xml?channel_id={{ $item(\"0\").$node[\"Switch\"].json[\"value\"] }}"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 3.3
    },
    {
      "name": "设置视频 ID",
      "type": "n8n-nodes-base.set",
      "position": [
        520,
        -80
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0837a847-4c6b-4b39-bb90-f200233bf7e1",
              "name": "Video ID",
              "type": "string",
              "value": "={{ $item(\"0\").$node[\"Switch\"].json[\"value\"] }}"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "name": "获取视频 ID 频道 ID",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "3rd party API request",
      "position": [
        700,
        -80
      ],
      "parameters": {
        "url": "https://commentpicker.com/actions/youtube-channel-id.php",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        },
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "=https://www.googleapis.com/youtube/v3/videos?part=snippet&id={{ $json[\"Video ID\"] }}"
            },
            {
              "name": "token",
              "value": "={{ $item(\"0\").$node[\"GTT\"].json[\"data\"] }}"
            },
            {
              "name": "isPremium",
              "value": "true"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "authority",
              "value": "commentpicker.com"
            },
            {
              "name": "cookie",
              "value": "ezosuibasgeneris-1=690da322-c7c8-44e2-6154-8591a44d12aa; ezoab_186623=mod99-c; active_template::186623=pub_site.1711138973; lp_186623=https://commentpicker.com/youtube-channel-id.php; fontsLoaded=true; PHPSESSID=12ltjv3rr293h943c8h35nh3cg"
            },
            {
              "name": "referer",
              "value": "https://commentpicker.com/youtube-channel-id.php"
            },
            {
              "name": "user-agent",
              "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.1
    },
    {
      "name": "设置 XML 源",
      "type": "n8n-nodes-base.set",
      "notes": "🤖Generate XML Feed URL",
      "position": [
        900,
        -80
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "bf0ea151-e325-4860-af02-76e51f692f2c",
              "name": "rss",
              "type": "string",
              "value": "=https://www.youtube.com/feeds/videos.xml?channel_id={{ $item(\"0\").$node[\"Get Video ID Channel ID\"].json[\"items\"][\"0\"][\"snippet\"][\"channelId\"] }}"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 3.3
    },
    {
      "name": "获取临时令牌",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "3rd party API request",
      "position": [
        320,
        -440
      ],
      "parameters": {
        "url": "https://commentpicker.com/actions/token.php",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "authority",
              "value": "commentpicker.com"
            },
            {
              "name": "cookie",
              "value": "ezosuibasgeneris-1=690da322-c7c8-44e2-6154-8591a44d12aa; fontsLoaded=true; PHPSESSID=12ltjv3rr293h943c8h35nh3cg; ezoab_186623=mod54-c; active_template::186623=pub_site.1711191989"
            },
            {
              "name": "referer",
              "value": "https://commentpicker.com/youtube-channel-id.php"
            },
            {
              "name": "user-agent",
              "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.1
    },
    {
      "name": "GTT",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "3rd party API request",
      "position": [
        320,
        -80
      ],
      "parameters": {
        "url": "https://commentpicker.com/actions/token.php",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "authority",
              "value": "commentpicker.com"
            },
            {
              "name": "cookie",
              "value": "ezosuibasgeneris-1=690da322-c7c8-44e2-6154-8591a44d12aa; fontsLoaded=true; PHPSESSID=12ltjv3rr293h943c8h35nh3cg; ezoab_186623=mod54-c; active_template::186623=pub_site.1711191989"
            },
            {
              "name": "referer",
              "value": "https://commentpicker.com/youtube-channel-id.php"
            },
            {
              "name": "user-agent",
              "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.1
    },
    {
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "notes": "🤖Combine results in one",
      "position": [
        1080,
        -260
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "renameField": true,
              "outputFieldName": "rss url",
              "fieldToAggregate": "rss"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "name": "YouTube 频道视频 RSS 格式",
      "type": "n8n-nodes-base.set",
      "notes": "RSS Feed for channel Posts",
      "position": [
        1260,
        -180
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6af1de72-9940-4843-9a98-94e36b2878a3",
              "name": "=Videos - HTML format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YoutubeBridge&context=By+channel+id&c={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&duration_min=&duration_max=&format=Html"
            },
            {
              "id": "2b486723-1dff-4525-8169-6d977dee6862",
              "name": "Videos - ATOM format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YoutubeBridge&context=By+channel+id&c={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&duration_min=&duration_max=&format=Atom"
            },
            {
              "id": "10b3c04a-2c8c-4533-944b-13123bd22743",
              "name": "Videos - JSON format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YoutubeBridge&context=By+channel+id&c={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&duration_min=&duration_max=&format=Json"
            },
            {
              "id": "ee8910de-76ab-47a3-b23f-1a1e837fb885",
              "name": "Videos - MRSS format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YoutubeBridge&context=By+channel+id&c={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&duration_min=&duration_max=&format=Mrss"
            },
            {
              "id": "8684437c-11f0-4cc2-b9b2-00ecb6768175",
              "name": "Videos - TEXT format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YoutubeBridge&context=By+channel+id&c={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&duration_min=&duration_max=&format=Plaintext"
            },
            {
              "id": "a53d1d0a-bfd1-41f4-9ab3-edd1e20adaa2",
              "name": "Videos - SFEED format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YoutubeBridge&context=By+channel+id&c={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&duration_min=&duration_max=&format=Sfeed"
            },
            {
              "id": "d17fd2e0-0e4a-45c9-bc60-86ca6a7940d4",
              "name": "Videos - XML format response",
              "type": "string",
              "value": "={{ $json[\"rss url\"][\"0\"] }}"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 3.3
    },
    {
      "name": "YouTube 频道社区 RSS 格式",
      "type": "n8n-nodes-base.set",
      "notes": "RSS Feed for channel Posts",
      "position": [
        1260,
        -400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6af1de72-9940-4843-9a98-94e36b2878a3",
              "name": "=Community - HTML format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YouTubeCommunityTabBridge&context=By+channel+ID&channel={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&format=HTML"
            },
            {
              "id": "2b486723-1dff-4525-8169-6d977dee6862",
              "name": "Community - ATOM format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YouTubeCommunityTabBridge&context=By+channel+ID&channel={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&format=Atom"
            },
            {
              "id": "10b3c04a-2c8c-4533-944b-13123bd22743",
              "name": "Community - JSON format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YouTubeCommunityTabBridge&context=By+channel+ID&channel={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&format=Json"
            },
            {
              "id": "ee8910de-76ab-47a3-b23f-1a1e837fb885",
              "name": "Community - MRSS format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YouTubeCommunityTabBridge&context=By+channel+ID&channel={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&format=Mrss"
            },
            {
              "id": "8684437c-11f0-4cc2-b9b2-00ecb6768175",
              "name": "Community - TEXT format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YouTubeCommunityTabBridge&context=By+channel+ID&channel={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&format=Plaintext"
            },
            {
              "id": "a53d1d0a-bfd1-41f4-9ab3-edd1e20adaa2",
              "name": "Community - SFEED format response",
              "type": "string",
              "value": "=https://rss-bridge.org/bridge01/?action=display&bridge=YouTubeCommunityTabBridge&context=By+channel+ID&channel={{ $item(\"0\").$node[\"Aggregate\"].json[\"rss url\"][\"0\"].match(/channel_id=([^&?/]+)/)[1] }}&format=Sfeed"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 3.3
    },
    {
      "name": "响应 Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "notes": "Reply to the webhook request with table",
      "position": [
        1900,
        -280
      ],
      "parameters": {
        "options": {},
        "respondWith": "text",
        "responseBody": "={{ $json[\"html\"] }}"
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        140
      ],
      "parameters": {
        "color": 7,
        "width": 2425.409405354546,
        "height": 200.24482670360715,
        "content": "## ℹ️ **解决方案与信息**"
      },
      "typeVersion": 1
    },
    {
      "name": "Google Calendar MCP",
      "type": "n8n-nodes-base.switch",
      "position": [
        60,
        -260
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Username",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.type }}",
                    "rightValue": "channel username"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Direct",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "5af4921b-6266-436a-901c-ab52de68aaf4",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.type }}",
                    "rightValue": "=channel ID"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Video-ID",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "a5baa5e6-879f-484a-b521-af802b6d79a9",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.type }}",
                    "rightValue": "=video ID"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -520
      ],
      "parameters": {
        "color": 3,
        "width": 2429.6732915601406,
        "height": 644.5128280596109,
        "content": "## 🌐 **为公开 YouTube 频道生成 RSS 源(无需 API 或管理员权限 😉)**"
      },
      "typeVersion": 1
    },
    {
      "name": "验证代码",
      "type": "n8n-nodes-base.code",
      "notes": "🤓Validate the YouTube input",
      "position": [
        -120,
        -260
      ],
      "parameters": {
        "jsCode": "// JavaScript code to extract YouTube channel ID, username, or video ID from a given input and return in n8n compatible format\n\n// Initialize an array to hold the output items\nconst items = [];\n\n// Extract the input value from the previous node's output using the $input API\nconst inputData = $input.all(); // Get all input data\n// Assuming 'youtube Channel username or ID' is the correct key, and it's in the first input item\nconst input = inputData.length > 0 ? inputData[0].json[\"youtube Channel username or ID\"] : null;\n\n// Check if input exists\nif (!input) {\n    throw new Error('Input is undefined or not provided');\n}\n\n// Regular expressions for different YouTube URL and input formats\nconst usernamePattern = /^@?([a-zA-Z0-9_-]+)$/;\nconst channelIdPattern = /^(UC[a-zA-Z0-9_-]{22})$/; // Ensure channel ID starts with \"UC\"\nconst videoUrlPattern1 = /(?:https?:\\/\\/)?www\\.youtube\\.com\\/watch\\?v=([a-zA-Z0-9_-]+)/;\nconst videoUrlPattern2 = /(?:https?:\\/\\/)?youtu\\.be\\/([a-zA-Z0-9_-]+)/;\nconst channelUrlPattern1 = /(?:https?:\\/\\/)?www\\.youtube\\.com\\/@([a-zA-Z0-9_-]+)/;\nconst channelUrlPattern2 = /(?:https?:\\/\\/)?www\\.youtube\\.com\\/channel\\/(UC[a-zA-Z0-9_-]{22})/;\nconst customChannelUrlPattern = /(?:https?:\\/\\/)?www\\.youtube\\.com\\/c\\/([a-zA-Z0-9_-]+)/; // Pattern for custom channel URLs\n\n// Function to determine the type and value of the input\nfunction determineTypeAndValue(input) {\n    if (channelIdPattern.test(input)) {\n        return { type: 'channel ID', value: input };\n    } else if (usernamePattern.test(input)) {\n        return { type: 'channel username', value: input };\n    } else if (videoUrlPattern1.test(input) || videoUrlPattern2.test(input)) {\n        const videoId = videoUrlPattern1.test(input) ? input.match(videoUrlPattern1)[1] : input.match(videoUrlPattern2)[1];\n        return { type: 'video ID', value: videoId };\n    } else if (channelUrlPattern1.test(input) || customChannelUrlPattern.test(input)) {\n        const username = channelUrlPattern1.test(input) ? input.match(channelUrlPattern1)[1] : input.match(customChannelUrlPattern)[1];\n        return { type: 'channel username', value: username };\n    } else if (channelUrlPattern2.test(input)) {\n        return { type: 'channel ID', value: input.match(channelUrlPattern2)[1] };\n    } else {\n        return { error: 'Invalid input or unsupported format.' };\n    }\n}\n\n// Process the input and add the result to the items array\nconst result = determineTypeAndValue(input);\nitems.push({ json: result });\n\nreturn items; // Return the array of items\n"
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "name": "将响应格式化为 HTML 表格",
      "type": "n8n-nodes-base.code",
      "position": [
        1680,
        -280
      ],
      "parameters": {
        "jsCode": "// Assuming inputData is dynamically retrieved as follows\nconst inputData = $item(\"0\").$node[\"Merga Data of Youtube & Community RSS\"].json;\n\n// Initialize HTML with a modern styled table\nlet html = `\n<style>\n  table {\n    width: 100%;\n    border-collapse: collapse;\n    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n    box-shadow: 0 2px 15px rgba(0,0,0,0.1);\n    border-radius: 8px;\n    overflow: hidden;\n    margin-top: 20px;\n  }\n  th, td {\n    border: 1px solid #ddd;\n    padding: 8px 16px;\n    text-align: left;\n    color: #333;\n  }\n  th {\n    background-color: #f0f0f0;\n    color: #000;\n    font-weight: 600;\n  }\n  tr:nth-child(even) {background-color: #f9f9f9;}\n  tr:hover {background-color: #f1f1f1;}\n  a {\n    text-decoration: none;\n    color: #0645AD;\n  }\n  a:hover {\n    text-decoration: underline;\n  }\n</style>\n<table>\n<tr>\n  <th>Type</th>\n  <th>Format</th>\n  <th>URL</th>\n</tr>`;\n\n// Function to process each item and add it to the HTML table\nObject.entries(inputData).forEach(([key, value]) => {\n  // Extract type and format from the key, assuming key format 'Category - Format'\n  const [type, format] = key.split(' - ');\n  html += `<tr>\n    <td>${type} RSS</td>\n    <td>${format}</td>\n    <td><a href=\"${value}\" target=\"_blank\">${value}</a></td>\n  </tr>`;\n});\n\n// Close the HTML table tag\nhtml += `</table>`;\n\n// Return the HTML string as output\nreturn [{json: {html: html}}];\n"
      },
      "typeVersion": 2
    },
    {
      "name": "合并 YouTube 和社区 RSS 数据",
      "type": "n8n-nodes-base.merge",
      "position": [
        1480,
        -280
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combinationMode": "multiplex"
      },
      "typeVersion": 2.1
    }
  ],
  "active": "false",
  "pinData": {},
  "settings": {
    "timezone": "Asia/Baghdad",
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": "",
    "executionOrder": "v1",
    "executionTimeout": 600,
    "saveManualExecutions": true,
    "saveExecutionProgress": true
  },
  "staticData": "",
  "connections": {
    "GTT": {
      "main": [
        [
          {
            "node": "Set Video ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Get Temporary Token",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set XML Feed URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "GTT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Youtube Channel Community RSS Formats",
            "type": "main",
            "index": 0
          },
          {
            "node": "Youtube Channel Videos RSS Formats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set XML URL": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Video ID": {
      "main": [
        [
          {
            "node": "Get Video ID Channel ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set XML Feed": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Channel ID": {
      "main": [
        [
          {
            "node": "Set XML URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validation Code": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set XML Feed URL": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n Form Trigger": {
      "main": [
        [
          {
            "node": "Validation Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Temporary Token": {
      "main": [
        [
          {
            "node": "Set Channel Username",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Channel Username": {
      "main": [
        [
          {
            "node": "Get Channel ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video ID Channel ID": {
      "main": [
        [
          {
            "node": "Set XML Feed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format response as HTML Table": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Youtube Channel Videos RSS Formats": {
      "main": [
        [
          {
            "node": "Merga Data of Youtube & Community RSS",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merga Data of Youtube & Community RSS": {
      "main": [
        [
          {
            "node": "Format response as HTML Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Youtube Channel Community RSS Formats": {
      "main": [
        [
          {
            "node": "Merga Data of Youtube & Community RSS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 营销

需要付费吗?

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

工作流信息
难度等级
高级
节点数量20
分类1
节点类型9
难度说明

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

作者
Nskha

Nskha

@nskha

Welcome to Nskha! We're all about making real changes in the no-code tech field, just like with N8N 😉. Check out our amazing collection of free public templates and join us in building a collaborative database of no-code idea projects. Let's revolutionize the way we create without code!

外部链接
在 n8n.io 查看

分享此工作流