ME4-YOUTUBE
YouTube Content Extraction Service for the ME4 suite, enabling download, metadata, transcripts, and comments via MCP, HTTP, and ZMQ interfaces.
README
ME4-YouTube
π§ Standards: Dieses Projekt folgt den ME4-Service-Bus-Standards v1.0.
π Verbindlich: HUB-Thought im openBrain β die Single source of truth.
β οΈ Abweichungen MΓSSEN in einem PR begrΓΌndet werden.
Service-ID:
ME4-YOUTUBE
Version: 1.0.0
Schnittstellen: MCP (stdio + ZMQ REQ/REP) + HTTP/REST + WSSP-15 + Framie-UI
YouTube Content Extraction Service fΓΌr die ME4-Suite:
- Download β Video- und Audio-Download via
yt-dlp - Beschreibung β VollstΓ€ndige Metadaten inkl. Description
- Transkript β Manuell oder Auto-Generated, Multi-Language
- Kommentare β Top-Kommentare via
yt-dlp - Loadbalancer-MCP β Parallele Worker-Instanzen mit Health-Monitoring
- Framie-UI β Embedded Live-Status-Display
Schnellstart
# Voraussetzungen: Python 3.11+, ffmpeg (optional, fΓΌr Audio-Konvertierung)
# Klonen / Installieren
cd D:\Entwicklung\ME4-YouTube
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS/Linux
pip install -r requirements.txt
# Konfiguration (Beispiel kopieren, anpassen)
copy .env.example .env # Windows
# cp .env.example .env # macOS/Linux
# Starten
python main.py
# ODER (ΓΆffnet Framie-UI nicht automatisch)
python main.py --no-browser
Beim Start ΓΆffnet sich automatisch die Framie-UI im Browser unter http://localhost:8770/ui/index.html.
Schnittstellen
| Schnittstelle | Port | Zweck |
|---|---|---|
| HTTP / REST | 8770 |
Browser, Menschen, externe Tools |
| ZMQ Main | 5570 |
MCP-Service-Endpoint |
| ZMQ Loadbalancer | 5571 |
MCP-Loadbalancer (parallele Worker) |
| WSSP-15 | 5690 |
Heartbeat / Telemetrie |
| Worker-Pool | 8771+ |
N parallele Worker-Instanzen (default: 2) |
MCP-Tools (ZMQ + stdio)
| Tool | Beschreibung | Auth |
|---|---|---|
ping |
Service-Health | public |
get_manifest |
UI-Manifest fΓΌr Cockpit | public |
health |
Detaillierter Status inkl. Worker-Pool | public |
get_status_snapshot |
Live-Job-Status | public |
get_metadata |
YouTube Metadaten + Description | π |
get_transcript |
YouTube Transkript | π |
get_comments |
YouTube Top-Kommentare | π |
download |
Video/Audio herunterladen | π |
process |
Komplette Pipeline (alle 4 Features) | π |
trigger_sm_produce |
SM-Producer anstoΓen | π |
shutdown |
Geordneter Shutdown | π |
HTTP-Endpunkte
| Pfad | Methode | Beschreibung |
|---|---|---|
/ |
GET | Service-Info |
/docs |
GET | OpenAPI/Swagger UI |
/api/health |
GET | Health (public) |
/api/manifest |
GET | UI-Manifest (public) |
/api/status |
GET | Live-Job-Status (public) |
/api/framie/stream |
GET | SSE-Stream fΓΌr Framie-UI (public) |
/api/process |
POST | Komplette Verarbeitung (π) |
/api/metadata |
POST | Nur Metadaten (π) |
/api/transcript |
POST | Nur Transkript (π) |
/api/comments |
POST | Nur Kommentare (π) |
/api/download |
POST | Video-Download (π) |
/api/sm-produce |
POST | SM-Producer triggern (π) |
/ui/index.html |
GET | Framie Live-Status-Display |
π = X-API-Key Header erforderlich (oder Dev-Mode wenn API_KEY="")
Beispiele
HTTP (curl)
# Metadaten + Beschreibung
curl -X POST http://localhost:8770/api/metadata \
-H "X-API-Key: ob-youtube-key-2026" \
-H "Content-Type: application/json" \
-d '{"url":"https://youtu.be/dQw4w9WgXcQ"}'
# Komplette Verarbeitung (alle Features)
curl -X POST http://localhost:8770/api/process \
-H "X-API-Key: ob-youtube-key-2026" \
-H "Content-Type: application/json" \
-d '{
"url":"https://youtu.be/dQw4w9WgXcQ",
"download":false,
"include_description":true,
"include_transcript":true,
"include_comments":true,
"language":"de",
"max_comments":100
}'
ZMQ (Python)
import zmq, json
ctx = zmq.Context()
sock = ctx.socket(zmq.REQ)
sock.connect("tcp://127.0.0.1:5570")
sock.send_json({
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "process",
"arguments": {
"url": "https://youtu.be/dQw4w9WgXcQ",
"api_key": "ob-youtube-key-2026",
}
}
})
print(sock.recv_json())
MCP stdio (Claude Code / Agenten)
{
"mcpServers": {
"me4-youtube": {
"command": "python",
"args": ["D:/Entwicklung/ME4-YouTube/main.py", "--mcp-stdio"]
}
}
}
Loadbalancer-MCP (parallele Verarbeitung)
Der Service bringt einen eingebauten Loadbalancer-MCP mit. Agenten kΓΆnnen Jobs direkt an den Loadbalancer schicken, der sie auf freie Worker verteilt:
sock.connect("tcp://127.0.0.1:5571")
sock.send_json({
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "process",
"arguments": {
"url": "https://youtu.be/dQw4w9WgXcQ",
"api_key": "ob-youtube-key-2026",
}
}
})
Strategien: round_robin, least_loaded, random (default: least_loaded)
SM-Producer Anbindung
Der Service kann direkt die SM-Producer-Pipeline (ME4-SMproducer-3) anstoΓen:
curl -X POST http://localhost:8770/api/sm-produce \
-H "X-API-Key: ob-youtube-key-2026" \
-H "Content-Type: application/json" \
-d '{
"url":"https://youtu.be/dQw4w9WgXcQ",
"transcript":"Volltext...",
"language":"de",
"workflow":"default"
}'
Der Aufruf wird an http://localhost:3001/api/sm-produce weitergeleitet.
Konfiguration via SM_PRODUCER_URL und SM_PRODUCER_API_KEY in .env.
Framie-UI
Beim Start des Services ΓΆffnet sich automatisch die Framie-UI im Browser:
- KPIs: aktive Jobs, erledigt, Fehler, Worker-Status
- Live-Stream ΓΌber Server-Sent Events
- Worker-Liste mit Idle/Busy/Down-Status
- Letzte 15 Jobs in Tabelle
- Event-Log
URL: http://localhost:8770/ui/index.html
Tests
pip install pytest pytest-asyncio
pytest
# Mit Coverage
pip install pytest-cov
pytest --cov=app --cov-report=term-missing
Konfiguration (.env)
Siehe .env.example fΓΌr alle Optionen.
Wichtige Variablen:
API_KEYβ API-Key (leer = Dev-Mode)WORKER_COUNTβ Anzahl paralleler Worker (default: 2)LOADBALANCER_STRATEGYβround_robin|least_loaded|randomSM_PRODUCER_URLβ SM-Producer-Pipeline-URLDOWNLOAD_DIRβ Zielordner fΓΌr Downloads
Schnittstellen-Standard
Konform zu MCP_ZMQ_STANDARD.md:
- ZMQ REQ/REP mit JSON-RPC 2.0
- WSSP-15 Heartbeat
- API-Key Auth
- UI-Manifest
- Standard-Tools (
ping,get_manifest,health,shutdown)
Architektur
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ME4-YouTube (Service-ID: ME4-YOUTUBE) β
β β
β ββββββββββββββββββ βββββββββββββββββββ β
β β HTTP API β β ZMQ Main β β
β β :8770 β β :5570 β β
β β + Framie-UI β β MCP REQ/REP β β
β ββββββββββ¬ββββββββ ββββββββββ¬βββββββββ β
β β β β
β βββββββββββ¬ββββββββββ β
β βΌ β
β βββββββββββββββββββββββ β
β β WorkerPool β β
β β (Load-Balancer) β β
β β ZMQ :5571 ββββββ Loadbalancer-MCP β
β βββββββββββ¬ββββββββββββ β
β β β
β βββββββββββββΌββββββββββββ β
β βΌ βΌ βΌ β
β βββββββββββ βββββββββββ βββββββββββ β
β βworker-01β βworker-02β βworker-03β (jeweils β
β β :8771 β β :8772 β β :8773 β Orchestrator) β
β βββββββββββ βββββββββββ βββββββββββ β
β β
β ββββββββββββββββββ βββββββββββββββββββ β
β β WSSP-15 :5690 β β SM-Producer β β
β β Heartbeat β β HTTP :3001 β β
β ββββββββββββββββββ βββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Jeder Worker hat:
- eigenen HTTP-Server (fΓΌr eingehende Jobs vom Loadbalancer)
- einen
Orchestrator(fΓΌhrt die Pipeline aus) - Status-Updates landen im globalen
StatusTrackerβ Framie-Stream
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.