npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

Iโ€™ve always been into building performant and accessible sites, but lately Iโ€™ve been taking it extremely seriously. So much so that Iโ€™ve been building a tool to help me optimize and monitor the sites that I build to make sure that Iโ€™m making an attempt to offer the best experience to those who visit them. If youโ€™re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, ๐Ÿ‘‹, Iโ€™m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If youโ€™re interested in other things Iโ€™m working on, follow me on Twitter or check out the open source projects Iโ€™ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soonโ€“ish.

Open Software & Tools

This site wouldnโ€™t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you ๐Ÿ™

ยฉ 2025 โ€“ Pkg Stats / Ryan Hefner

m3u8-dln

v0.0.3

Published

A complete m3u8 downloader ๐Ÿ“บ

Downloads

35

Readme


๐Ÿ“– 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