How romhackman/m3u8-downloader works
This repository is a small command-line video discovery and download toolkit. Its principal path is scanning a page and its iframes for HLS links, saving them to JSON, then loading that cache and invoking yt-dlp/ffmpeg to produce MP4 files. A separate crawler extracts MP4/HLS candidates and uses yt-dlp as a fallback. The source excerpts show these calls and transfers; optional cookies and external tools are documented in the README.
Main entry points: d_mp4.py Video crawler · d_m3u8.py Download CLI · video.py HLS finder · help.py Usage banner
Components 21
Video discovery
- HLS finder
video.py - Page scan
video.py - Iframe scan
video.py - Video crawler
d_mp4.py - HTML extraction
d_mp4.py - Regex extraction
d_mp4.py - JavaScript extraction
d_mp4.py - Iframe extraction
d_mp4.py - Usage banner
help.py
Downloads
- Cache reader
d_m3u8.py - Download CLI
d_m3u8.py - Command builder
d_m3u8.py - Download runner
d_m3u8.py - MP4 lister
d_m3u8.py - Crawler fallback
d_mp4.py
Cache and output
- JSON cache
cache.json - MP4 files
- cookies.txt
Other components
- CLI user
- yt-dlp
- ffmpeg
Connections 25
- CLI user → HLS finder: runs scan
README.md - HLS finder → Page scan: scans page
video.py - Page scan → Iframe scan: scans iframes
video.py - HLS finder → JSON cache: writes links
video.py - CLI user → Download CLI: runs download
README.md - Download CLI → Cache reader: loads cache
d_m3u8.py - Cache reader → JSON cache: reads JSON
d_m3u8.py - Download CLI → Command builder: builds command
d_m3u8.py - Download CLI → Download runner: runs command
d_m3u8.py - Download runner → Command builder: requests command
d_m3u8.py - Command builder → cookies.txt: adds cookies
d_m3u8.py - Download runner → yt-dlp: invokes
d_m3u8.py - yt-dlp → ffmpeg: uses downloader
- Download runner → MP4 files: writes MP4
d_m3u8.py - Download CLI → MP4 lister: lists downloads
d_m3u8.py - MP4 lister → MP4 files: reads directory
d_m3u8.py - CLI user → Video crawler: enters URL
README.md - Video crawler → HTML extraction: extracts tags
d_mp4.py - Video crawler → Regex extraction: extracts links
d_mp4.py - Video crawler → JavaScript extraction: extracts sources
d_mp4.py - Video crawler → Iframe extraction: follows iframes
d_mp4.py - Video crawler → Crawler fallback: downloads on hits
d_mp4.py - Crawler fallback → yt-dlp: invokes fallback
d_mp4.py - Usage banner → HLS finder: shows usage
help.py - Usage banner → Download CLI: shows usage
help.py