Skill: zedit42/xeonen-video-analyzer (version 1.0.0)

--- name: video-watcher description: Download videos, extract transcripts, capture frames. Analyze YouTube, tutorials, DD videos with yt-dlp + Whisper + ffmpeg. metadata: {"clawdbot":{"requires":{"bins":["yt-dlp","ffmpeg","whisper"]}}} --- # Video Watcher Download, transcribe, and screenshot videos for analysis. ## Requirements ```bash brew install yt-dlp ffmpeg openai-whisper ``` ## Quick Start ```bash ./scripts/analyze.sh "https://youtube.com/watch?v=..." ``` ## Output ``` outputs/ ├── video.mp4 # Downloaded video ├── audio.mp3 # Extracted audio ├── transcript.txt # Plain text ├── transcript.srt # Subtitles └── frames/ # Screenshots every 30s ``` ## Commands ### Analyze video ```bash ./scripts/analyze.sh "URL" [output-dir] [frame-interval] [whisper-model] ``` ### Summarize transcript ```bash ./scripts/summarize.sh ./outputs/transcript.txt ``` Or with AI: ```bash cat outputs/transcript.txt | clawdbot ask "Summarize this" ``` ## Config `config.json`: ```json { "whisper_model": "medium", "frame_interval": 30, "output_dir": "./outputs" } ``` ## Use Cases - DD (Due Diligence) videos - Lecture notes - Podcast summaries - Tutorial documentation - Meeting recordings

path: README.md
content: # 🎬 Video Watcher

Download videos, extract transcripts, capture frames. Perfect for analyzing DD videos, tutorials, podcasts.

## Features

- **Download** - YouTube, Vimeo, most video sites (via yt-dlp)
- **Transcribe** - Local speech-to-text (via Whisper)
- **Frames** - Screenshot every N seconds (via ffmpeg)
- **Summarize** - AI-ready transcript for quick summaries

## Requirements

```bash
brew install yt-dlp ffmpeg openai-whisper
```

## Quick Start

```bash
./scripts/analyze.sh "https://youtube.com/watch?v=..."
```

## Output

```
outputs/
├── video.mp4           # Downloaded video
├── audio.mp3           # Extracted audio
├── transcript.txt      # Plain text transcript
├── transcript.srt      # Subtitle format
└── frames/             # Screenshots
    ├── 00_00_00.jpg    # At 0:00
    ├── 00_00_30.jpg    # At 0:30
    └── ...
```

## Configuration

`config.json`:
```json
{
  "whisper_model": "medium",
  "frame_interval": 30,
  "output_dir": "./outputs",
  "languages": ["en", "tr"]
}
```

### Whisper Models
- `tiny` - Fastest, least accurate
- `base` - Fast
- `small` - Balanced
- `medium` - Good accuracy (recommended)
- `large` - Best accuracy, slow

## Usage Examples

### Analyze a YouTube video
```bash
./scripts/analyze.sh "https://youtube.com/watch?v=xyz"
```

### Custom output directory
```bash
./scripts/analyze.sh "URL" ./my-output
```

### Different frame interval (every 60 seconds)
```bash
./scripts/analyze.sh "URL" ./output 60
```

### Use larger Whisper model
```bash
./scripts/analyze.sh "URL" ./output 30 large
```

## Summarize Transcript

After analysis:
```bash
./scripts/summarize.sh ./outputs/transcript.txt
```

Or pipe to your AI:
```bash
cat outputs/transcript.txt | clawdbot ask "Summarize this video"
```

## Use Cases

- DD (Due Diligence) video analysis
- Lecture notes extraction
- Podcast summaries
- Tutorial documentation
- Meeting recordings

## Notes

- First Whisper run downloads the model (~1.5GB for medium)
- Long videos = long transcription time
- Frame extraction is fast, transcription is slow


path: config.json
content: {
  "whisper_model": "medium",
  "frame_interval": 30,
  "output_dir": "./outputs",
  "video_format": "mp4",
  "audio_format": "mp3",
  "max_duration": 7200,
  "languages": ["tr", "en"],
  "cleanup_after": false
}


path: package.json
content: {
  "name": "video-watcher",
  "version": "1.0.0",
  "description": "Download videos, extract transcripts, capture frames. Analyze YouTube, tutorials, DD videos with yt-dlp + Whisper + ffmpeg.",
  "author": "Zedit42",
  "keywords": ["video", "transcript", "whisper", "youtube", "analysis", "yt-dlp", "ffmpeg", "clawdbot"],
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/Zedit42/video-watcher"
  }
}


path: scripts/analyze.sh
content: #!/bin/bash
# Video Watcher - Analyze a video URL
# Usage: ./analyze.sh "https://youtube.com/watch?v=..."

set -e

URL="$1"
OUTPUT_DIR="${2:-./outputs}"
FRAME_INTERVAL="${3:-30}"
WHISPER_MODEL="${4:-medium}"

