1.首先獲取m3u8文件
電腦安裝ios_webkit_debug_proxy,然后開啟
ios_webkit_debug_proxy -f chrome-devtools://devtools/bundled/inspector.html
手機設置safari的高級調試功能,通過usb鏈接手機和電腦,電腦打開safari的開發模式鏈接手機
獲取m3u8文件。有可能m3u8是Base64編碼,需要解碼。
2.獲取方式一
直接使用ppmpeg下載
ffmpeg -allowed_extensions ALL -protocol_whitelist "tls,https,file,http,crypto,tcp" -i http://hls.xxx.com/xxx.m3u8 -c copy aaaaa.mp4
3.獲取方式二
直接使用ppmpeg下載方式二
把xxx.m3u8文件下載到本地,把其中的key修改遠程鏈接
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:8
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-KEY:METHOD=AES-128,URI="http://xxx.com/hls/file.key"
#EXTINF:3.128333,
https://xxxx.com/000.ts
ffmpeg -allowed_extensions ALL -protocol_whitelist "tls,https,file,http,crypto,tcp" -i new2.m3u8 -c copy -bsf:a aac_adtstoasc ALL.mp4
4.獲取方式三
直接使用ppmpeg下載方式二
把xxx.m3u8文件下載到本地,所有ts文件也下載到本地,把其中的key修改遠程鏈接
ffmpeg -allowed_extensions ALL -protocol_whitelist "tls,https,file,http,crypto,tcp" -i new2.m3u8 -c copy -bsf:a aac_adtstoasc ALL.mp4
