0.0.3 โ€ข Published 1 year ago

m3u8-dln v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

๐Ÿ“– Table of Contents

โœจ Features

โœ… Vey fast ๐ŸŽ๏ธ

โœ… Can be used via CLI or in code

โœ… Support http headers in case of authentication

โœ… Can download from m3u8 master playlist and all his videos inside or specific one

โœ… Can merge video and audio together (works only if the m3u8 master playlist was provided)

โœ… Preserve original quality (without encoding)

๐ŸŽฏ Prerequisites

  • ffmpeg (ffmpeg will be used as the last step to create the mp4 file)

๐Ÿ› ๏ธ Installation

Using via code (for CLI no need to install locally).

NOTE: The package is using esm modules!

Install the package locally.

npm i m3u8-dln

Basic example.

import { m3u8DLN } from 'm3u8-dln';

await m3u8DLN('https://www.example.com/some-path/master.m3u8', './');

With options.

import { m3u8DLN } from 'm3u8-dln';

const response = await m3u8DLN(
  'https://www.example.com/some-path/master.m3u8',
  './',
  {
    httpHeaders: {}, // HTTP headers that can be pass to the http calls.
    segmentBatch: 8, // The number of segment files to download at the same time.
    streamBatch: 4, // The number of streams to download at the same time.
    streamSelection: {
      // 'all' | 'first-one' | 'last-one' | 'highest-bandwidth' | 'highest-resolution'
      strategy: 'highest-resolution', // Choose what streams to download.
    },
  }
);

console.log(response); // [{ outputFilePaths: ['ced0b1120d6954b6229bbbc12c162c6a_1920x1080_25.mp4'] }]

โšก๏ธ Usage

Using via CLI.

npx m3u8-dln --help

Download example with input.

npx m3u8-dln -i https://www.example.com/some-path/master.m3u8

๐Ÿ“œ License

MIT

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago