m3u8-grabber
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published
HELP ME!

m3u8 Grabber

This will take a m3u8 URL and recursively download the file itself, .ts video files, and any .key encryption key files. It will try to preserve the structure of everything "as-is" without distrurbing how the files are. It will then upload everything to Google Cloud Storage.

Usage

Typescript example

import path from 'path';
import { Storage } from '@google-cloud/storage';
import {
  downloadM3u8,
} from 'm3u8-grabber';
const jsonFilePath = path.resolve(__dirname, 'google-credentials.json');
const jsonData = fs.readFileSync(jsonFilePath, 'utf-8');
const keyFile = JSON.parse(jsonData) as never;

const storage = new Storage({
  credentials: keyFile,
});

await downloadM3u8(
  storage, // <-- Google Cloud Storage JS/TS client.
  'https://my-url.com/hls/index.m3u8', // <-- The m3u8 URL
  'my-gcs-bucket', // <-- Google Cloud Storage Bucket
  'output', // <--- The local output folder name on disk for m3u8 files.
  'my-user-1234', // <-- The remote Google Cloud Storage "folder" output.
);

HELP ME!

Package Sidebar

Install

npm i m3u8-grabber

Weekly Downloads

5

Version

1.0.7

License

MIT

Unpacked Size

30.5 kB

Total Files

14

Last publish

Collaborators

  • benedictchen