Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
  9. Select the Video format of "MP4".
  10. Checkmark "One .. One".
  11. Click "Download".
  12. A dialog will display with all of the individual .ts files. Click "Download" to download them all and join them together.

Auto-Clicking Continue Dialog

Occasionally, the download of one of the .ts files may fail and a dialog will displaying asking to continue or not. You can automatically click "Yes" and continue downloading everything by using a tool such as Buzof.

@simsnet

This comment has been minimized.

Copy link

@simsnet simsnet commented Sep 17, 2018

Been needing a tutorial like this for some time, and I'm glad I found this one, which works perfectly. Thanks for writing!

@aljorhythm

This comment has been minimized.

@ashunani

This comment has been minimized.

Copy link

@ashunani ashunani commented Oct 1, 2018

video tutorial is necessary

@josephrocca

This comment has been minimized.

Copy link

@josephrocca josephrocca commented Oct 16, 2018

No need to download a program for this if you've already got VLC! :)

Just open VLC, then click the "Media" menu and then click "Open Network Stream..." (or similar) and then paste the m3u8 URL in the box: https://i.imgur.com/CjWZjtb.png You can then click play, or click the dropdown menu next to the play button and click "convert" to download it.

@cisko3000

This comment has been minimized.

Copy link

@cisko3000 cisko3000 commented Oct 31, 2018

No need to download a program for this if you've already got VLC! :)

Just open VLC, then click the "Media" menu and then click "Open Network Stream..." (or similar) and then paste the m3u8 URL in the box: https://i.imgur.com/CjWZjtb.png You can then click play, or click the dropdown menu next to the play button and click "convert" to download it.

The thing about VLC is that it doesn't show an option for joining them all together or downloading them all at once.

@dosentmatter

This comment has been minimized.

Copy link

@dosentmatter dosentmatter commented Nov 27, 2018

I'm on macOS. Another problem I have with VLC is that it doesn't follow HTTP 302 redirects.

ffmpeg is easiest since it downloads and converts. If you use VLC, you can download them and then find some program to merge/convert.

@shahesam84

This comment has been minimized.

Copy link

@shahesam84 shahesam84 commented Feb 28, 2019

Great work!
Can you add any feature that can limit the size of recorded .ts file (re-write feature)? In other words, is there a way I can use this to re-stream a source .m3u8?

@kchaitanyach

This comment has been minimized.

Copy link

@kchaitanyach kchaitanyach commented Apr 21, 2019

Thanks mate. Works like a charm.

@srazza

This comment has been minimized.

Copy link

@srazza srazza commented May 8, 2019

Use this link for security: https://sourceforge.net/projects/m3u8x/

@roqueorts

This comment has been minimized.

Copy link

@roqueorts roqueorts commented Jun 8, 2019

Huge

@balmydrizzle

This comment has been minimized.

Copy link

@balmydrizzle balmydrizzle commented Aug 20, 2019

What if the m3u8 segment link is relative when I have clicked 'one by one'? It always return 404 error.

@psipher

This comment has been minimized.

Copy link

@psipher psipher commented Oct 12, 2019

Thanks mate, works well. So idm couldnt download the ts file, so i just copied the url from there and paste it here, Also Could you please add ab option wehere we can directly covert to particular format, rather than download then manually convert

@briaguya

This comment has been minimized.

Copy link

@briaguya briaguya commented Oct 28, 2019

youtube-dl did the trick for getting a video with a m3u8 off reddit

@spardorp

This comment has been minimized.

Copy link

@spardorp spardorp commented Nov 4, 2019

It bothers me that running m3u8x.exe wants me to install a certificate "fiddlerroot". Many websites say not to install as it's for forcing adds in Windows. :(

@climbTheStairs

This comment has been minimized.

Copy link

@climbTheStairs climbTheStairs commented Dec 3, 2019

I keep getting the error:

The underlying connection was closed: An unexpected error occurred on a send. Could not download the URL: "[...]"

What does this mean?

@hosadokha

This comment has been minimized.

Copy link

@hosadokha hosadokha commented Dec 3, 2019

I Cant download from some video sites.. It gives me failed to download..
example: https://www8.123movies.st/watch/a-guy-thing.zlr13/9o304v8
I posted this problem here:
https://superuser.com/questions/1506628/failed-to-download-m3u8-despite-following-instructions
basicly there is no MASTER or INDEX there is list.m3u8 and 720p.m3u8

@brookoli

This comment has been minimized.

Copy link

@brookoli brookoli commented Jan 12, 2020

Thank you very much! I was afraid I had to download all those .ts parts on my own

