1

The m3u8 file location is

https://hls2.videos.sproutvideo.com/4c6...../b24db8.../video/720.m3u8?Policy=eyJTd....._&Signature=S7pry.....__&Key-Pair-Id=APKAIB5DGCGAQJ4GGIUQ

The 720.key is in

https://hls2.videos.sproutvideo.com/4c6...../b24db8.../video/720.key?Policy=eyJTd....._&Signature=S7pry.....__&Key-Pair-Id=APKAIB5DGCGAQJ4GGIUQ

if I'm using ffmpeg -i "https://hls2.videos.sproutvideo.com/4c6...../b24db8.../video/720.m3u8?Policy=eyJTd....._&Signature=S7pry.....__&Key-Pair-Id=APKA..... -c copy 01.ts to download the playlist. It will get a HTTP error 403 Forbidden for its key and ts file

[https @ 000000000364d8c0] HTTP error 403 Forbidden
Unable to open key file https://hls2.videos.sproutvideo.com/4c6...../b24db8.../video/720.key
[hls,applehttp @ 00000000005ec180] Opening 'crypto+https://hls2.videos.sproutvideo.com/4c6...../b24db8.../video/720_00000.ts' for rea
ding
[https @ 000000000364cc80] HTTP error 403 Forbidden
[crypto @ 0000000003695dc0] Unable to open resource: https://hls2.videos.sproutvideo.com/4c6...../b24db8.../video/720_00000.ts
[hls,applehttp @ 00000000005ec180] Failed to open segment 0 of playlist 0
[hls,applehttp @ 00000000005ec180] Opening 'crypto+https://hls2.videos.sproutvideo.com/4c6...../b24db8.../video/720_00001.ts' for rea
ding

And then I've figured it out the resouces can only be accessed by some specified query string. In this case, it would be ?Policy=eyJTd....._&Signature=S7pry.....__&Key-Pair-Id=APKAIB5DGCGAQJ4GGIUQ

My question is how to put a one-time query string to each ts and key files, so that ffmpeg are able to download it.

The 720.m3u8 file content:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-KEY:METHOD=AES-128,URI="720.key",IV=0x2f1fb3a9fd334f2babb6cc77f7753129
#EXTINF:10.000000,
720_00000.ts
#EXTINF:10.000000,
720_00001.ts
#EXTINF:10.000000,
720_00002.ts
#EXTINF:10.000000,
720_00003.ts
#EXTINF:8.733333,
720_00004.ts
#EXT-X-ENDLIST
  • Not sure if it can be made to work, but consider giving 'youtube-dl' a try. Despite it's name it's awesome at all those intricacies of getting all the necessarey bits and bobs extracted out of any web page/URL to then proceed and download content. It uses ffmpeg under the hood for further processing. – TBR Jun 16 '18 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.