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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lzwme/m3u8-dl

v0.0.9

Published

Batch download of m3u8 files and convert to mp4

Downloads

60

Readme

@lzwme/m3u8-dl

@lzwme/m3u8-dl

NPM version node version license MIT

build status npm download GitHub issues GitHub forks GitHub stars

一个 m3u8 文件视频批量下载工具。

功能特性(Features)

  • 多线程下载。线程池模式的多线程下载。
  • 边下边播模式。支持使用已下载的 ts 缓存文件在线播放。
  • 支持指定多个 m3u8 地址批量下载。
  • 支持缓存续传。下载失败会保留缓存,重试时只下载失败的片段。
  • 支持常见的 AES 加密视频流解密。
  • 自动转换为 mp4。需全局安装 ffmpeg
  • [NEW!]支持指定采集站标准 API,以命令行交互的方式搜索和下载。

安装(Install)

npm i -g @lzwme/m3u8-dl
m3u8dl -h

或者使用 npx

npx @lzwme/m3u8-dl -h

Useage

提示:如需要下载并转换为 mp4 视频格式,您需全局安装 ffmpeg

命令行方式(Command Line Interface)

m3u8dl --help

下载指定 URL 的 m3u8 文件:

m3u8dl https://lzw.me/x/m3u8-player/test.m3u8

批量下载示例一:

# 下载多个文件:
m3u8dl "第1集|https://s.xlzys.com/play/zbqMZYRb/index.m3u8" "第2集|https://s.xlzys.com/play/PdyJXrwe/index.m3u8" --filename "三体"

批量下载示例二:

新建文件 三体.txt,内容格式:

第1集$https://s.xlzys.com/play/zbqMZYRb/index.m3u8
第2集$https://s.xlzys.com/play/PdyJXrwe/index.m3u8
第3集$https://s.xlzys.com/play/oeE6x9Ka/index.m3u8

然后执行如下命令:

m3u8dl 三体.txt

提示:可创建并指定多个 txt 文件实现对多个影视剧集的一键批量下载。

指定采集站 API 搜索并下载

m3u8dl search -h

# 指定采集站 API url 地址(会缓存),然后按提示操作
m3u8dl s -u https://jyzyapi.com/provide/vod/

声明: 以上仅作示例,请自行搜索查找可用的采集站 API。本工具仅用作技术研究学习,不提供任何具体资源类信息。

API 调用

import { m3u8Download } from '@lzwme/m3u8-dl';

// 示例:单文件下载
m3u8Download('test/t.m3u8', { debug: true, filenmae: '测试视频' });

// 示例:批量下载
const fileList = ['第一集$$test/t.m3u8'];
for (const filepath of fileList) {
  const r = await m3u8Download(filepath, { debug: true, filenmae: '测试视频' });
  console.log('文件已下载:', r.filepath);
}

开发(Development)

本地二次开发:

git clone [email protected]:lzwme/m3u8-dl.git
pnpm install
pnpm dev
# npm link

或者 fork 本项目进行代码贡献。

欢迎贡献想法与代码。

References

License

@lzwme/m3u8-dl is released under the MIT license.

该插件由志文工作室开发和维护。