From 9f6d2e95ed868e281ebc95c0e2229fa6e917cbad Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Fri, 12 May 2023 16:06:14 -0600 Subject: [PATCH] music: hopefully fix youtube cutoff from expiring urls --- src/modules/music.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/music.js b/src/modules/music.js index 7801c42..8b9f1d7 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -206,8 +206,8 @@ async function enqueue({ if (type == "yt") { let info; + let id = url; try { - let id = url; if (/^https?:\/\//.test(url)) { const uri = new URL(url); if (uri.hostname == "youtu.be") { @@ -229,9 +229,7 @@ async function enqueue({ .replace("vi_webp", "vi") .replace(".webp", ".jpg"); - media = info - ?.chooseFormat({type: "audio", quality: "best"}) - ?.decipher(yt.session.player); + media = await yt.download(id, {type: "audio", quality: "best"}); } else if (type == "sc") { if (url?.startsWith("sc:")) url = url.replace(/^sc:/, "https://soundcloud.com/");