Skip to content

Instantly share code, notes, and snippets.

@shinsenter
Created August 14, 2024 04:13
Show Gist options
  • Save shinsenter/785f3811f1b617be3490b12b3a42ea7a to your computer and use it in GitHub Desktop.
Save shinsenter/785f3811f1b617be3490b12b3a42ea7a to your computer and use it in GitHub Desktop.
Download m3u8 on macOS

Install ffmpeg:

brew install ffmpeg

Download file through url, like this:

ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "https://path/to/playlist.m3u8" -c copy ~/Downloads/video.mp4

Shell script (E.g. dl_m3u8.sh):

#!/bin/sh
url="$1"
dir="$(cd ~/Downloads && pwd)"
filename="$dir/${2:-video}.mp4"

# brew install ffmpeg

rm -rf "$filename"
ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "$url" -c copy "$filename"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment