---
type: "Source File"
title: "\"\"\"Seed YouTube videos using yt-dlp + Whisper + MiniMax.\"\"\""
description: "\"\"\"Seed YouTube videos using yt-dlp + Whisper + MiniMax.\"\"\" import os import sys import json import sqlite3 from datetime import datetime sys.path.insert(0, os.path.dirname(__file__))."
resource: "https://uk.copecheck.com"
tags: ["copecheck", "uk", "source-file", "py"]
timestamp: "2026-04-27T11:24:52Z"
site: "uk"
source_path: "copecheck-uk/seed_yt_whisper.py"
---

# """Seed YouTube videos using yt-dlp + Whisper + MiniMax."""

Source path: `copecheck-uk/seed_yt_whisper.py`  
Index snapshot generated: `2026-11-24T13:42:54Z`  
File modified: `2026-04-27T11:24:52Z`

```py
"""Seed YouTube videos using yt-dlp + Whisper + MiniMax."""
import os
import sys
import json
import sqlite3
from datetime import datetime

sys.path.insert(0, os.path.dirname(__file__))
os.chdir(os.path.dirname(__file__))

from dotenv import load_dotenv
load_dotenv()

from youtube_scorer_v2 import score_video, get_video_info

DB_PATH = os.path.join(os.path.dirname(__file__), "data", "copecheck_uk.db")

VIDEOS = [
    "QUQsMZIAgls",  # Gary Stevenson
    "Ds3R8AckpXs",  # Owen Jones
    "Fn9A9o8HGjM",  # Tom Harwood
    "37HGgQWtIvU",  # Aaron Bastani
    "XV_B96fAzKs",  # Steven Bartlett
]

if __name__ == "__main__":
    conn = sqlite3.connect(DB_PATH)
    conn.execute("""CREATE TABLE IF NOT EXISTS youtube_videos (
        video_id TEXT PRIMARY KEY,
        title TEXT, channel TEXT, url TEXT,
        transcript_length INTEGER, cope_score REAL,
        cope_summary TEXT, scapegoats TEXT,
        cope_mechanisms TEXT, key_quotes TEXT,
        submitted_by TEXT DEFAULT 'system',
        status TEXT DEFAULT 'pending',
        scored_at TEXT
    )""")
    conn.commit()

    for vid in VIDEOS:
        # Skip if already scored
        existing = conn.execute("SELECT video_id FROM youtube_videos WHERE video_id=?", (vid,)).fetchone()
        if existing:
            print(f"\n=== {vid}: already scored, skipping ===")
            continue

        print(f"\n=== Scoring {vid} ===")
        info = get_video_info(vid)
        print(f"  Title: {info['title']}")
        print(f"  Channel: {info['channel']}")

        result = score_video(vid, submitted_by="system")
        if "error" in result:
            print(f"  ERROR: {result['error']}")
            continue

        print(f"  Cope score: {result['cope_score']}")
        print(f"  Summary: {result.get('cope_summary','')[:150]}")

        conn.execute("""
            INSERT OR REPLACE INTO youtube_videos
            (video_id, title, channel, url, transcript_length, cope_score,
             cope_summary, scapegoats, cope_mechanisms, key_quotes,
             submitted_by, status, scored_at)
            VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
        """, (
            result["video_id"], result["title"], result["channel"],
            result["url"], result["transcript_length"],
            result["cope_score"], result.get("cope_summary", ""),
            result.get("scapegoats", ""),
            result.get("cope_mechanisms", ""),
            json.dumps(result.get("key_quotes", [])),
            "system", "scored", datetime.utcnow().isoformat()
        ))
        conn.commit()
        print(f"  SAVED!")

    conn.close()
    print("\nDone!")
```
