How to Download M3U8 Using Wget and Curl
Download M3U8 streams using Wget and Curl. Command-line methods for saving HLS content on any system.
Why Use Wget or Curl?
Wget and Curl are universal command-line tools for downloading files. For M3U8 streams, they're useful when you need to download the playlist file itself (to inspect it) or when FFmpeg isn't available. However, they can't merge TS segments — they download individual files only.
Downloading the M3U8 Playlist
To download just the playlist (for inspection or analysis):
# With wget
wget "https://example.com/stream.m3u8"
# With curl
curl -O "https://example.com/stream.m3u8"
Downloading All Segments from a Playlist
To download all TS segments listed in a playlist:
# Download the playlist first
wget "https://example.com/stream.m3u8"
# Extract segment URLs and download them
grep -v "^#" stream.m3u8 | grep -v "^$" | while read url; do
wget "$url"
done
Curl + FFmpeg Combination
The most practical approach is to use curl to check stream availability, then FFmpeg for the actual download:
# Check if stream is accessible
curl -I "https://example.com/stream.m3u8"
# Download with FFmpeg
ffmpeg -i "https://example.com/stream.m3u8" -c copy output.mp4
Related Articles
Download M3U8 Streams Using FFmpeg
Learn how to download M3U8/HLS streams with FFmpeg. Commands for saving streams, selecting quality, and handling live streams.
Download HLS Streams with FFmpeg: Step-by-Step
Complete guide to downloading HLS streams using FFmpeg. Covers VOD, live, encrypted streams, and automation with scripts.
Convert M3U8 to MP4 with FFmpeg: Complete Guide
Step-by-step guide to converting M3U8 streams to MP4 using FFmpeg. Fast, lossless, and fully customizable conversion commands.