music: fix youtube
This commit is contained in:
parent
373ad3e604
commit
45ab537a59
1 changed files with 4 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
const {Collection} = require("@projectdysnomia/dysnomia");
|
const {Collection} = require("@projectdysnomia/dysnomia");
|
||||||
|
|
||||||
|
const {Readable} = require("node:stream");
|
||||||
const {Innertube} = require("youtubei.js");
|
const {Innertube} = require("youtubei.js");
|
||||||
let yt;
|
let yt;
|
||||||
Innertube.create({
|
Innertube.create({
|
||||||
|
@ -229,7 +230,9 @@ async function enqueue({
|
||||||
.replace("vi_webp", "vi")
|
.replace("vi_webp", "vi")
|
||||||
.replace(".webp", ".jpg");
|
.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") {
|
} else if (type == "sc") {
|
||||||
if (url?.startsWith("sc:"))
|
if (url?.startsWith("sc:"))
|
||||||
url = url.replace(/^sc:/, "https://soundcloud.com/");
|
url = url.replace(/^sc:/, "https://soundcloud.com/");
|
||||||
|
|
Loading…
Reference in a new issue