An end-to-end Python pipeline that automatically fetches videos from a YouTube playlist, transcribes them using AWS Transcribe, generates structured insights using AWS Bedrock (Claude 3 Sonnet), and stores everything in AWS S3 and DynamoDB. Includes a speech generation module that analyses a speaker's communication style from transcripts and generates contextually relevant speeches using real-time financial data.
Employees at a financial services firm couldn't access YouTube due to company security restrictions, yet needed to stay updated with the Managing Director's video content. Watching full 1-hour videos was impractical. This pipeline automates the entire process: fetching, transcribing and summarising videos into 5-minute insight reports, and extends further to auto-generate speeches in the MD's style.
- Fetches all videos from a YouTube playlist automatically
- Downloads and converts audio using yt-dlp and ffmpeg
- Transcribes audio using AWS Transcribe with custom domain vocabulary for improved accuracy
- Avoids reprocessing using DynamoDB to track processed video IDs
- Generates structured JSON insights (summary, action items, follow-ups) using Claude 3 Sonnet via AWS Bedrock
- Analyses speaker communication style from transcripts
- Generates contextually relevant speeches using real-time Nifty market data and financial news headlines
youtube-insights-pipeline/ ├── youtube_transcripts.py ← main pipeline: fetch, transcribe, generate insights ├── speech_pipeline.py ← speaking style analysis and speech generation ├── requirements.txt ← Python dependencies ├── .env.example ← environment variables template └── README.md
Install ffmpeg before running:
- Mac:
brew install ffmpeg - Windows: Download from https://ffmpeg.org/download.html and add to PATH
- Linux:
sudo apt install ffmpeg
pip install -r requirements.txtCopy .env.example to .env and fill in your credentials:
cp .env.example .env| Variable | Description |
|---|---|
YOUTUBE_API_KEY |
YouTube Data API v3 key from Google Cloud Console |
PLAYLIST_ID |
YouTube playlist ID to process |
S3_BUCKET_NAME |
AWS S3 bucket name for storing files |
DYNAMODB_TABLE_NAME |
DynamoDB table name for tracking processed videos |
AWS_REGION |
AWS region (e.g. ap-south-1) |
AWS_ACCESS_KEY_ID |
AWS access key |
AWS_SECRET_ACCESS_KEY |
AWS secret key |
Your IAM user needs the following policies:
AmazonS3FullAccessAmazonDynamoDBFullAccessAmazonTranscribeFullAccessAmazonBedrockFullAccess
# Run the main pipeline
python youtube_transcripts.py
# Run the speech generation pipeline
python speech_pipeline.py- Fetches all videos from the configured YouTube playlist
- Checks DynamoDB to skip already processed videos
- Downloads audio using yt-dlp and converts to MP3 via ffmpeg
- Uploads audio to S3 and starts an AWS Transcribe job with custom vocabulary
- Once transcription completes, sends transcript to Claude 3 Sonnet via Bedrock
- Saves structured JSON insights (transcript, summary, action items, follow-ups) back to S3
- Marks video as processed in DynamoDB
- Loads all transcripts from local storage
- Analyses the speaker's communication style using Claude 3 Sonnet
- Fetches real-time Nifty market data and financial news headlines
- Generates a contextually relevant speech in the speaker's style
- Uploads the generated speech directly to S3
- This project requires active AWS credentials and a YouTube Data API key to run
- YouTube blocks API requests from cloud services (Lambda, EC2), so the pipeline is designed to run locally
- The custom vocabulary in AWS Transcribe significantly improves accuracy for domain-specific financial terminology
Python, AWS S3, AWS Transcribe, AWS Bedrock, AWS DynamoDB, Claude 3 Sonnet, YouTube Data API v3, yt-dlp, ffmpeg, yfinance, BeautifulSoup
