m3u8 playlist and
TS chunks for a given playlist URL.
Install it via
[sudo] npm install hlsdownloader --save# Or[sudo] yarn add hlsdownloader
destination field is optional. If
destination is not provided it just fetches the content from origin.
It can also be useful if you want to do content pre-fetching from CDN for your end viewers. If any
variant download is failed it continues downloading others and reports after finishing.
It's simple as below.
; //Using ES2015 module//var HLSDownloader = require('hlsdownloader').downloader; //using commonJS moduleconst params =playlistURL: '' // change itdestination: '/tmp' // change it (optional field);const downloader = params;downloader;
msg is an object with following properties
//on successmessage: 'Downloaded successfully'playlistURL: 'your playlist url'//on partial downloadmessage: 'Download done with some errors'playlistURL: 'your playlist url'errors: // items url that is skipped or could not downloaded for error
HLSDownloader accepts all parameters supported by request-promise except these following options
It helps you to do
concurrency of download and other various tasks without changing your code and workflow.
I will be grateful if you all help me to improve this package by giving your suggestions, feature request and pull requests. I am all ears!!