自动更新 YouTube 视频描述并插入文本
中级
这是一个Marketing领域的自动化工作流,包含 9 个节点。主要使用 Set, Code, YouTube, ManualTrigger, SplitInBatches 等节点。 自动更新 YouTube 视频描述并插入文本
前置要求
- •无特殊前置要求,导入即可使用
分类
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"name": "自动更新 YouTube 视频描述并插入文本",
"tags": [],
"nodes": [
{
"id": "19cafddc-6199-4418-8213-9743c34c9176",
"name": "获取所有视频",
"type": "n8n-nodes-base.youTube",
"position": [
480,
380
],
"parameters": {
"limit": 3,
"filters": {},
"options": {
"order": "date"
},
"resource": "video"
},
"typeVersion": 1
},
{
"id": "63a6a8e6-994f-46ab-a731-609549fec99f",
"name": "更新视频描述",
"type": "n8n-nodes-base.youTube",
"position": [
1320,
460
],
"parameters": {
"title": "={{ $('Get Specific Video').item.json.snippet.title }}",
"videoId": "={{ $('Get Specific Video').item.json.id}}",
"resource": "video",
"operation": "update",
"categoryId": "={{ $('Get Specific Video').item.json.snippet.categoryId }}",
"regionCode": "US",
"updateFields": {
"tags": "={{ $('Get Specific Video').item.json.snippet.tags.join() }}",
"description": "={{ $json.updatedDescription }}"
}
},
"typeVersion": 1
},
{
"id": "ce147272-f6c3-4cfb-954b-9a77c63a6232",
"name": "当点击\"测试工作流\"时",
"type": "n8n-nodes-base.manualTrigger",
"position": [
120,
380
],
"parameters": {},
"typeVersion": 1
},
{
"id": "9ba206b2-1161-41a3-8581-d60dae665096",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
100,
120
],
"parameters": {
"color": 5,
"width": 580,
"height": 180,
"content": "## 在 YouTube 视频描述中插入文本"
},
"typeVersion": 1
},
{
"id": "e05f5b9c-c160-45d7-b67a-62d68acc0829",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
100,
560
],
"parameters": {
"color": 4,
"width": 340,
"height": 260,
"content": "## 配置要插入的文本字符串 👆"
},
"typeVersion": 1
},
{
"id": "51a3fd15-8767-4cc0-98a8-fe98ec90db70",
"name": "设置要插入的字符串",
"type": "n8n-nodes-base.set",
"position": [
300,
380
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a05b56b1-6f18-4359-aa4b-127399877301",
"name": "rowBefore",
"type": "string",
"value": "=https://firstlink.com"
},
{
"id": "95ac4a95-cdf4-4d7a-b9a3-78d54c879115",
"name": "rowToInsert",
"type": "string",
"value": "https://mynewlinktoinsert.com"
},
{
"id": "ded86a1f-f0a5-42b8-9176-9be4038f6290",
"name": "rowAfter",
"type": "string",
"value": "https://secondlink.com"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "590b8bb3-6eb4-4bb8-af4c-c2d95221f045",
"name": "遍历视频",
"type": "n8n-nodes-base.splitInBatches",
"position": [
700,
380
],
"parameters": {
"options": {
"reset": false
}
},
"typeVersion": 3
},
{
"id": "a80ac941-0a99-4eab-8a6c-effef1e136fa",
"name": "获取特定视频",
"type": "n8n-nodes-base.youTube",
"position": [
900,
460
],
"parameters": {
"options": {},
"videoId": "={{ $json.id.videoId }}",
"resource": "video",
"operation": "get"
},
"typeVersion": 1
},
{
"id": "2c4519e2-1af9-42d7-818c-8165365587fb",
"name": "创建插入新行的视频描述",
"type": "n8n-nodes-base.code",
"position": [
1100,
460
],
"parameters": {
"jsCode": "// Access the input data (YouTube description)\nconst description = $('Get Specific Video').first().json.snippet.description;\n//console.log(inputData)\n\nconst variables = $('Set String to Insert').first().json\n// Define the rows to search for and the row to insert\nconst rowBefore = variables.rowBefore;\nconst rowAfter = variables.rowAfter;\nconst rowToInsert = variables.rowToInsert;\n\n// Split the description into an array of rows\nconst rows = description.split(\"\\n\");\nconsole.log(rows)\n// Find the index of the rowBefore and rowAfter\nconst indexBefore = rows.findIndex(row => row.trim() === rowBefore);\nconst indexAfter = rows.findIndex(row => row.trim() === rowAfter);\n\n// Check if both rows are found and rowBefore comes before rowAfter\nif (indexBefore !== -1 && indexAfter !== -1 && indexBefore < indexAfter) {\n // Insert the new row between rowBefore and rowAfter\n rows.splice(indexBefore + 1, 0, rowToInsert);\n}\n\n// Join the rows back into a single string\nconst updatedDescription = rows.join(\"\\n\");\n\n// Return the updated description in the correct n8n output structure\nreturn [\n {\n json: {\n updatedDescription: updatedDescription\n }\n }\n];"
},
"typeVersion": 2
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "50fd0bcb-7441-45eb-ab58-ca2a7de78516",
"connections": {
"Get All Videos": {
"main": [
[
{
"node": "Loop Over Videos",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Videos": {
"main": [
[],
[
{
"node": "Get Specific Video",
"type": "main",
"index": 0
}
]
]
},
"Get Specific Video": {
"main": [
[
{
"node": "Create New Video Description with Row Inserted",
"type": "main",
"index": 0
}
]
]
},
"Set String to Insert": {
"main": [
[
{
"node": "Get All Videos",
"type": "main",
"index": 0
}
]
]
},
"Update Video Description": {
"main": [
[
{
"node": "Loop Over Videos",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Test workflow’": {
"main": [
[
{
"node": "Set String to Insert",
"type": "main",
"index": 0
}
]
]
},
"Create New Video Description with Row Inserted": {
"main": [
[
{
"node": "Update Video Description",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 营销
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
Overpass 潜在客户生成系统
使用 OpenStreetMap 数据生成商业线索并保存到 Google Sheets
If
Set
Code
+12
27 节点Akram Kadri
销售
Google Maps邮箱采集器模板
无需使用任何第三方API从Google Maps抓取企业邮箱
Code
Wait
Filter
+10
26 节点Akram Kadri
销售
YouTube 自动化
自动化 YouTube 视频排程和 AI 元数据生成 🎬
If
Set
Code
+11
33 节点JPres
人工智能
完成YouTube
基于细分领域的AI YouTube趋势发现器
If
Set
Code
+10
18 节点Leonardo Grigorio
人工智能
抓取Meta广告库并使用Gemini分析视频广告,将数据存储到Google Sheets
使用Gemini分析Meta广告库视频广告,并将结果存储到Google Sheets
Set
Code
Sort
+11
24 节点Daniel Setzermann
人工智能
病毒式标题/缩略图生成
自动化病毒式YouTube标题和缩略图创建(FLUX.1 + Apify)
If
Set
Code
+13
41 节点Nasser
人工智能
工作流信息
难度等级
中级
节点数量9
分类1
节点类型6
作者
Akram Kadri
@akramkadrin8n Automation Freelancer ------------------------ Contact me at: akram@digispruce.com
外部链接
在 n8n.io 查看 →
分享此工作流