菜单导航

开发故事
Automate reddit video creation with n8n待验证
开发故事

Automate reddit video creation with n8n待验证

野盐
2025-06-11

「Reddit帖子自动化转视频:n8n工作流详解」
从抓取Reddit内容到AI解析,
再到视频渲染与上传——
这份n8n工作流定义,
帮你省去90%重复劳动。

{
  "name": "Reddit Post and Video Automation Workflow",
  "nodes": [
    {
      "parameters": {
        "triggerOn": "manual"
      },
      "name": "Form Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [250, 300],
      "webhookId": "form-trigger-webhook"
    },
    {
      "parameters": {
        "url": "https://www.reddit.com",
        "options": {}
      },
      "name": "Scrape Reddit Post",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [450, 300],
      "credentials": {}
    },
    {
      "parameters": {
        "mode": "parseHtml",
        "options": {
          "output": "structured"
        }
      },
      "name": "AI Content Parsing",
      "type": "n8n-nodes-base.html",
      "typeVersion": 1,
      "position": [650, 300],
      "credentials": {
        "googleGeminiApi": {
          "apiKey": "your-gemini-api-key"
        }
      }
    },
    {
      "parameters": {
        "url": "https://api.reddit-image-generator.com",
        "options": {
          "method": "GET",
          "headerParameters": {
            "Authorization": "Bearer your-api-key"
          }
        }
      },
      "name": "Generate And Upload Reddit Post Image",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [850, 300],
      "credentials": {}
    },
    {
      "parameters": {
        "filePath": "reddit_image.jpg",
        "operation": "upload"
      },
      "name": "Upload Image",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 1,
      "position": [1050, 250],
      "credentials": {
        "googleDriveApi": {
          "refreshToken": "your-google-drive-refresh-token"
        }
      }
    },
    {
      "parameters": {
        "filePath": "reddit_image.jpg",
        "operation": "share"
      },
      "name": "Share File",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 1,
      "position": [1050, 350],
      "credentials": {
        "googleDriveApi": {
          "refreshToken": "your-google-drive-refresh-token"
        }
      }
    },
    {
      "parameters": {
        "url": "https://api.replicate.com/v1/audio",
        "options": {
          "method": "POST",
          "body": {
            "model": "minimax/speech-02-hd"
          }
        }
      },
      "name": "Generate Audio From Replicate API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [1250, 300],
      "credentials": {
        "replicateApi": {
          "apiKey": "your-replicate-api-key"
        }
      }
    },
    {
      "parameters": {
        "filePath": "audio_file.mp3",
        "operation": "upload"
      },
      "name": "Upload Audio to GDrive",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 1,
      "position": [1450, 300],
      "credentials": {
        "googleDriveApi": {
          "refreshToken": "your-google-drive-refresh-token"
        }
      }
    },
    {
      "parameters": {
        "resource": "file",
        "operation": "getAll",
        "filters": {
          "name": "clips"
        }
      },
      "name": "Get Clips Folder",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 1,
      "position": [1650, 200],
      "credentials": {
        "googleDriveApi": {
          "refreshToken": "your-google-drive-refresh-token"
        }
      }
    },
    {
      "parameters": {
        "resource": "file",
        "operation": "getAll",
        "filters": {
          "name": "clips/*"
        }
      },
      "name": "List Clips Files",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 1,
      "position": [1650, 300],
      "credentials": {
        "googleDriveApi": {
          "refreshToken": "your-google-drive-refresh-token"
        }
      }
    },
    {
      "parameters": {
        "functionCode": "return $json.randomItem($node['List Clips Files'].json);"
      },
      "name": "Aggregate Clips & Select A Random Clip",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [1650, 400],
      "credentials": {}
    },
    {
      "parameters": {
        "url": "https://api.json2video.cc/render",
        "options": {
          "method": "POST",
          "body": {
            "renderObject": {}
          }
        }
      },
      "name": "Start The Video Rendering",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [1850, 300],
      "credentials": {}
    },
    {
      "parameters": {
        "url": "https://api.json2video.cc/status",
        "options": {
          "method": "GET"
        }
      },
      "name": "Check Progress",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [2050, 300],
      "credentials": {}
    },
    {
      "parameters": {
        "functionCode": "if ($node['Check Progress'].json.status === 'completed') { return $node['Check Progress'].json; } return null;"
      },
      "name": "If True",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [2250, 300],
      "credentials": {}
    },
    {
      "parameters": {
        "filePath": "video_file.mp4",
        "operation": "upload"
      },
      "name": "Upload the Video",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 1,
      "position": [2450, 300],
      "credentials": {
        "googleDriveApi": {
          "refreshToken": "your-google-drive-refresh-token"
        }
      }
    }
  ],
  "connections": {
    "Form Trigger": {
      "main": [
        [
          {
            "node": "Scrape Reddit Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Reddit Post": {
      "main": [
        [
          {
            "node": "AI Content Parsing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Content Parsing": {
      "main": [
        [
          {
            "node": "Generate And Upload Reddit Post Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate And Upload Reddit Post Image": {
      "main": [
        [
          {
            "node": "Upload Image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Share File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image": {
      "main": [
        [
          {
            "node": "Generate Audio From Replicate API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Share File": {
      "main": [
        [
          {
            "node": "Generate Audio From Replicate API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Audio From Replicate API": {
      "main": [
        [
          {
            "node": "Upload Audio to GDrive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Audio to GDrive": {
      "main": [
        [
          {
            "node": "Get Clips Folder",
            "type": "main",
            "index": 0
          },
          {
            "node": "List Clips Files",
            "type": "main",
            "index": 0
          },
          {
            "node": "Aggregate Clips & Select A Random Clip",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Clips & Select A Random Clip": {
      "main": [
        [
          {
            "node": "Start The Video Rendering",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start The Video Rendering": {
      "main": [
        [
          {
            "node": "Check Progress",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Progress": {
      "main": [
        [
          {
            "node": "If True",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If True": {
      "main": [
        [
          {
            "node": "Upload the Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  }
}

Notes by Grok:

  • Node Types: I used n8n's built-in node types (e.g., webhook, httpRequest, googleDrive, function, if) to match the actions in the flowchart. You may need to adjust the exact parameters or credentials based on your setup.

  • Credentials: Placeholder API keys and refresh tokens are included (e.g., your-api-key). Replace these with actual credentials.

  • Positions: Approximate position values are set to reflect the layout in the image, but you can adjust them in the n8n UI.

  • Connections: The connections object defines the flow between nodes, following the sequence in the image.

  • Required APIs: The workflow assumes the use of Reddit Post Render API and Replicate API, which are integrated via HTTP requests. You’ll need to configure these APIs with valid endpoints and keys.

版权声明

本文为「野盐」原创内容,图片个人摄影 / 手绘 / AIGC,后期 PhotoMator / Procreate,版权归「野盐」所有。未经授权,禁止用于商业用途,禁止抹除水印,禁止转发至小红书等平台。转载请注明出处与链接并保留本声明。

...

评论 (0)

评论将以随机ID显示
野盐

野盐

@wildsalt.me

推荐阅读

Certbot 在 Nginx 为域名自动配置 SSL
开发故事

Certbot 在 Nginx 为域名自动配置 SSL

野盐 | 2025-07-07

Certbot 让 HTTPS 证书续期变得简单,自动为 Nginx 配置 SSL,告别手动操作

10
小型工具性网站,利用长尾关键词获取搜索流量
开发故事

小型工具性网站,利用长尾关键词获取搜索流量

野盐 | 2025-07-02

小工具,大流量:长尾关键词如何成为小众网站的隐形金矿

16
解决 AI 编程助手多轮对话后幻觉和代码乱改问题的策略
开发故事

解决 AI 编程助手多轮对话后幻觉和代码乱改问题的策略

野盐 | 2025-06-06

AI代码助手不是魔法师,而是需要精确引导的学徒——当它开始‘自由发挥’,你需要更严格的对话管理和边界设定。

36