feat: Simple play-dl stream

This commit is contained in:
2024-06-19 11:55:55 +07:00
parent a4242badf8
commit 2c3382306b
3 changed files with 43 additions and 0 deletions

5
src/index.ts Normal file
View File

@@ -0,0 +1,5 @@
import { stream } from "./stream";
export default {
stream,
};

7
src/stream.ts Normal file
View File

@@ -0,0 +1,7 @@
import { Readable } from "stream";
import playdl from "play-dl/play-dl";
export const stream = async (url: string): Promise<Readable> => {
let playdlStream = await playdl.stream(url);
return playdlStream.stream;
};