8
n8n 한국어amn8n.com

YouTube 새 동영상 → Slack에 링크 자동 게시

중급

이것은Social Media, Multimodal AI분야의자동화 워크플로우로, 6개의 노드를 포함합니다.주로 Code, Cron, Slack, HttpRequest 등의 노드를 사용하며. YouTube 동영상 알림을 Slack으로 자동 전송

사전 요구사항
  • Slack Bot Token 또는 Webhook URL
  • 대상 API의 인증 정보가 필요할 수 있음
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "name": "YouTube New Video → Auto-Post Link to Slack",
  "nodes": [
    {
      "id": "setup-instructions",
      "name": "설정 안내",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        80
      ],
      "parameters": {
        "width": 280,
        "height": 220,
        "content": "🎬 **SETUP REQUIRED:**\n\n1. **Get YouTube Channel RSS:**\n   - Go to channel → View Page Source\n   - Find: channel/UC[CHANNEL_ID]\n   - RSS URL: youtube.com/feeds/videos.xml?channel_id=[ID]\n   - Replace in HTTP Request node\n\n2. **Slack Connection:**\n   - Connect Slack OAuth\n   - Update channel in final node\n\n3. **Timing:**\n   - Runs every 30 minutes\n   - Adjust cron if needed\n\n✨ Tracks last video to avoid duplicates!"
      },
      "typeVersion": 1
    },
    {
      "id": "youtube-check-trigger",
      "name": "30분마다 확인",
      "type": "n8n-nodes-base.cron",
      "position": [
        200,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "*/30 * * * *"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fetch-youtube-rss",
      "name": "YouTube RSS 가져오기",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        400,
        300
      ],
      "parameters": {
        "url": "https://www.youtube.com/feeds/videos.xml?channel_id=YOUR_CHANNEL_ID_HERE",
        "options": {}
      },
      "typeVersion": 4.1
    },
    {
      "id": "parse-rss-data",
      "name": "RSS 분석 및 새 동영상 확인",
      "type": "n8n-nodes-base.code",
      "position": [
        600,
        300
      ],
      "parameters": {
        "jsCode": "// Parse YouTube RSS feed and extract video data\nconst rssData = $input.first().json;\nconst xmlContent = rssData;\n\n// Simple XML parsing for YouTube RSS\nconst entries = [];\nconst entryMatches = xmlContent.matchAll(/<entry[\\s\\S]*?<\\/entry>/g);\n\nfor (const match of entryMatches) {\n  const entry = match[0];\n  \n  // Extract video data using regex\n  const titleMatch = entry.match(/<title><!\\[CDATA\\[([^\\]]+)\\]\\]><\\/title>/);\n  const linkMatch = entry.match(/<link rel=\"alternate\" href=\"([^\"]+)\"\\/?>/);\n  const publishedMatch = entry.match(/<published>([^<]+)<\\/published>/);\n  const descriptionMatch = entry.match(/<media:description><!\\[CDATA\\[([^\\]]+)\\]\\]><\\/media:description>/);\n  const videoIdMatch = entry.match(/watch\\?v=([^&]+)/);\n  \n  if (titleMatch && linkMatch && publishedMatch) {\n    entries.push({\n      title: titleMatch[1],\n      link: linkMatch[1],\n      published: publishedMatch[1],\n      description: descriptionMatch ? descriptionMatch[1].substring(0, 200) + '...' : '',\n      video_id: videoIdMatch ? videoIdMatch[1] : '',\n      published_timestamp: new Date(publishedMatch[1]).getTime()\n    });\n  }\n}\n\n// Sort by publication date (newest first)\nentries.sort((a, b) => b.published_timestamp - a.published_timestamp);\n\n// Get the most recent video\nconst latestVideo = entries[0];\n\nif (!latestVideo) {\n  console.log('No videos found in RSS feed');\n  return null;\n}\n\n// Check if this video is new (published within last 2 hours)\nconst twoHoursAgo = Date.now() - (2 * 60 * 60 * 1000);\nconst isNewVideo = latestVideo.published_timestamp > twoHoursAgo;\n\nconst normalizedData = {\n  ...latestVideo,\n  is_new_video: isNewVideo,\n  channel_name: 'Your Channel', // Will be extracted from RSS in real implementation\n  formatted_date: new Date(latestVideo.published).toLocaleDateString()\n};\n\nconsole.log('Latest video data:', {\n  title: normalizedData.title,\n  published: normalizedData.formatted_date,\n  is_new: normalizedData.is_new_video\n});\n\n// Only proceed if it's a new video\nif (!isNewVideo) {\n  console.log('No new videos to announce');\n  return null;\n}\n\nreturn {\n  json: normalizedData\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "format-slack-message",
      "name": "Slack 메시지 포맷팅",
      "type": "n8n-nodes-base.code",
      "position": [
        800,
        300
      ],
      "parameters": {
        "jsCode": "// Format video announcement for Slack\nconst video = $input.first().json;\n\n// Create rich Slack message\nconst slackMessage = {\n  text: `🎬 New Video Alert!`,\n  channel: '#general', // Change to your preferred channel\n  username: 'YouTube Bot',\n  icon_emoji: ':tv:',\n  blocks: [\n    {\n      \"type\": \"section\",\n      \"text\": {\n        \"type\": \"mrkdwn\",\n        \"text\": `🎬 *New Video Published!*\\n\\n*${video.title}*\\n\\n📅 Published: ${video.formatted_date}\\n\\n${video.description}`\n      }\n    },\n    {\n      \"type\": \"actions\",\n      \"elements\": [\n        {\n          \"type\": \"button\",\n          \"text\": {\n            \"type\": \"plain_text\",\n            \"text\": \"🎥 Watch Now\",\n            \"emoji\": true\n          },\n          \"url\": video.link,\n          \"style\": \"primary\"\n        }\n      ]\n    },\n    {\n      \"type\": \"context\",\n      \"elements\": [\n        {\n          \"type\": \"mrkdwn\",\n          \"text\": `📺 ${video.channel_name} | 🔗 <${video.link}|${video.video_id}>`\n        }\n      ]\n    }\n  ]\n};\n\nconsole.log('Formatted Slack message for video:', video.title);\n\nreturn {\n  json: slackMessage\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "post-to-slack",
      "name": "Slack에 게시",
      "type": "n8n-nodes-base.slack",
      "position": [
        1000,
        300
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "channel": "={{ $json.channel }}",
        "resource": "message",
        "operation": "post",
        "otherOptions": {
          "blocks": "={{ JSON.stringify($json.blocks) }}",
          "username": "={{ $json.username }}",
          "icon_emoji": "={{ $json.icon_emoji }}"
        },
        "authentication": "oAuth2"
      },
      "typeVersion": 2.1
    }
  ],
  "active": true,
  "settings": {
    "timezone": "UTC"
  },
  "versionId": "1",
  "connections": {
    "fetch-youtube-rss": {
      "main": [
        [
          {
            "node": "parse-rss-data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "format-slack-message": {
      "main": [
        [
          {
            "node": "post-to-slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "youtube-check-trigger": {
      "main": [
        [
          {
            "node": "fetch-youtube-rss",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "parse-rss-data": {
      "main": [
        [
          {
            "node": "format-slack-message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

중급 - 소셜 미디어, 멀티모달 AI

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
중급
노드 수6
카테고리2
노드 유형5
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

저자
David Olusola

David Olusola

@dae221

I help ambitious businesses eliminate operational bottlenecks and scale faster with AI automation. My clients typically see 40-60% efficiency gains within 90 days. Currently accepting 3 new projects this quarter - david@daexai.com

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34