🔨 Fallback src for autoplay

This commit is contained in:
DevAndromeda 2022-07-20 14:04:39 +05:45
parent 5cce998739
commit fca648189a
2 changed files with 8 additions and 3 deletions

View file

@ -730,9 +730,14 @@ class Queue<T = unknown> {
if (this.options.leaveOnEnd) this.destroy();
return void this.player.emit("queueEnd", this);
}
const info = await YouTube.getVideo(track.url)
let info = await YouTube.getVideo(track.url)
.then((x) => x.videos[0])
.catch(Util.noop);
// fallback
if (!info)
info = await YouTube.search(track.author)
.then((x) => x[0])
.catch(Util.noop);
if (!info) {
if (this.options.leaveOnEnd) this.destroy();
return void this.player.emit("queueEnd", this);

View file

@ -52,8 +52,8 @@ const FilterList = {
vibrato: "vibrato=f=6.5",
reverse: "areverse",
treble: "treble=g=5",
normalizer: "dynaudnorm=g=101",
normalizer2: "acompressor",
normalizer2: "dynaudnorm=g=101",
normalizer: "acompressor",
surrounding: "surround",
pulsator: "apulsator=hz=1",
subboost: "asubboost",