if [ -z "$URL" ]; then
    echo "❌ URL gerekli!"
    echo "Kullanım: $0 <video-url> [output-dir] [frame-interval] [whisper-model]"
    exit 1
fi

# Klasörleri oluştur
mkdir -p "$OUTPUT_DIR/frames"

echo "🎬 Video Watcher"
echo "================"
echo "URL: $URL"
echo "Output: $OUTPUT_DIR"
echo ""

# 1. Video indir
echo "📥 Video indiriliyor..."
yt-dlp -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' \
    -o "$OUTPUT_DIR/video.%(ext)s" \
    --no-playlist \
    "$URL" 2>/dev/null || {
    # Sadece audio dene
    echo "📥 Sadece audio indiriliyor..."
    yt-dlp -f 'bestaudio' \
        -x --audio-format mp3 \
        -o "$OUTPUT_DIR/audio.%(ext)s" \
        --no-playlist \
        "$URL"
}

# Video veya audio bul
VIDEO_FILE=$(find "$OUTPUT_DIR" -maxdepth 1 -name "video.*" | head -1)
AUDIO_FILE=$(find "$OUTPUT_DIR" -maxdepth 1 -name "audio.*" | head -1)

if [ -n "$VIDEO_FILE" ]; then
    echo "✅ Video indirildi: $VIDEO_FILE"
    
    # 2. Audio çıkar
    echo "🔊 Audio çıkarılıyor..."
    ffmpeg -i "$VIDEO_FILE" -vn -acodec libmp3lame -q:a 2 "$OUTPUT_DIR/audio.mp3" -y 2>/dev/null
    AUDIO_FILE="$OUTPUT_DIR/audio.mp3"
    
    # 3. Frameler al
    echo "📸 Frameler alınıyor (her ${FRAME_INTERVAL}s)..."
    DURATION=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$VIDEO_FILE" 2>/dev/null | cut -d. -f1)
    
    for i in $(seq 0 $FRAME_INTERVAL $DURATION); do
        TIMESTAMP=$(printf "%02d_%02d_%02d" $((i/3600)) $(((i%3600)/60)) $((i%60)))
        ffmpeg -ss $i -i "$VIDEO_FILE" -vframes 1 -q:v 2 "$OUTPUT_DIR/frames/${TIMESTAMP}.jpg" -y 2>/dev/null
    done
    FRAME_COUNT=$(ls "$OUTPUT_DIR/frames/" | wc -l | tr -d ' ')
    echo "✅ $FRAME_COUNT frame alındı"
fi

# 4. Transcript
if [ -n "$AUDIO_FILE" ]; then
    echo "🎙️ Transcript çıkarılıyor (model: $WHISPER_MODEL)..."
    whisper "$AUDIO_FILE" \
        --model "$WHISPER_MODEL" \
        --output_format txt \
        --output_format srt \
        --output_dir "$OUTPUT_DIR" \
        2>/dev/null
    
    # Dosya isimlerini düzenle
    mv "$OUTPUT_DIR/audio.txt" "$OUTPUT_DIR/transcript.txt" 2>/dev/null || true
    mv "$OUTPUT_DIR/audio.srt" "$OUTPUT_DIR/transcript.srt" 2>/dev/null || true
    
    echo "✅ Transcript hazır"
fi

echo ""
echo "🎉 Tamamlandı!"
echo ""
echo "Çıktılar:"
ls -la "$OUTPUT_DIR"
echo ""
echo "Frameler:"
ls "$OUTPUT_DIR/frames/" | head -5
[ $(ls "$OUTPUT_DIR/frames/" | wc -l) -gt 5 ] && echo "... ve daha fazlası"


path: scripts/summarize.sh
content: #!/bin/bash
# Transcript'i özetle
# Usage: ./summarize.sh ./outputs/transcript.txt

TRANSCRIPT="$1"
OUTPUT="${2:-summary.md}"

if [ ! -f "$TRANSCRIPT" ]; then
    echo "❌ Transcript dosyası bulunamadı: $TRANSCRIPT"
    exit 1
fi

echo "📝 Özet oluşturuluyor..."

# Transcript'i oku ve özet için hazırla
CONTENT=$(cat "$TRANSCRIPT" | head -c 50000)

# AI'a gönder (clawdbot veya başka CLI)
cat << EOF
# Video Özeti

## İçerik

Bu transcript'i analiz et ve şunları çıkar:

1. **Ana Konular** (bullet points)
2. **Önemli Noktalar** (key takeaways)
3. **Bahsedilen İsimler/Projeler**
4. **Rakamlar/İstatistikler** (varsa)
5. **Kısa Özet** (3-5 cümle)

---

Transcript:
$CONTENT
EOF

echo ""
echo "👆 Bu prompt'u AI'a yapıştır veya:"
echo "   cat $TRANSCRIPT | clawdbot ask 'Özetle'"


Security scan verdicts — ClawScan: clean | static analysis:  | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)