How to Download M3U8 Stream

1) Play video in Safari

2) Click on Share this Video icon

3) Copy URL in Embed

<iframe width="320" height="180" src="https://www.m3watch.sg/embed/41196" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

4) Copy video URL from src attribute

https://www.m3watch.sg/embed/41196

5) Paste and go URL into Safari

6) Play video

7) Right-click on video and select Inspect Element

8) Find video element
Video element is embedded in div element with id = root
Expand all first level div element embedded until video element is found

<video id="_lkzn4" class="playkit-engine playkit-engine-html5" playsinline="" src="https://rest-as.ott.caltura.com/api_v3/service/assetFile/action/playManifest/partnerId/147/assetId/241187/assetType/media/assetFileId/1606333/contextType/PLAYBACK/isAltUrl/False/a.m3u8?playSessionId=cf10a37f-bb9f-4067-e0ec-3f66263ef077:94370009-017d-2be5-a7ae-92c08c362365&amp;referrer=aHR0cHM6Ly93d3cubWV3YXRjaC5zZy9lbWJlZC80MTE5OQ==&amp;clientTag=html5:v1.2.1"></video>

9) Click on URL in src attribute to open video in new tab

10) Right-click on video and select Download Video to download a.m3u8 file

11) Open a.m3u8 file with TextEdit

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=866271,RESOLUTION=640x360
https://k-toggle.akamaised.net/fhls/p/2082311/sp/208231100/serveFlavor/entryId/0_sbflhtkm/v/12/pv/1/ev/6/flavorId/0_iywf76bp/name/a.mp4/index.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1263850,RESOLUTION=854x480
https://k-toggle.akamaised.net/fhls/p/2082311/sp/208231100/serveFlavor/entryId/0_sbflhtkm/v/12/pv/1/ev/6/flavorId/0_aj21jdmq/name/a.mp4/index.m3u8

12) Copy video URL for 480 resolution

https://k-toggle.akamaised.net/fhls/p/2082311/sp/208231100/serveFlavor/entryId/0_sbflhtkm/v/12/pv/1/ev/6/flavorId/0_aj21jdmq/name/a.mp4/index.m3u8

13) Open VLC player

14) Click on File > Open Network

15) Enter URL

16) Check Stream output

17) Click on Settings…

18) Select MPEG 4 for Encapsulation Method

19) Click Browse…

20) Rename file in Save As

21) Click Save

22) Click OK

23) Click Open

For m3u8 files with multiple streams and EXT-X-DISCONTINUITY exists, VLC may not be able to complete download

Install FFMPEG via Homebrew and download