5.3.9 - Fix Soundcloud not working/Фикс ошибки SC
This commit is contained in:
parent
fd5c3034f9
commit
0ab06128ac
2 changed files with 4 additions and 4 deletions
|
@ -467,8 +467,8 @@ class Player extends EventEmitter<PlayerEvents> {
|
||||||
const track = new Track(this, {
|
const track = new Track(this, {
|
||||||
title: song.name,
|
title: song.name,
|
||||||
description: "",
|
description: "",
|
||||||
author: song.publisher.name ?? "Unknown Publisher",
|
author: song.publisher?.name ?? "Unknown",
|
||||||
url: song.url,
|
url: song.permalink,
|
||||||
thumbnail: song.thumbnail,
|
thumbnail: song.thumbnail,
|
||||||
duration: Util.buildTimeCode(Util.parseMS(song.durationInMs)),
|
duration: Util.buildTimeCode(Util.parseMS(song.durationInMs)),
|
||||||
views: 0,
|
views: 0,
|
||||||
|
|
|
@ -630,7 +630,7 @@ class Queue<T = unknown> {
|
||||||
let stream = null;
|
let stream = null;
|
||||||
const hasCustomDownloader = typeof this.onBeforeCreateStream === "function";
|
const hasCustomDownloader = typeof this.onBeforeCreateStream === "function";
|
||||||
|
|
||||||
if (["youtube", "spotify"].includes(track.raw.source)) {
|
if (["youtube", "spotify", "soundcloud"].includes(track.raw.source)) {
|
||||||
const url = track.raw.source === "spotify" ? track.raw.engine : track.url;
|
const url = track.raw.source === "spotify" ? track.raw.engine : track.url;
|
||||||
if (!url) return void this.play(this.tracks.shift(), { immediate: true });
|
if (!url) return void this.play(this.tracks.shift(), { immediate: true });
|
||||||
|
|
||||||
|
@ -644,7 +644,7 @@ class Queue<T = unknown> {
|
||||||
} else {
|
} else {
|
||||||
const arbitraryStream = (hasCustomDownloader && (await this.onBeforeCreateStream(track, track.raw.source || track.raw.engine, this))) || null;
|
const arbitraryStream = (hasCustomDownloader && (await this.onBeforeCreateStream(track, track.raw.source || track.raw.engine, this))) || null;
|
||||||
stream =
|
stream =
|
||||||
arbitraryStream || (track.raw.source === "soundcloud" && typeof track.raw.engine?.downloadProgressive === "function")
|
arbitraryStream
|
||||||
? await track.raw.engine.downloadProgressive()
|
? await track.raw.engine.downloadProgressive()
|
||||||
: typeof track.raw.engine === "function"
|
: typeof track.raw.engine === "function"
|
||||||
? await track.raw.engine()
|
? await track.raw.engine()
|
||||||
|
|
Loading…
Reference in a new issue