Created
February 9, 2020 22:47
-
-
Save jmurphyau/4273f823990d66b08be72e26b262f2ae to your computer and use it in GitHub Desktop.
Download HLS Stream with FFmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#this | |
ffmpeg -loglevel debug -f hls -referer 'https://10play.com.au/live' -user_agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4050.0 Safari/537.36' -f hls -i "https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/2199827728001/6bd7fe89-1f2f-42d0-b7a5-c676791a0d83/10s/master.m3u8?fastly_token=NWUzZDliOGZfNTJhZjJhN2IxMzQ5OTdjNGVkYmEzODkwNjYwZTYyMWY2ZmY1YjNmNGJkNWM3NjdiNDFiZmViNjczNzMwMmJlYQ%3D%3D" -c copy project5.mp4 | |
# or this | |
ffmpeg -loglevel debug -f hls -referer 'https://10play.com.au/live' -user_agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4050.0 Safari/537.36' -f hls -i "https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/2199827728001/6bd7fe89-1f2f-42d0-b7a5-c676791a0d83/10s/master.m3u8?fastly_token=NWUzZDliOGZfNTJhZjJhN2IxMzQ5OTdjNGVkYmEzODkwNjYwZTYyMWY2ZmY1YjNmNGJkNWM3NjdiNDFiZmViNjczNzMwMmJlYQ%3D%3D" -c copy -bsf:a aac_adtstoasc project3.mp4 |
I'm often downloading videos where I get this kind of error:
[https @ 0x7fef54e01240] HTTP error 429 Too Many Requests
[hls @ 0x7fef5380fe00] Failed to open segment 300 of playlist 0
[hls @ 0x7fef5380fe00] Opening 'XXX' for reading
[https @ 0x7fef54e01240] HTTP error 429 Too Many Requests
[hls @ 0x7fef5380fe00] Failed to open segment 300 of playlist 0
[hls @ 0x7fef5380fe00] Opening 'XXX' for reading
[https @ 0x7fef54b8af40] HTTP error 429 Too Many Requests
[hls @ 0x7fef5380fe00] Failed to open segment 300 of playlist 0
[hls @ 0x7fef5380fe00] Opening 'XXX' for reading
[https @ 0x7fef52d4bfc0] HTTP error 429 Too Many Requests
[hls @ 0x7fef5380fe00] Failed to open segment 300 of playlist 0
The videos usually end up being fine and complete so I think ffmpeg just continues to harass the server until the request succeeds. A more polite way would be to wait a certain amount of time - possibly even as a function of the duration of the last downloaded segment (which would emulate someone watching the stream). Is there an option for that?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://manifest.prod.boltdns.net/manifest/v1/hls/v4/aes128/6160987583001/b9d99f74-71b7-4dd7-8f15-e11bf255642b/10s/master.m3u8?fastly_token=NWY0YjhiZWJfYmUwNDU0MzUzYjJjYTFmZDY1ZjA2Y2Y3MjQwMmFkYmNlMmZmY2ZkYzI0MTNhNjQzOTM1MDUwZTBkZjlkZTA0Mg%3D%3D