Skip to content

guirguispierre/m3u8-transcript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

M3U8 Transcript Generator

Download audio from m3u8 streams, transcribe with Whisper, and export to PDF, SRT, or TXT.

Python 3.9+ Whisper Formats GUI License


Features

Feature Description
1 Robust Downloading Uses yt-dlp to handle complex HLS streams and authentication tokens
2 Accurate Transcription Powered by OpenAI's Whisper models -- runs locally, no API keys needed
3 Multiple Output Formats Export as PDF (with metadata), SRT subtitles, or plain text
4 Language Selection Auto-detect or specify a language for better accuracy
5 Modern GUI CustomTkinter interface with progress bar, output log, and cancel support
6 Dark / Light Theme System, Dark, and Light appearance modes
7 Model Caching Whisper models are cached in memory for faster repeated use
8 Auto Organization Saves transcripts to transcripts/ with timestamps

Interface

GUI - Dark Mode

Dark mode with output log, progress bar, format selector, and theme toggle.


Workflow

graph LR
    A["M3U8 URL"] -->|yt-dlp| B["MP3 Audio"]
    B -->|Whisper| C["Segments"]
    C --> D{"Format?"}
    D -->|PDF| E["Timestamped PDF"]
    D -->|SRT| F["SRT Subtitles"]
    D -->|TXT| G["Plain Text"]
Loading

Prerequisites

  • Python 3.9+
  • FFmpeg installed and on your system PATH

Installation

Clone and install:

git clone https://github.com/guirguispierre/m3u8-transcript.git
cd m3u8-transcript
pip install -r requirements.txt

Or install as an editable package:

pip install -e .

Usage

GUI (Recommended)

python3 main.py

Or explicitly:

python3 main.py --gui

CLI

Basic (PDF output):

python3 main.py "YOUR_M3U8_URL"

SRT subtitles:

python3 main.py "URL" -f srt

Plain text with custom name:

python3 main.py "URL" -f txt -o lecture_notes.txt

Medium model, French, keep audio:

python3 main.py "URL" -m medium -l fr --keep-audio

All Options

Flag Description Default
-f, --format Output format: pdf, srt, txt pdf
-m, --model Whisper model: tiny, base, small, medium, large base
-l, --language ISO-639-1 language code (e.g. en, fr) auto-detect
-o, --output Custom output filename/path auto-generated
--keep-audio Keep the downloaded MP3 file off
-v, --verbose Enable DEBUG-level logging off
--gui Launch the GUI interface --

Project Structure

m3u8Transcript/
β”œβ”€β”€ main.py            # CLI entry point and argument parsing
β”œβ”€β”€ gui.py             # CustomTkinter GUI application
β”œβ”€β”€ workflow.py        # Shared download -> transcribe -> write pipeline
β”œβ”€β”€ transcriber.py     # yt-dlp download + Whisper transcription
β”œβ”€β”€ writers.py         # PDF, SRT, and TXT output writers
β”œβ”€β”€ pdf_writer.py      # Backward-compatible PDF shim
β”œβ”€β”€ logger.py          # Centralized logging configuration
β”œβ”€β”€ test_pdf_gen.py    # Test suite (pytest)
β”œβ”€β”€ pyproject.toml     # Package metadata and build config
β”œβ”€β”€ requirements.txt   # Pinned dependencies
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ header.png     # README banner
β”‚   └── gui_dark.png   # GUI screenshot
└── transcripts/       # Default output directory (auto-created)

Running Tests

pytest -v

Credits

Made by Pierre Guirguis with love.

About

Transcribe any m3u8/HLS stream to a timestamped PDF using yt-dlp and OpenAI Whisper. Works with protected streams like Mediasite university lectures.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages