{
  "name": "\u8d44\u8baf\u8f6c\u89c6\u9891\u81ea\u52a8\u5316",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * *"
            }
          ]
        }
      },
      "id": "schedule-trigger-001",
      "name": "\u5b9a\u65f6\u89e6\u53d1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "mode": "raw",
        "jsonOutput": "{\n  \"id\": 8,\n  \"title\": \"\u524d\u5c0f\u9e4f\u9ad8\u7ba1\u521b\u4e1a\uff0c\u7ed9\u7f8e\u56fd\u5bb6\u5ead\u9020\u4e86\u53f0\u6237\u5916\u966a\u4f34\u673a\u5668\u4eba\",\n  \"original_url\": \"https://36kr.com/p/3638686789454983?f=rss\",\n  \"source\": \"36\u6c2a\",\n  \"category\": \"\u5176\u4ed6\",\n  \"tags\": [],\n  \"summary\": \"\u6587\uff5c\u90b1\u6653\u82ac \u7f16\u8f91\uff5c\u82cf\u5efa\u52cb CES 2026\u4e0a\uff0c\u4e00\u5bb6\u4e2d\u56fd\u673a\u5668\u4eba\u516c\u53f8\u7684\u5c55\u53f0\u5916\u6324\u6ee1\u4e86\u4eba\u3002\u5927\u5bb6\u56f4\u89c2\u7684\uff0c\u4e0d\u662fCES\u4e0a\u53f8\u7a7a\u89c1\u60ef\u7684\u4eba\u5f62\u673a\u5668\u4eba\u6216\u56db\u8db3\u72d7\uff0c\u800c\u662f\u4e00\u53f0\u53cc\u8f6e\u8db3\u3001\u8eab\u8eaf\u56db\u56db\u65b9\u65b9\u3001\u5e26\u6709\u663e\u793a\u5c4f\u7684\u673a\u5668\u4eba\u2014\u2014\u53ea\u670915\u516c\u65a4\u91cd\uff0c40\u5398\u7c73\u9ad8\u3002\u5b83\u5728\u8349\u76ae\u4e0a\u65f6\u4e0d\u65f6\u62b1\u7740\u76ae\u7403\u884c\u8fdb\uff0c\u7a33\u7a33\u7a7f\u8d8a\u4e0d\u540c\u72b6\u6001\u7684\u5730\u9762\u3002\u770b\u5230\u6709\u89c2\u4f17\u62cd\u6444\u5b83\u65f6\uff0c\u5b83\u4f1a\u505c\u4e0b\u6765\u4e0e\u4eba\u4e92\u52a8\uff0c\u5de6\u53f3\u8f7b\u8f7b\u6447\u6643\uff0c\u5e76\u5728\u5c4f\u5e55\u4e0a\u5207\u6362\u4e0d\u540c\u8868\u60c5\u3002\",\n  \"quality_score\": 85,\n  \"status\": \"approved\"\n}",
        "options": {}
      },
      "id": "test-data-001",
      "name": "\u6d4b\u8bd5\u6570\u636e",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// \u811a\u672c\u751f\u6210Prompt\nconst SCRIPT_PROMPT = `\u4f60\u662f\u4e00\u4f4d\u4e13\u4e1a\u7684\u77ed\u89c6\u9891\u811a\u672c\u4e13\u5bb6\u3002\u6839\u636e\u4ee5\u4e0b\u8d44\u8baf\u751f\u6210\u4e00\u4e2a30-60\u79d2\u7684\u89c6\u9891\u811a\u672c\u3002\n\n## \u8f93\u5165\u8d44\u8baf\n\u6807\u9898\uff1a${$json.title}\n\u6458\u8981\uff1a${$json.summary}\n\u6765\u6e90\uff1a${$json.source}\n\n## \u8981\u6c42\n1. \u573a\u666f\u6570\u91cf\uff1a4-5\u4e2a\n2. \u603b\u65f6\u957f\uff1a30-60\u79d2\n3. \u98ce\u683c\uff1a\u79d1\u6280\u611f\u3001\u5feb\u8282\u594f\u3001\u8d44\u8baf\u89e3\u8bf4\n\n## \u6bcf\u4e2a\u573a\u666f\u5fc5\u987b\u5305\u542b\n- narration: \u65c1\u767d\u6587\u6848\uff08\u53e3\u8bed\u5316\uff09\n- subtitle: \u5c4f\u5e55\u5b57\u5e55\uff0815\u5b57\u4ee5\u5185\uff09\n- image_prompt: \u82f1\u6587\u56fe\u7247\u751f\u6210\u63d0\u793a\u8bcd\uff08\u8be6\u7ec6\u63cf\u8ff0+\u5149\u5f71+\u6784\u56fe+\u98ce\u683c+photorealistic+8K\uff09\n- video_motion: \u8fd0\u955c\u6548\u679c\u63cf\u8ff0\n- duration: \u672c\u573a\u666f\u65f6\u957f\uff08\u79d2\uff09\n\n## \u97f3\u9891\u914d\u7f6e\n- bgm_style: \u80cc\u666f\u97f3\u4e50\u98ce\u683c\n- voice: \u65c1\u767d\u97f3\u8272\n\n\u76f4\u63a5\u8f93\u51faJSON\uff0c\u65e0\u5176\u4ed6\u5185\u5bb9\uff1a`;\n\nreturn {\n  json: {\n    prompt: SCRIPT_PROMPT,\n    article: $input.item.json\n  }\n};"
      },
      "id": "code-prompt-001",
      "name": "\u51c6\u5907Prompt",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "create",
        "model": "claude-3-5-sonnet-20241022",
        "messages": {
          "values": [
            {
              "role": "user",
              "content": "={{ $json.prompt }}"
            }
          ]
        },
        "options": {
          "temperature": 0.7,
          "maxTokens": 4000
        }
      },
      "id": "claude-llm-001",
      "name": "LLM\u751f\u6210\u811a\u672c",
      "type": "n8n-nodes-base.anthropic",
      "typeVersion": 1,
      "position": [
        900,
        300
      ],
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// \u89e3\u6790LLM\u8fd4\u56de\u7684JSON\u811a\u672c\nconst content = $input.item.json.content[0].text;\nlet jsonStr = content;\n\n// \u5904\u7406\u53ef\u80fd\u5b58\u5728\u7684markdown\u4ee3\u7801\u5757\nconst codeBlockMatch = content.match(/```(?:json)?\\s*([\\s\\S]*?)```/);\nif (codeBlockMatch) {\n  jsonStr = codeBlockMatch[1];\n} else {\n  const start = content.indexOf('{');\n  const end = content.lastIndexOf('}');\n  if (start !== -1 && end !== -1) {\n    jsonStr = content.substring(start, end + 1);\n  }\n}\n\ntry {\n  const script = JSON.parse(jsonStr);\n  // \u62c6\u5206\u6210\u591a\u4e2a\u573a\u666f\uff0c\u6bcf\u4e2a\u573a\u666f\u5355\u72ec\u5904\u7406\n  return script.scenes.map((scene, index) => ({\n    json: {\n      ...scene,\n      scene_index: index,\n      total_scenes: script.scenes.length,\n      audio_config: script.audio,\n      meta: script.meta\n    }\n  }));\n} catch (e) {\n  throw new Error(`\u89e3\u6790\u811a\u672c\u5931\u8d25: ${e.message}`);\n}"
      },
      "id": "code-parse-001",
      "name": "\u89e3\u6790\u811a\u672c\u5e76\u62c6\u5206\u573a\u666f",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1120,
        300
      ]
    },
    {
      "parameters": {
        "url": "=https://generativelanguage.googleapis.com/v1beta/models/imagen-3.0-generate-001:predict?key={{ $env.GOOGLE_API_KEY }}",
        "authentication": "none",
        "method": "POST",
        "jsonParameters": true,
        "bodyParametersJson": "={\n  \"instances\": [\n    {\n      \"prompt\": \"{{ $json.image_prompt }}\"\n    }\n  ],\n  \"parameters\": {\n    \"sampleCount\": 1,\n    \"aspectRatio\": \"16:9\",\n    \"safetyFilterLevel\": \"block_some\"\n  }\n}",
        "options": {
          "timeout": 60000
        }
      },
      "id": "http-image-001",
      "name": "\u751f\u6210\u573a\u666f\u56fe\u7247",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1340,
        300
      ]
    },
    {
      "parameters": {
        "url": "=https://api.openai.com/v1/videos/generations",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openAiApi",
        "method": "POST",
        "jsonParameters": true,
        "bodyParametersJson": "={\n  \"model\": \"sora-2\",\n  \"image\": \"{{ $json.predictions[0].bytesBase64Encoded }}\",\n  \"duration\": {{ $json.duration }} || 5,\n  \"motion\": \"{{ $json.video_motion }}\" || \"subtle\",\n  \"aspect_ratio\": \"16:9\"\n}",
        "options": {
          "timeout": 300000
        }
      },
      "id": "http-sora-001",
      "name": "Sora\u56fe\u751f\u89c6\u9891",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1560,
        300
      ],
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "url": "=https://api.openai.com/v1/audio/speech",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openAiApi",
        "method": "POST",
        "jsonParameters": true,
        "bodyParametersJson": "={\n  \"model\": \"tts-1-hd\",\n  \"input\": \"{{ $json.narration }}\",\n  \"voice\": \"onyx\",\n  \"speed\": 1.0\n}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "mp3"
            }
          }
        }
      },
      "id": "http-tts-001",
      "name": "\u751f\u6210\u65c1\u767d\u97f3\u9891",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1780,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// \u6536\u96c6\u6240\u6709\u573a\u666f\u7684\u89c6\u9891\u548c\u97f3\u9891\uff0c\u51c6\u5907\u5408\u6210\nconst items = $input.all();\nconst scenes = items.map(item => ({\n  scene_index: item.json.scene_index,\n  video_url: item.json.video_url,\n  audio_url: item.json.audio_url,\n  subtitle: item.json.subtitle,\n  duration: item.json.duration\n})).sort((a, b) => a.scene_index - b.scene_index);\n\nreturn [{\n  json: {\n    scenes: scenes,\n    total_duration: scenes.reduce((sum, s) => sum + s.duration, 0),\n    scene_count: scenes.length\n  }\n}];"
      },
      "id": "code-merge-001",
      "name": "\u5408\u5e76\u6240\u6709\u573a\u666f",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2000,
        300
      ]
    },
    {
      "parameters": {
        "command": "=ffmpeg -i \"{{ $json.scenes[0].video_url }}\" -i \"{{ $json.scenes[0].audio_url }}\" -vf \"subtitles=subtitle.srt\" -shortest -c:v libx264 -c:a aac \"output_{{ $now.format('x') }}.mp4\"",
        "options": {}
      },
      "id": "cmd-ffmpeg-001",
      "name": "FFmpeg\u5408\u6210\u89c6\u9891",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        2220,
        300
      ]
    }
  ],
  "connections": {
    "\u5b9a\u65f6\u89e6\u53d1": {
      "main": [
        [
          {
            "node": "\u6d4b\u8bd5\u6570\u636e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u6d4b\u8bd5\u6570\u636e": {
      "main": [
        [
          {
            "node": "\u51c6\u5907Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u51c6\u5907Prompt": {
      "main": [
        [
          {
            "node": "LLM\u751f\u6210\u811a\u672c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM\u751f\u6210\u811a\u672c": {
      "main": [
        [
          {
            "node": "\u89e3\u6790\u811a\u672c\u5e76\u62c6\u5206\u573a\u666f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u89e3\u6790\u811a\u672c\u5e76\u62c6\u5206\u573a\u666f": {
      "main": [
        [
          {
            "node": "\u751f\u6210\u573a\u666f\u56fe\u7247",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u751f\u6210\u573a\u666f\u56fe\u7247": {
      "main": [
        [
          {
            "node": "Sora\u56fe\u751f\u89c6\u9891",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sora\u56fe\u751f\u89c6\u9891": {
      "main": [
        [
          {
            "node": "\u751f\u6210\u65c1\u767d\u97f3\u9891",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u751f\u6210\u65c1\u767d\u97f3\u9891": {
      "main": [
        [
          {
            "node": "\u5408\u5e76\u6240\u6709\u573a\u666f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u5408\u5e76\u6240\u6709\u573a\u666f": {
      "main": [
        [
          {
            "node": "FFmpeg\u5408\u6210\u89c6\u9891",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 1,
  "updatedAt": "2026-01-14T00:00:00.000Z",
  "versionId": "1"
}