Automated binge-watching system with per-episode intro/outro detection and progress tracking.
# Run the global installer
powershell -ExecutionPolicy Bypass -File install_global.ps1This will:
- Add
bingecommand to your PATH - Install mpv Lua script
- Allow you to run
bingefrom anywhere
After installation, restart your terminal and use:
# From any directory
binge detect "path\to\series" 35
binge watch "path\to\series"
# Or use current directory
cd "C:\TV Shows\The Office\Season 3"
binge detect . 35
binge watch .# Run the setup script
setup.batThis will:
- Create conda environment with Python 3.9
- Install all Python dependencies
- Check for FFmpeg and mpv
# 1. Install mpv script (one-time)
binge.bat install
# 2. Detect intros/credits
binge.bat detect "path\to\series" 35
# 3. Start watching
binge.bat watch "path\to\series"✅ Manual Intro Sample - Provide your own intro clip for perfect matching
✅ GUI Intro Extractor - Easy-to-use interface for creating intro samples
✅ IntroDB Integration - Crowdsourced TV show timestamps via IntroDB API
✅ Anime-Skip Integration - Anime timestamps from anime-skip.com
✅ Smart Fallback - Falls back to local audio fingerprinting if API unavailable
✅ API Response Caching - 7-day cache to minimize API calls
✅ Per-Episode Detection - Each episode analyzed individually
✅ Fine-Grained Precision - Timestamps accurate to 0.01 seconds
✅ Smart Intro Detection - Audio fingerprinting finds intros at different positions
✅ Configurable Credits - Set credits offset (e.g., 35s from end)
✅ Progress Tracking - Resume exactly where you left off
✅ Auto-Skip Watched - Automatically skips completed episodes
✅ Series Configuration - JSON config for per-series settings
series-player/
├── bin/ # Executables and main scripts
│ ├── detect.py # Intro/outro detection
│ ├── create_config.py # Configuration creator
│ ├── watch.bat # Watch launcher
│ └── install_script.ps1 # Lua script installer
├── scripts/ # Lua scripts for mpv
│ └── watch_progress.lua # Auto-skip and progress tracking
├── src/ # Source code (for future modules)
├── tests/ # Test fixtures
│ └── fixtures/ # Sample video files
├── binge.bat # Main entry point
└── README.md
If you're setting up on a new system without any prerequisites:
# Download and install from: https://docs.conda.io/en/latest/miniconda.html
# Or use winget:
winget install Anaconda.Miniconda3# Run in PowerShell:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expressionscoop bucket add extras
scoop install ffmpeg
scoop install extras/mpv# Navigate to project directory
cd path\to\series-player
# Create conda environment
conda create -p ./.conda python=3.9 -y
# Activate environment
conda activate ./.conda
# Install Python dependencies
pip install -r requirements.txtbinge.bat install# 1. Setup Python environment
conda create -p ./.conda python=3.9 -y
conda activate ./.conda
pip install -r requirements.txt
# 2. Install system dependencies (if not installed)
scoop install ffmpeg extras/mpv
# 3. Install mpv script
binge.bat install# Check Python packages
python -c "import numpy, scipy, librosa, ffmpeg; print('✓ Python packages OK')"
# Check FFmpeg
ffmpeg -version
# Check mpv
mpv --versionStep 1: Extract Intro Sample
# Navigate to your series folder
cd "C:\TV Shows\The Office\Season 3"
# GUI Method (Easiest)
# Select any episode from the series, specify start time and duration
.\extract_intro_gui.ps1
# Or CLI Method
.\extract_intro.bat "episode01.mkv" 65 27
# Where: 65 = start time in seconds, 27 = duration in secondsThis creates .intro_sample.wav in the series folder.
Step 2: Run Detection (Auto-detects the sample)
binge.bat detect "C:\TV Shows\The Office\Season 3" 35
# The intro sample is automatically detected and used!# Auto-detect with API lookup first, then local fallback
binge.bat detect "C:\TV Shows\The Office\Season 3" 35
# Skip API, use local detection only
binge.bat detect "C:\TV Shows\The Office\Season 3" 35 --no-apibinge.bat watch "C:\TV Shows\The Office\Season 3"# Create/update configuration
binge.bat config "C:\TV Shows\The Office\Season 3" 35- API Lookup - Queries anime-skip.com for crowdsourced timestamps
- Fallback to Local - If API unavailable, extracts intro reference from first episode
- Audio Fingerprinting - Uses chromagram-based fingerprinting to find intro in each episode
- Credits Calculation - Calculates credits position as offset from end (configurable)
- Caching - Saves API responses (7-day TTL) and detection results to
.intro_cache_v2.json - Configuration - Creates
.series_config.jsonwith settings
- Loads configuration and detection cache
- Skips to first unwatched episode
- Monitors playback position in real-time
- Auto-skips intros and credits based on config
- Saves progress every 10 seconds to
.watch_progress.json - Resumes from saved position on restart
The system now supports crowdsourced intro/outro timestamps from multiple sources:
IntroDB is a crowdsourced database for TV show intro timestamps.
How It Works:
- API-First Approach - Queries IntroDB using IMDb IDs
- Automatic Fallback - Falls back to local detection if no data available
- Community Contribution - You can submit your detected timestamps to help others
Setup:
# Set your IntroDB API key (get one at introdb.app)
$env:INTRODB_API_KEY="idb_your_key_here"
# Or add to your PowerShell profile for persistenceSupported Shows:
- The Office (US) - tt0386676
- Breaking Bad - tt0903747
- Game of Thrones - tt0944947
- Stranger Things - tt4574334
- And more (see
src/introdb_client.pyfor full list)
Anime-Skip provides timestamps for anime series.
How It Works:
- Queries anime-skip.com GraphQL API
- 7-day response caching to minimize requests
- Automatic fallback to local detection
- Instant Detection for popular shows (no processing time)
- Community-Verified timestamps from thousands of users
- Bandwidth Efficient with response caching
- Always Works with automatic fallback to local detection
# Default: Try API first, fallback to local
binge.bat detect "path\to\series" 35
# Skip API, use local detection only
python bin\detect.py "path\to\series" --no-api --credits-offset 35Each series folder contains:
.series_config.json - User settings
{
"credits_offset": 35,
"auto_skip_intro": true,
"auto_skip_credits": true,
"series_name": "The Office S03"
}.intro_cache_v2.json - Detected timestamps (auto-generated)
{
"Episode01.mkv": {
"intro_start": 100.45,
"intro_end": 125.99,
"outro_start": 1282.44,
"duration": 1317.44,
"source": "api"
}
}.watch_progress.json - Watch progress (auto-updated)
{
"Episode01.mkv": {
"position": 1282,
"duration": 1317,
"percent_complete": 97,
"is_complete": true,
"timestamp": 1769001603
}
}"conda: command not found"
# Restart PowerShell after installing Miniconda
# Or manually add to PATH:
$env:PATH += ";C:\Users\YourName\miniconda3\Scripts""Module not found" errors
# Make sure conda environment is activated
conda activate ./.conda
# Reinstall dependencies
pip install -r requirements.txt --force-reinstall"ffmpeg: command not found"
# Install via Scoop
scoop install ffmpeg
# Or download from: https://ffmpeg.org/download.html"mpv not found"
scoop bucket add extras
scoop install extras/mpv"Intro not found" for all episodes
- Intro might be too short (<20s) or too long (>90s)
- Try with a different series first to verify setup
- Check if audio track exists:
ffmpeg -i episode.mkv
Wrong intro positions
# Re-run detection with --force
binge.bat detect "path\to\series" 35Lua script not working
# Verify installation
dir "$env:APPDATA\mpv\scripts\skip_intro_outro.lua"
# Or for Scoop mpv:
dir "$env:USERPROFILE\scoop\apps\mpv\current\portable_config\scripts\skip_intro_outro.lua"
# Reinstall
binge.bat installProgress not saving
- Check if
.watch_progress.jsonis created in series folder - Ensure series folder is writable
- Press
`in mpv to see console logs
series-player/
├── bin/ # Main scripts
├── scripts/ # Lua scripts for mpv
├── src/ # Future Python modules
├── tests/ # Test fixtures
├── .conda/ # Python environment (gitignored)
├── requirements.txt # Python dependencies
└── binge.bat # Main entry point
# Activate environment
conda activate ./.conda
# Run detection directly
python bin\detect.py "path\to\series" --credits-offset 35
# Run config creator
python bin\create_config.py "path\to\series" 35See GUIDE.md for detailed workflow instructions and prompt library.
Quick start:
- Tell your AI agent: "Read AGENTS.md, create CONTEXT.md and TASKS.md"
- Define your objectives in CONTEXT.md
- Let the agent populate TASKS.md with atomic tasks
- Start executing tasks one at a time
This project follows strict task management rules defined in AGENTS.md:
- Exactly 1 task in Active at a time
- Every task broken into 2-5 atomic sub-steps
- Automatic commits after each sub-step
- Sequential sub-step completion (no skipping)
- Environment: PowerShell (Windows)
For the complete rule set, see AGENTS.md.