@ffmpmp

This comment has been minimized.

Copy link

@ffmpmp ffmpmp commented Feb 3, 2020

please add a download queue feature

@brugni

This comment has been minimized.

Copy link

@brugni brugni commented Mar 20, 2020

Can you say me if there is a way to download movies from these 2 website: Mubi and Festival Scope. Thank you, i really appreciate an answer.

@rushils372

This comment has been minimized.

Copy link

@rushils372 rushils372 commented Apr 1, 2020

I want to download from Hotstar premium. I have a premium subscription but just don't know how to download tried several but none of them had worked till now.

@hosadokha

This comment has been minimized.

Copy link

@hosadokha hosadokha commented Apr 1, 2020

I want to download from Hotstar premium. I have a premium subscription but just don't know how to download tried several but none of them had worked till now.

did u try firfox's 'download helper' 'ant video download' ' easy download' ?

@rushils372

This comment has been minimized.

Copy link

@rushils372 rushils372 commented Apr 2, 2020

download

Yup, It was not working. Actually I am able to download it via IDM but not able to play since videos are DRM protected.

@petersphilo

This comment has been minimized.

Copy link

@petersphilo petersphilo commented Apr 5, 2020

On a Mac, here is a quick and easy way to do it:
basically, open a terminal and enter:
$ /path-to-binary/ffmpeg -i https://url-of-input -c copy /path-to-enclosing-folder/DestinationFile.mkv
That's it..

@sachinkumar502

This comment has been minimized.

Copy link

@sachinkumar502 sachinkumar502 commented Apr 26, 2020

not working for me can any one help me I am ready to pay. here is file where I didnt find master url.
#EXTM3U
#EXT-X-VERSION:4
#EXT-X-STREAM-INF:BANDWIDTH=1020347,CODECS="avc1.64001f,mp4a.40.2",RESOLUTION=1280x720
chunklist_w301483398.m3u8?ipAddress=myip&isPrimary=true&ref=https%3A%2F%2Fsitename&sessionId=34343434&userId=344523&username=mymaiid&videoId=151572

@swaxxi

This comment has been minimized.

Copy link

@swaxxi swaxxi commented Apr 27, 2020

Is there a way to get content from sites like viaplay perhaps some tool or script?

@geekz

This comment has been minimized.

Copy link

@geekz geekz commented Apr 30, 2020

No need to download a program for this if you've already got VLC! :)

Just open VLC, then click the "Media" menu and then click "Open Network Stream..." (or similar) and then paste the m3u8 URL in the box: https://i.imgur.com/CjWZjtb.png You can then click play, or click the dropdown menu next to the play button and click "convert" to download it.

Awesome. Thank you for the tip.

@Tekwizz

This comment has been minimized.

Copy link

@Tekwizz Tekwizz commented May 16, 2020

True, you can just use VLC. When you select Save/Convert, I think the m3u8 streams are "ts" so choose Video - H.264 + MP3 (TS) and it will save the file to disk. Actually it's not a single file, they are like 10 second chunks and VLC is able to combine them into a single file! :)

@SatarShirzai

This comment has been minimized.

Copy link

@SatarShirzai SatarShirzai commented May 16, 2020

I have tried VLC and this application but none of them worked. "file not supported".
From this website, I couldn't find the m3u8 file directly but I could get the JSON file and find the m3u8 link but it didn't work.
m3u8 link:

https://ffprod2.b-cdn.net/c/278/m/007ef236-afef-11e9-b906-c50a9ae7a227.ism/master.1920x1080.m3u8

could someone help me with that, please

@zackmark29

This comment has been minimized.

Copy link

@zackmark29 zackmark29 commented May 19, 2020

Can someone have source code for this? it looks like it's already abandoned

@brugni

This comment has been minimized.

Copy link

@brugni brugni commented May 20, 2020

hey guys anybody can help me? i need to know how can i get vtt subtitles from m3u8? Anybody can write any command text example? Thank u a lot

@Tekwizz

This comment has been minimized.

Copy link

@Tekwizz Tekwizz commented Jun 6, 2020

SatarShirzai, I tired streaming it in VLC and it's weird, it seems to play, no video/audio, and it shows as 40 minutes! Maybe it's encrypted video!

@n0nam

This comment has been minimized.

Copy link

@n0nam n0nam commented Jul 6, 2020

Deleted !

@Defitto

This comment has been minimized.

Copy link

@Defitto Defitto commented Aug 11, 2020

Deleted !

@aq4229

This comment has been minimized.

Copy link

@aq4229 aq4229 commented Aug 20, 2020

sss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.