Automatically process poker videos from Airtable - downloads, transcribes, extracts insights, and updates records.
- Polls Airtable every 5 minutes for videos with Status = "Raw"
- Downloads videos from YouTube, Google Drive, or direct URLs
- Extracts audio using ffmpeg
- Transcribes using OpenAI Whisper
- Extracts insights using GPT-4:
- Key quotes (tweetable)
- Core poker philosophy
- Updates Airtable with results and sets Status = "Extracted"
- Python 3.11+
- ffmpeg (for audio extraction)
- Airtable Personal Access Token (with read/write access)
- OpenAI API Key (for transcription and insights)
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install packages
pip install -r requirements.txtCopy .env.example to .env and fill in your credentials:
cp .env.example .envEdit .env:
AIRTABLE_API_KEY=your_personal_access_token
AIRTABLE_BASE_ID=appd81rBXhVWHn2xu
AIRTABLE_TABLE_ID=tblCnNsHMyGjXCXL6
OPENAI_API_KEY=your_openai_api_key
POLL_INTERVAL_SECONDS=300
Continuous mode (runs forever, checking every 5 minutes):
cd src
python main.pyOne-shot mode (process once and exit):
cd src
python main.py --onceRailway is a simple platform for hosting Python services. Free tier available.
npm install -g @railway/clirailway login
railway initrailway variables set AIRTABLE_API_KEY=your_token
railway variables set AIRTABLE_BASE_ID=appd81rBXhVWHn2xu
railway variables set AIRTABLE_TABLE_ID=tblCnNsHMyGjXCXL6
railway variables set OPENAI_API_KEY=your_key
railway variables set POLL_INTERVAL_SECONDS=300Create a file named Procfile in the root directory:
worker: cd src && python main.py
railway upYour service will now run 24/7 in the cloud!
- Go to your Airtable "Master Content Library"
- Create a new record:
- Content Title: "My Poker Strategy Video"
- Source File/Link: https://youtube.com/watch?v=...
- Status: "Raw"
- Content Type: "Video"
- Wait 5 minutes (or run
python main.py --once) - Check the record - it will be updated with:
- Transcription in "Core Philosophy" field
- Key quotes in "Key Quotes" field
- Status changed to "Extracted"
poker-video-processor/
├── src/
│ ├── main.py # Main service orchestrator
│ ├── video_processor.py # Video download, transcription, insights
│ └── airtable_client.py # Airtable integration
├── downloads/ # Temporary video/audio storage
├── logs/ # Service logs
├── .env # Your credentials (DO NOT COMMIT)
├── .env.example # Template for credentials
├── requirements.txt # Python dependencies
└── README.md # This file
Make sure you're in the virtual environment:
source venv/bin/activateInstall ffmpeg:
- Mac:
brew install ffmpeg - Ubuntu:
sudo apt install ffmpeg - Windows: Download from https://ffmpeg.org/
- Check your Personal Access Token has correct scopes:
data.records:readdata.records:writeschema.bases:read
- Verify Base ID and Table ID are correct
- Check logs in
logs/processor.log - Verify video URL is accessible
- Make sure Status is exactly "Raw" (case-sensitive)
Edit .env:
POLL_INTERVAL_SECONDS=600 # Check every 10 minutes
Edit src/video_processor.py, method _extract_insights():
- Change the prompt
- Add more fields
- Use different AI models
Edit src/airtable_client.py to handle additional statuses like "Published", "Monetized", etc.
OpenAI API Costs (per video):
- Whisper transcription: ~$0.006 per minute of audio
- GPT-4 Mini insights: ~$0.01 per video
- Total: ~$0.05 per 5-minute video
Railway Hosting:
- Free tier: $5 credit/month (plenty for this service)
- Paid: $5/month for 24/7 uptime
- Test locally with one video
- Deploy to Railway for 24/7 automation
- Build Workflow 2: Content Derivative Generator
- Add social media distribution
- Track performance metrics
Check logs first:
tail -f logs/processor.logCommon issues are usually:
- Missing credentials
- Wrong Airtable field names
- Video URL not accessible
Built with ❤️ for poker content creators