We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4420ca1 commit 1745555Copy full SHA for 1745555
index.js
@@ -32,12 +32,14 @@ function download(url, options = {}) {
32
const demuxer = new prism.opus.WebmDemuxer();
33
return resolve(ytdl.downloadFromInfo(info, options).pipe(demuxer).on('end', () => demuxer.destroy()));
34
} else {
35
+ const bestFormat = nextBestFormat(info.formats);
36
+ if (!bestFormat) return reject('No suitable format found');
37
const transcoder = new prism.FFmpeg({
38
args: [
39
'-reconnect', '1',
40
'-reconnect_streamed', '1',
41
'-reconnect_delay_max', '5',
- '-i', nextBestFormat(info.formats).url,
42
+ '-i', bestFormat.url,
43
'-analyzeduration', '0',
44
'-loglevel', '0',
45
'-f', 's16le',
0 commit comments