👉 n8n No Limits Access :

n8n auto-hébergé | automatisation sécurisée et évolutive

🔗 Link : Blotato

👇 Mes 100 formations n8n (coupon: YT20) : HERE

100 formations en marketing digital et Intelligence Artificielle

Download My Workflow (By Dr. Firas) :

Dr. Firas n8n Creator

youtube-blotato.png

Download Telegram

Telegram – a new era of messaging

Telegram credentials

Telegram credentials | n8n Docs

Parse Telegram Message

// Parse Telegram message
const messageText = $input.item.json.message.text;
const lines = messageText.split('\n');

// Extract first line as yt_url and second line as user_desc
const yt_url = lines[0] || '';
const user_desc = lines[1] || '';

// Return the parsed data
return {
  json: {
    yt_url: yt_url.trim(),
    user_desc: user_desc.trim()
  }
};

Get Video ID

// Extract video ID from YouTube URL
const url = $input.item.json.Url;

let videoId = null;

if (url) {
  // youtu.be format
  const youtuBeMatch = url.match(/youtu\.be\/([^?&]+)/);
  if (youtuBeMatch) {
    videoId = youtuBeMatch[1];
  } else {
    // youtube.com/watch?v=
    const youtubeMatch = url.match(/[?&]v=([^?&]+)/);
    if (youtubeMatch) {
      videoId = youtubeMatch[1];
    }
  }
}

return {
  json: {
    videoId
  }
};

YouTube Video Summarizer GPT AI