M3U8

new M3U8(opt)

Create an M3U8 Instance Downloader.

Parameters:
NameTypeDescription
optObject

Options for instance

Properties
NameTypeAttributesDefaultDescription
streamUrlString

The URL of the m3u8 playlist.

outputFileString

Path where the downloaded output file will be saved.

qualityString<optional>
'highest'

Quality of the stream to download (default: highest) (qualities: highest, medium and lowest)

mergedPathString<optional>
'require('os').tempdir()/m3u8dl/merged.ts'

Path where merged ts files from segments are stored (default: cache + '/merged.ts').

cacheString<optional>
'require('os').tempdir()/m3u8dl/'

Path where temporary files are stored.

concurrencyNumber<optional>
10

Number of download threads (default: 10)

ffmpegPathString<optional>
ffmpegStatic

Custom path to ffmpeg executable. (default: ffmpeg-static)

useFfmpegToMergeBoolean<optional>
false

Use ffmpeg to merge segments.

cbfunction<optional>
function(event,data){}

Callback function for events. (default: function(event, data){})

Methods

addCaption(uri, lang)

Add a caption file.

Parameters:
NameTypeDefaultDescription
uristringnull

URI or Path of the caption

langstringenglish

Language of the caption

startDownload()

Starts the download