Skip to content

Instantly share code, notes, and snippets.

@arahmanali
Forked from primaryobjects/m3u8.md
Created October 18, 2018 17:11
Show Gist options
  • Save arahmanali/40f2bb3218233858e80f13270869996d to your computer and use it in GitHub Desktop.
Save arahmanali/40f2bb3218233858e80f13270869996d to your computer and use it in GitHub Desktop.
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.

@arahmanali
Copy link
Author

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.

@arahmanali
Copy link
Author

arahmanali commented Oct 18, 2018

FOR Linux/MacOS
$ ffmpeg -user_agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/9.1.3 Safari/537.86.7" -i http://185.38.12.60/sec/1503173737/363333397f6b65370bfc740ca4dea8c3f8dd2a93419f7748/ivs/12/b1/2ec5e15ba2a6/hls/tracks-4,5/index.m3u8 -c copy pd.mkv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment