{
  "name": "Video to Shorts Everywhere",
  "nodes": [
    {
      "id": "1",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ],
      "parameters": {
        "httpMethod": "POST",
        "path": "youtube-to-shorts"
      }
    },
    {
      "id": "2",
      "name": "Get Timestamps (OpenAI)",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        500,
        300
      ],
      "parameters": {
        "resource": "completion",
        "model": "gpt-4o-mini",
        "prompt": "Bu videodan 5 tane 30-60 saniyelik shorts i\u00e7in timestamp \u00f6ner. Format: {start: saniye, end: saniye}"
      },
      "credentials": {
        "openAiApi": "<your credential>"
      }
    },
    {
      "id": "3",
      "name": "Split In Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 1,
      "position": [
        750,
        300
      ],
      "parameters": {
        "batchSize": 1
      }
    },
    {
      "id": "4",
      "name": "Cut Video (FFmpeg)",
      "type": "n8n-nodes-base.executeCommand",
      "typeVersion": 1,
      "position": [
        1000,
        300
      ],
      "parameters": {
        "command": "ffmpeg -i {{$json[\"videoUrl\"]}} -ss {{$json[\"start\"]}} -to {{$json[\"end\"]}} -c copy short-{{$json[\"start\"]}}.mp4"
      }
    },
    {
      "id": "5",
      "name": "Upload to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 1,
      "position": [
        1250,
        300
      ],
      "parameters": {
        "operation": "upload",
        "binaryData": true,
        "fileName": "short-{{$json[\"start\"]}}.mp4"
      },
      "credentials": {
        "googleDriveOAuth2Api": "<your credential>"
      }
    },
    {
      "id": "6",
      "name": "Upload to YouTube Shorts",
      "type": "n8n-nodes-base.youtube",
      "typeVersion": 1,
      "position": [
        1500,
        200
      ],
      "parameters": {
        "resource": "video",
        "operation": "upload",
        "title": "Shorts Clip",
        "description": "Auto generated from long video",
        "categoryId": "22",
        "tags": [
          "shorts",
          "automation"
        ],
        "binaryProperty": "data"
      },
      "credentials": {
        "youtubeOAuth2Api": "<your credential>"
      }
    },
    {
      "id": "7",
      "name": "Upload to Instagram Reels",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        1500,
        300
      ],
      "parameters": {
        "method": "POST",
        "url": "https://graph.facebook.com/v20.0/{instagram_business_account_id}/media",
        "sendBinaryData": true,
        "binaryPropertyName": "data",
        "queryParametersUi": {
          "parameter": [
            {
              "name": "access_token",
              "value": "YOUR_META_ACCESS_TOKEN"
            },
            {
              "name": "media_type",
              "value": "VIDEO"
            }
          ]
        }
      }
    },
    {
      "id": "8",
      "name": "Upload to TikTok",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        1500,
        400
      ],
      "parameters": {
        "method": "POST",
        "url": "https://open-api.tiktokglobalshop.com/video/upload",
        "sendBinaryData": true,
        "binaryPropertyName": "data",
        "queryParametersUi": {
          "parameter": [
            {
              "name": "access_token",
              "value": "YOUR_TIKTOK_ACCESS_TOKEN"
            }
          ]
        }
      }
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Get Timestamps (OpenAI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Timestamps (OpenAI)": {
      "main": [
        [
          {
            "node": "Split In Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split In Batches": {
      "main": [
        [
          {
            "node": "Cut Video (FFmpeg)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cut Video (FFmpeg)": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive": {
      "main": [
        {
          "node": "Upload to YouTube Shorts",
          "type": "main",
          "index": 0
        },
        {
          "node": "Upload to Instagram Reels",
          "type": "main",
          "index": 0
        },
        {
          "node": "Upload to TikTok",
          "type": "main",
          "index": 0
        }
      ]
    }
  }
}