Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 609 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 609 Bytes

kaizoku

download HLS video

npm

usage

import { Readable } from 'node:stream'
import { createWriteStream } from 'node:fs'
import { HlsVideo } from '@musakui/kaizoku'

const video = new HlsVideo('[playlist url]', { key: '[key]' })
Readable.from(video).pipe(createWriteStream('video.m2ts'))

// iterate manually to track progress
const writeStream = createWriteStream('video.m2ts')

for await (const chunk of video) {
	writeStream.write(Buffer.from(chunk))

	// notify progress
	// ...
}