Skip to content

protny/poker_exploit_researcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poker Exploit Video Analyzer

Automatically extract poker exploit opportunities from YouTube instructional videos using AI vision analysis.

Features

  • 🎥 Downloads YouTube poker videos automatically
  • 📝 Extracts transcripts/captions with timestamps
  • 🖼️ Extracts video frames at configurable intervals
  • 🤖 AI-powered analysis (OpenAI GPT-4o or Google Gemini)
  • 📊 Structured output with timestamps, situations, and strategies
  • 🔄 Batch processing support for multiple videos
  • 🎯 Customizable screenshot intervals

Installation

Prerequisites

  • Python 3.9 or higher
  • ffmpeg (for video processing)

Setup

  1. Clone the repository
git clone https://github.com/protny/poker_exploit_researcher.git
cd poker_exploit_researcher
  1. Install Python dependencies
pip install -r requirements.txt
  1. Install ffmpeg (if not already installed)

Ubuntu/Debian:

sudo apt update
sudo apt install ffmpeg

macOS:

brew install ffmpeg

Windows: Download from https://ffmpeg.org/download.html

  1. Configure API keys

Copy the example environment file:

cp .env.example .env

Edit .env and add your API key:

For OpenAI (GPT-4o):

OPENAI_API_KEY=sk-your-api-key-here
AI_PROVIDER=openai
OPENAI_MODEL=gpt-4o

For Google Gemini:

GEMINI_API_KEY=your-gemini-api-key-here
AI_PROVIDER=gemini
GEMINI_MODEL=gemini-2.0-flash-exp

Get API Keys:

Usage

Analyze a Single Video

python main.py --url "https://www.youtube.com/watch?v=KHAAW2iFiHY"

Analyze Multiple Videos

  1. Add video URLs to input_videos.txt (one per line)
  2. Run:
python main.py --list input_videos.txt

Custom Screenshot Interval

# Extract frames every 10 seconds instead of default 5
python main.py --url "https://www.youtube.com/watch?v=..." --interval 10

Keep Temporary Files (for debugging)

python main.py --url "..." --no-cleanup

Output Format

Each video generates a .txt file named {video_id}.txt in data/outputs/:

================================================================================
POKER EXPLOIT ANALYSIS REPORT
================================================================================

Video ID: KHAAW2iFiHY
Analysis Date: 2025-01-13 15:30:00
Total Exploits Found: 5

EXPLOIT #1
================================================================================

TIMESTAMP: 02:15 (135.00s)

SITUATION:
  UTG opens 3bb, Hero is on BTN with AQs, facing a 3-bet from SB

PLAYER TYPE:
  Tight passive player who rarely 3-bets without premium hands

WHY IT'S EXPLOITABLE:
  Tight players show extreme strength with 3-bets from SB, usually AA-QQ, AK

COUNTER-STRATEGY:
  Fold AQ unless you have strong reads. Against this player type, 4-betting
  as a bluff is -EV

CONFIDENCE: HIGH

Configuration

Screenshot Interval

Adjust in .env:

SCREENSHOT_INTERVAL=5  # seconds between frames

Or use command line:

python main.py --url "..." --interval 10

Recommended intervals:

  • 5 seconds: Detailed analysis, higher AI costs
  • 10 seconds: Balanced approach
  • 15-30 seconds: Quick overview, lower costs

Cleanup Settings

Edit config/config.yaml:

cleanup:
  remove_videos: true    # delete downloaded videos
  remove_frames: true    # delete extracted frames
  keep_transcripts: true # keep transcripts

Project Structure

poker_exploit_researcher/
├── main.py                  # Main entry point
├── requirements.txt         # Python dependencies
├── .env.example            # Environment variables template
├── input_videos.txt        # List of videos to process
├── config/
│   └── config.yaml         # Configuration settings
├── src/                    # Source code modules
│   ├── downloader.py       # YouTube video download
│   ├── frame_extractor.py  # Frame extraction
│   ├── analyzer.py         # AI analysis
│   ├── output_writer.py    # Output formatting
│   ├── exploit_deduplicator.py        # Deduplication logic
│   ├── exploit_dedup_simple.py        # Time-based deduplication
│   └── semantic_dedup.py              # AI semantic deduplication
├── docs/                   # Documentation
│   ├── setup/             # Getting started guides
│   ├── guides/            # Usage & optimization guides
│   ├── troubleshooting/   # Problem-solving guides
│   └── planning/          # Planning & historical docs
└── data/
    ├── videos/            # Downloaded videos (temp)
    ├── frames/            # Extracted frames (temp)
    ├── transcripts/       # Video transcripts
    └── outputs/           # Final exploit reports

Cost Estimation

OpenAI GPT-4o

  • ~$0.20-$0.40 per 10-minute video (5-second intervals)
  • ~$20-$40 for 100 videos

Google Gemini

  • ~$0.10-$0.20 per 10-minute video (5-second intervals)
  • ~$10-$20 for 100 videos

Tip: Start with longer intervals (15-30s) to reduce costs during testing.

Troubleshooting

No transcript available

Some videos don't have captions. The analyzer will still work using only visual data, but quality may be reduced.

FFmpeg not found

Ensure ffmpeg is installed and in your PATH:

ffmpeg -version

API rate limits

If you hit rate limits:

  1. Reduce screenshot interval (process fewer frames)
  2. Add delays between API calls in src/analyzer.py
  3. Use batch processing with delays between videos

Out of memory

For long videos:

  1. Increase screenshot interval
  2. Reduce frame quality in config/config.yaml
  3. Enable cleanup to remove processed frames

Documentation

Comprehensive documentation is available in the docs/ directory:

📚 Getting Started

📖 Guides & Optimization

🔧 Troubleshooting

📋 Project Information

Development

Run Individual Modules

Test downloader:

python src/downloader.py

Test frame extractor:

python src/frame_extractor.py

Test output writer:

python src/output_writer.py

Contributing

Contributions welcome! Please open an issue or PR.

License

MIT License - see LICENSE file for details

Disclaimer

This tool uses AI to analyze poker content and should be used for educational purposes. Always verify AI-generated insights with human poker expertise. The quality of analysis depends on video quality, transcript availability, and AI model capabilities.

Credits

Inspired by similar poker video analysis projects and built with:


Built by @protny | Report Issues

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors