here's some python code that does it, you just need to provide the url of the 1st segment and the number of segments (from the .m3u8 file):
def dumpSegs(initUrl, n, path, append=False):
""" downlaod and combine the .ts files
given the first seg's url, the number of segments and
the destination download path """
with open(path, 'ab' if append else 'wb') as f:
for i in range(1, n + 1):
segurl = initUrl.replace('seg-1-', 'seg-{:d}-'.format(i))
success = False
while not success:
try:
seg = requests.get(segurl, headers=HEADERS)
success = True
except:
print('retrying...')
f.write(seg.content)
Here's the same code with a few more bells and whistles
Comments are not for extended discussion; this conversation has been moved to chat.
– Journeyman Geek – 2018-01-19T03:40:07.170Both links produce a Not Found message. With the links unavailable and the relevant discussion in archived chats, I'm not sure if this thread will be useful to anyone else. – fixer1234 – 2018-01-19T04:14:04.410
@fixer1234, it's still useful. – Muntashir Akon – 2018-11-07T09:04:41.427