music: hopefully fix youtube cutoff from expiring urls
This commit is contained in:
parent
9462411e56
commit
9f6d2e95ed
1 changed files with 2 additions and 4 deletions
|
@ -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/");
|
||||
|
|
Loading…
Reference in a new issue