{
  "name": "Vorlux AI | YouTube Video Sync",
  "nodes": [
    {
      "id": "64743425-4ea9-467c-a570-337a093bb070",
      "name": "YT RSS",
      "type": "n8n-nodes-base.rssFeedReadTrigger",
      "typeVersion": 1,
      "position": [
        220,
        300
      ],
      "parameters": {
        "feedUrl": "https://www.youtube.com/feeds/videos.xml?channel_id={{$env.YOUTUBE_CHANNEL_ID}}",
        "pollTimes": {
          "item": [
            {
              "mode": "everyHour"
            }
          ]
        }
      }
    },
    {
      "id": "93acdc47-61a4-420f-ac91-87e5a6e40370",
      "name": "Parse",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        460,
        300
      ],
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const items=$input.all();return items.map(i=>{const j=i.json;const vid=(j.id||'').split(':').pop();return {json:{videoId:vid,title:j.title,url:j.link,thumbnail:'https://img.youtube.com/vi/'+vid+'/hqdefault.jpg'}};});"
      }
    },
    {
      "id": "6d841524-7162-4eea-8add-29bfdb02c57c",
      "name": "Save",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        700,
        200
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.VORLUX_HUB_URL}}/api/blog/videos",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json) }}",
        "options": {
          "timeout": 15000
        }
      }
    },
    {
      "id": "e5fdd073-4abc-4d44-a070-33171204c5ef",
      "name": "Discord",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        700,
        400
      ],
      "parameters": {
        "method": "POST",
        "url": "={{$env.DISCORD_CONTENT_WEBHOOK}}",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"embeds\":[{\"title\":\"{{ $json.title }}\",\"url\":\"{{ $json.url }}\",\"image\":{\"url\":\"{{ $json.thumbnail }}\"},\"color\":16711680}]}",
        "options": {
          "timeout": 10000
        }
      }
    }
  ],
  "connections": {
    "YT RSS": {
      "main": [
        [
          {
            "node": "Parse",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse": {
      "main": [
        [
          {
            "node": "Save",
            "type": "main",
            "index": 0
          },
          {
            "node": "Discord",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "saveExecutionProgress": true
  }
}