File size: 3,645 Bytes
04850df | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | # β‘ Universal Media Transcriber
Convert **YouTube, YouTube Music, Spotify, and direct audio/video URLs** into transcript `.txt` files β extremely fast.
---
## β¨ Features
| Feature | Detail |
|---|---|
| **Native captions** | YouTube captions grabbed instantly β no audio download |
| **Whisper fallback** | `faster-whisper` (up to 4Γ faster than OpenAI Whisper) |
| **Spotify** | Tracks / albums / playlists via `spotdl` β Whisper |
| **Direct audio** | `.mp3 .mp4 .wav .m4a .webm .ogg` and more |
| **Playlist support** | Auto-expand playlists, channels, albums |
| **Batch + parallel** | Multiple URLs, concurrent workers |
| **Smart cache** | Re-run same URL instantly |
| **Auto-install** | Deps install themselves on first run |
---
## π Quick Start
```bash
# Single YouTube video
python transcriber.py https://youtu.be/VIDEO_ID
# Multiple URLs
python transcriber.py URL1 URL2 URL3
# From a file (one URL per line)
python transcriber.py --file urls.txt
# Full YouTube playlist
python transcriber.py --playlist https://youtube.com/playlist?list=PLAYLIST_ID
# Spotify track
python transcriber.py https://open.spotify.com/track/TRACK_ID
# Force Whisper (ignore captions)
python transcriber.py URL --whisper
# Larger model for better accuracy
python transcriber.py URL --model large-v3
# Merge all into one file
python transcriber.py URL1 URL2 --merge
# Custom output folder
python transcriber.py URL --output ./my_transcripts
```
---
## π Options
```
urls One or more media URLs
--file, -f Text file with one URL per line
--output, -o Output directory (default: ./transcripts)
--merge, -m Merge all transcripts into one file
--whisper, -w Force Whisper (skip caption check)
--model tiny | base | small | medium | large-v2 | large-v3
--workers Parallel workers (default: 4)
--no-cache Disable transcript cache
--playlist Expand playlist/channel into individual videos
--clear-cache Wipe the cache
```
---
## π¦ Dependencies (auto-installed)
- `yt-dlp` β universal media downloader
- `youtube-transcript-api` β instant YouTube captions
- `faster-whisper` β optimized Whisper (CTranslate2)
- `spotdl` β Spotify downloader
- `rich` β terminal UI
**Requires:** `ffmpeg` installed on your system:
```bash
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# Windows
winget install ffmpeg
```
---
## β‘ Speed Guide
| Source | Method | Speed |
|---|---|---|
| YouTube with captions | Native API | < 2 sec |
| YouTube no captions | Whisper `base` | ~realtime |
| Spotify music | spotdl + Whisper | depends on length |
| Direct audio | Whisper | ~realtime |
**Model accuracy vs speed:**
`tiny` β `base` β `small` β `medium` β `large-v3`
(fastest) (most accurate)
---
## π Output Format
```
======================================================================
TITLE : My Video Title
UPLOADER : Channel Name
DURATION : 0:15:42
SOURCE : youtube
METHOD : native_captions
URL : https://youtu.be/...
======================================================================
[0:00:00] Hello and welcome to this video...
[0:00:05] Today we're going to talk about...
```
---
## π URL File Format
```
# urls.txt β lines starting with # are comments
https://youtu.be/VIDEO1
https://youtu.be/VIDEO2
https://open.spotify.com/track/TRACK_ID
https://example.com/podcast.mp3
``` |