Knowledge Base

A simple CLI tool to fetch a HLS stream manifest and segments to save it locally as one video file

Well the title pretty much says it all. We'll be installing a simple CLI tool that can be used to store a HLS live-stream locally. This guide shows how to do this on a Ubuntu/Debian/Raspbian system.

We need to install npm first.

sudo apt install npm

Once that is done we can use npm to install hls-fetcher

npm install hls-fetcher -g

How to use it? Use the exact address of the manifest file of the stream you want to store, that has the extension m3u8 and use it like this:

hls-fetcher -i http://example.com/hls_manifest.m3u8

Other options can be shown by just entering hls-fetcher as shown below.

$ hls-fetcher
Usage: hls-fetcher

Options:
  -i, --input        uri to m3u8 (required)
  -o, --output       output path (default:'./')
  -c, --concurrency  number of simultaneous fetches (default: 5)

Source: https://github.com/videojs/hls-fetcher

Table of Contents