fix(Queue): fix createStream
This commit is contained in:
parent
38c0e209a0
commit
ea8108979b
1 changed files with 15 additions and 12 deletions
|
@ -645,8 +645,10 @@ class Queue<T = unknown> {
|
||||||
if (!link) return void this.play(this.tracks.shift(), { immediate: true });
|
if (!link) return void this.play(this.tracks.shift(), { immediate: true });
|
||||||
|
|
||||||
if (customDownloader) {
|
if (customDownloader) {
|
||||||
|
stream = (await this.createStream(track, link)) ?? null;
|
||||||
|
if (stream)
|
||||||
stream = ytdl
|
stream = ytdl
|
||||||
.arbitraryStream(await this.createStream(track, link), {
|
.arbitraryStream(stream, {
|
||||||
opusEncoded: false,
|
opusEncoded: false,
|
||||||
fmt: "s16le",
|
fmt: "s16le",
|
||||||
encoderArgs: options.encoderArgs ?? this._activeFilters.length ? ["-af", AudioFilters.create(this._activeFilters)] : [],
|
encoderArgs: options.encoderArgs ?? this._activeFilters.length ? ["-af", AudioFilters.create(this._activeFilters)] : [],
|
||||||
|
@ -668,8 +670,9 @@ class Queue<T = unknown> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const arbitrarySource = customDownloader
|
const tryArb = (customDownloader && (await this.createStream(track, track.raw.source || track.raw.engine))) || null;
|
||||||
? await this.createStream(track, track.raw.source || track.raw.engine)
|
const arbitrarySource = tryArb
|
||||||
|
? tryArb
|
||||||
: track.raw.source === "soundcloud"
|
: track.raw.source === "soundcloud"
|
||||||
? await track.raw.engine.downloadProgressive()
|
? await track.raw.engine.downloadProgressive()
|
||||||
: typeof track.raw.engine === "function"
|
: typeof track.raw.engine === "function"
|
||||||
|
|
Loading…
Reference in a new issue