From 45ab537a590613789ba81a9c6e8a663fffe32bb2 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Mon, 22 May 2023 20:15:25 -0600 Subject: [PATCH] music: fix youtube --- src/modules/music.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/music.js b/src/modules/music.js index 8b9f1d7..348e89d 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -1,5 +1,6 @@ const {Collection} = require("@projectdysnomia/dysnomia"); +const {Readable} = require("node:stream"); const {Innertube} = require("youtubei.js"); let yt; Innertube.create({ @@ -229,7 +230,9 @@ async function enqueue({ .replace("vi_webp", "vi") .replace(".webp", ".jpg"); - media = await yt.download(id, {type: "audio", quality: "best"}); + media = Readable.from( + await yt.download(id, {type: "audio", quality: "best"}) + ); } else if (type == "sc") { if (url?.startsWith("sc:")) url = url.replace(/^sc:/, "https://soundcloud.com/");