Skip to content

Instantly share code, notes, and snippets.

@piotron
Created September 1, 2018 09:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piotron/a605b746e973ad44e05b86fd7e7e24cc to your computer and use it in GitHub Desktop.
Save piotron/a605b746e973ad44e05b86fd7e7e24cc to your computer and use it in GitHub Desktop.
How to easily download m3u8 and ts video movie streams with Docker

Docker Downloading

Download it from Docker (Isn't it obvious?)

Locate m3u8 file url

You want to downlad something right?

Run below snipper

docker run -v $PWD:/tmp/workdir --rm  jrottenberg/ffmpeg -user_agent "<UserAgent string>" -i <M3U8_URI> -c copy <FILENAME>.mkv

Command explain

  • docker run - execute container
  • -v $PWD/:/tmp/workdir - Mount current directory in container workdir
  • --rm - remove container after exit
  • jrottenberg/ffmpeg - ffmpeg container
  • -user_agent "long user agent string" - how ffmpeg should introduce itself to webserver. You can get most actual user agents from WhatIsMyBrowser most common agents list
  • -i <M3U8_URI> - Input URL
  • -c copy <FILENAME>.mkv - this one says that we want to concacenate all files from m3u8 playlist and save them as filename.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment