Promoción de videos nuevos de un canal de YouTube
Partiendo de una consulta de los feeds de un canal de YouTube, crea una promoción y distribuye el enlace de los videos recientes.
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
APIRequest-pvhfg[Consulta feeds de un canal de Youtube]
style APIRequest-pvhfg stroke:#a170ff
ParseData-7xzz7[<div><img src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>Extraer el resultado XML]
style ParseData-7xzz7 stroke:#a170ff
JSONtoData-iw9ps[<div><img src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>JSON to Data]
style JSONtoData-iw9ps stroke:#a170ff
JSONtoData-qcvd4[<div><img src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>JSON to Data2]
style JSONtoData-qcvd4 stroke:#a170ff
ParseData-mmbzq[<div><img src="/_astro/braces.Djq0PW4_.svg" style="height: 20px !important;width: 20px !important"/></div>extrae nuevas publicaciones]
style ParseData-mmbzq stroke:#a170ff
LanggraphDatabatchAgent-0gmtm[Data batch Agent]
style LanggraphDatabatchAgent-0gmtm stroke:#a170ff
youtube_transcripts-7xaub[YouTube Transcripts]
style youtube_transcripts-7xaub stroke:#a170ff
OpenAIModel-tzflz[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>Análisis del xml]
style OpenAIModel-tzflz stroke:#a170ff
OpenAIModel-i2iir[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI2]
style OpenAIModel-i2iir stroke:#a170ff
TelegramMessage-elf5b[Telegram Message2]
style TelegramMessage-elf5b stroke:#a170ff
AdvancedAgent-pyhhs[Generador de publicidad]
style AdvancedAgent-pyhhs stroke:#a170ff
APIRequest-pvhfg -.- ParseData-7xzz7
linkStyle 0 stroke:#a170ff
JSONtoData-iw9ps -.- ParseData-mmbzq
linkStyle 1 stroke:#a170ff
ParseData-mmbzq -.- JSONtoData-qcvd4
linkStyle 2 stroke:#a170ff
JSONtoData-qcvd4 -.- LanggraphDatabatchAgent-0gmtm
linkStyle 3 stroke:#a170ff
ParseData-7xzz7 -.- OpenAIModel-tzflz
linkStyle 4 stroke:#a170ff
OpenAIModel-tzflz -.- JSONtoData-iw9ps
linkStyle 5 stroke:#a170ff
AdvancedAgent-pyhhs -.- LanggraphDatabatchAgent-0gmtm
linkStyle 6 stroke:#a170ff
youtube_transcripts-7xaub -.- AdvancedAgent-pyhhs
linkStyle 7 stroke:#a170ff
TelegramMessage-elf5b -.- AdvancedAgent-pyhhs
linkStyle 8 stroke:#a170ff
OpenAIModel-i2iir -.- AdvancedAgent-pyhhs
linkStyle 9 stroke:#a170ff
New Video Promotion from a YouTube Channel
🧩 General Description
Starting from an RSS feed query of a YouTube channel, creates a personalized promotion and distributes the link of recent videos automatically. The system queries the channel's RSS feed, uses artificial intelligence to identify videos published in the last 24 hours, temporally classifies all publications, processes each new video in parallel to obtain its transcription translated to Spanish, generates inspiring summaries under 200 words, and distributes personalized promotions via Telegram, all in a fully automated workflow.
⚙️ Main Features
- Automatic RSS feed query from YouTube channel
- Intelligent AI analysis to detect new videos (last 24 hours)
- Temporal classification: NEW (0-24h), RECENT (24-48h), OLD (>48h)
- Obtaining video transcriptions translated to Spanish
- Generation of inspiring summaries under 200 words with motivational tone
- Automatic promotion distribution via Telegram
- Parallel processing of multiple videos (up to 5 simultaneous)
- Automatic detection of publication date and age calculation
- Structured format for promotional messages
🔄 Workflow Steps
| Component Name | Role | Inputs | Outputs |
|---|---|---|---|
| Feed Query | Obtains channel RSS | YouTube feed URL | XML with complete video list |
| Extract XML | Extracts feed content | API response | Raw XML text |
| XML Analysis | Analyzes and classifies videos | RSS structure XML feed | JSON with temporal video classification |
| Convert to Data | Transforms analysis JSON | Complete analysis JSON text | Structured data object |
| Extract New Publications | Filters only recent videos | Complete analysis data | Array with only publicaciones_nuevas |
| Convert to List | Prepares for batch processing | New publications JSON | List of individual video objects |
| Batch Agent | Distributes parallel processing | List of new videos | Coordinates up to 5 simultaneous videos |
| YouTube Transcriptions | Obtains video content | Video URL | Transcription translated to Spanish |
| Advertising Generator | Creates promotional summary | Transcription and video data | Inspiring summary under 200 words |
| Telegram Message | Distributes promotion | Summary, URL, date | Message sent to channel |
| OpenAI Analysis Model | Processes XML and detects new videos | RSS feed XML | JSON with classification and metadata |
| OpenAI Summary Model | Generates promotional content | System prompt and transcription | Summary text for Telegram |
🧠 Notes
- The system monitors the SET India channel (ID: UCAOgCnzXLTbaD-xSrVRDzOg) but can be configured for any channel
- To obtain the channel ID: go to the channel page → View source code → search for "channel_id"
- Analysis with OpenAI GPT-3.5-turbo uses temperature 0.1 for consistent responses
- The analysis System Prompt is "# RSS FEED ANALYSIS - NEW PUBLICATION DETECTION"
- Transcriptions are automatically translated to Spanish (translation_language: "es")
- Summaries are designed to be inspiring, interesting and make the user feel special
- Promotions are sent to the Telegram chat with ID 5632001849
- Parallel processing allows handling up to 5 videos simultaneously (max_concurrency: 5)
- Message format includes: [Incentive] + "Publication date: [date]" + "Watch it here: [URL]"
- Analysis JSON contains: estado_analisis, total_publicaciones, nuevas_24h, publicaciones_nuevas[], ultima_publicacion
- Each video in publicaciones_nuevas includes: video_id, titulo, publicado, hace_horas, url
- Uses two AI models: one for RSS feed analysis (temporal detection) and another for summary generation (creativity)
- RSS URL follows the format: https://www.youtube.com/feeds/videos.xml?channel_id={CHANNEL_ID}
- Label components document: channel_id retrieval, detection flow, data transformations, batch agent architecture
- The system is ideal for content creators who need to automatically promote each new publication