8
n8n 中文网amn8n.com

🔁 将所有YouTube播放列表从一个频道复制到另一个频道

高级

这是一个Other, Building Blocks, Marketing领域的自动化工作流,包含 16 个节点。主要使用 Set, Merge, Filter, YouTube, ManualTrigger 等节点。 🔁 将YouTube播放列表从一个频道复制到另一个频道

前置要求
  • 无特殊前置要求,导入即可使用
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "liuPFewuxM0EKCHB",
  "meta": {
    "instanceId": "a059b3dfdab56aa587cc6a2c8635f6f2700cf0c7064dbfb5981c26f7ad9eab88",
    "templateCredsSetupCompleted": true
  },
  "name": "🔁 将所有 YouTube 播放列表从一个频道复制到另一个频道",
  "tags": [],
  "nodes": [
    {
      "id": "8800e21d-1509-4343-bb38-35ade84e4a0d",
      "name": "当点击\"测试工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1060,
        180
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5dd198e6-4558-4236-9ed5-b1d44305e0e3",
      "name": "移除私有项目",
      "type": "n8n-nodes-base.filter",
      "position": [
        40,
        180
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "154d991a-b2aa-4764-b5d1-af43a58777db",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.status.privacyStatus }}",
              "rightValue": "private"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d833d617-3d12-4853-968b-9675b2008351",
      "name": "仅保留播放列表 ID",
      "type": "n8n-nodes-base.set",
      "position": [
        260,
        -20
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88dd068e-6aa3-4b87-86a9-7509145efd4e",
              "name": "playlist_id",
              "type": "string",
              "value": "={{ $json.id }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d242e4b9-c40e-4708-8eaa-70a777bcc6ce",
      "name": "仅保留视频 ID",
      "type": "n8n-nodes-base.set",
      "position": [
        260,
        180
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "04d39c63-eb09-44a3-aca4-e6558bc831a3",
              "name": "video_id",
              "type": "string",
              "value": "={{ $json.contentDetails.videoId }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "90da5397-e9f2-4f92-ab4d-74bd8ac5fece",
      "name": "在同一项目中合并播放列表和视频 ID",
      "type": "n8n-nodes-base.merge",
      "position": [
        480,
        80
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.1
    },
    {
      "id": "ac018739-a908-43ef-8e4a-4ce4af2f00a2",
      "name": "从源频道获取所有播放列表",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -840,
        180
      ],
      "parameters": {
        "filters": {},
        "options": {},
        "resource": "playlist",
        "returnAll": true
      },
      "credentials": {
        "youTubeOAuth2Api": {
          "id": "bJCjudWjB0FmcvHu",
          "name": "YouTube account"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1,
      "waitBetweenTries": 5000
    },
    {
      "id": "4e0a1f4f-19e3-4733-8915-0fcff3763dab",
      "name": "从原始播放列表获取播放列表项目",
      "type": "n8n-nodes-base.youTube",
      "position": [
        -180,
        180
      ],
      "parameters": {
        "part": [
          "contentDetails",
          "status"
        ],
        "options": {},
        "resource": "playlistItem",
        "operation": "getAll",
        "returnAll": true,
        "playlistId": "={{ $json.id }}"
      },
      "credentials": {
        "youTubeOAuth2Api": {
          "id": "bJCjudWjB0FmcvHu",
          "name": "YouTube account"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1,
      "waitBetweenTries": 5000
    },
    {
      "id": "fa3ff44c-ad35-43ce-8653-0304cf086365",
      "name": "在目标频道创建新播放列表",
      "type": "n8n-nodes-base.youTube",
      "position": [
        40,
        -20
      ],
      "parameters": {
        "title": "={{ $json.title }}",
        "options": {},
        "resource": "playlist",
        "operation": "create"
      },
      "credentials": {
        "youTubeOAuth2Api": {
          "id": "bJCjudWjB0FmcvHu",
          "name": "Sample YouTube account"
        }
      },
      "retryOnFail": false,
      "typeVersion": 1,
      "waitBetweenTries": 5000
    },
    {
      "id": "5438bdbd-472d-4526-8617-cd3b25e9a469",
      "name": "向目标播放列表添加项目",
      "type": "n8n-nodes-base.youTube",
      "onError": "continueRegularOutput",
      "position": [
        700,
        155
      ],
      "parameters": {
        "options": {},
        "videoId": "={{ $json.video_id }}",
        "resource": "playlistItem",
        "playlistId": "={{ $json.playlist_id }}"
      },
      "credentials": {
        "youTubeOAuth2Api": {
          "id": "bJCjudWjB0FmcvHu",
          "name": "Sample YouTube account"
        }
      },
      "retryOnFail": true,
      "typeVersion": 1,
      "waitBetweenTries": 5000
    },
    {
      "id": "2401dbbc-582a-48f9-bea9-5f6d1b0996b3",
      "name": "正确格式化字段",
      "type": "n8n-nodes-base.set",
      "position": [
        -620,
        180
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0d59b712-8fdd-44cd-9759-f0fdd06dbf32",
              "name": "id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "f36f4a16-6783-4da4-a9b6-993ca8f4e342",
              "name": "title",
              "type": "string",
              "value": "={{ $json.snippet.title }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "f5429621-cde3-4c6d-a432-11c7e0e33508",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1060,
        -260
      ],
      "parameters": {
        "color": 3,
        "width": 880,
        "height": 400,
        "content": "## 🔁 将所有 YouTube 播放列表从一个频道复制到另一个频道"
      },
      "typeVersion": 1
    },
    {
      "id": "94d26808-fbec-4914-a100-7f78caa6f240",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -860,
        360
      ],
      "parameters": {
        "color": 4,
        "width": 260,
        "content": "## 👆👆👆"
      },
      "typeVersion": 1
    },
    {
      "id": "58c42f5e-e403-4460-bf30-a8f61c96c8fc",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        360
      ],
      "parameters": {
        "color": 4,
        "width": 260,
        "content": "## 👆👆👆"
      },
      "typeVersion": 1
    },
    {
      "id": "25dba347-a6a4-4883-a2ac-c018665a8dfa",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        680,
        360
      ],
      "parameters": {
        "color": 2,
        "width": 260,
        "content": "## 👆👆👆"
      },
      "typeVersion": 1
    },
    {
      "id": "b07f3c7d-dfa2-4e81-b195-091495ce0cd5",
      "name": "便签说明4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        -200
      ],
      "parameters": {
        "color": 2,
        "width": 260,
        "content": "## 在此处添加您的目标频道凭据"
      },
      "typeVersion": 1
    },
    {
      "id": "0604092e-965c-41a2-bc91-10f612a48f79",
      "name": "循环遍历播放列表",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -400,
        180
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6befe167-c7f6-42e0-8f9a-ff98888a3463",
  "connections": {
    "Loop over playlists": {
      "main": [
        [],
        [
          {
            "node": "Get playlist items from original playlist",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create new playlist in the target channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove private items": {
      "main": [
        [
          {
            "node": "Keep only the video id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format fields properly": {
      "main": [
        [
          {
            "node": "Loop over playlists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep only the video id": {
      "main": [
        [
          {
            "node": "Join the playlist and video id in the same item",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Keep only the playlist id": {
      "main": [
        [
          {
            "node": "Join the playlist and video id in the same item",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add items to target playlist": {
      "main": [
        [
          {
            "node": "Loop over playlists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Get all playlists from origin channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all playlists from origin channel": {
      "main": [
        [
          {
            "node": "Format fields properly",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create new playlist in the target channel": {
      "main": [
        [
          {
            "node": "Keep only the playlist id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get playlist items from original playlist": {
      "main": [
        [
          {
            "node": "Remove private items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Join the playlist and video id in the same item": {
      "main": [
        [
          {
            "node": "Add items to target playlist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 其他, 构建模块, 营销

需要付费吗?

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

工作流信息
难度等级
高级
节点数量16
分类3
节点类型7
难度说明

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

作者
Lucía Maio Brioso

Lucía Maio Brioso

@luciamb

I'm a backend software developer who loves n8n ⚙️ I enjoy automating everything and share templates I personally find helpful 💡

外部链接
在 n8n.io 查看

分享此工作流