Skip to content

Commit d80d565

Browse files
TeeSealamishshah
authored andcommitted
Don't use 'audioonly' for livestreams (#1)
1 parent 2e161fe commit d80d565

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ function filter(format) {
99

1010
module.exports = function download(url, options = {}) {
1111
return new Promise((resolve, reject) => {
12-
Object.assign(options, { filter: 'audioonly' });
1312
ytdl.getInfo(url, (err, info) => {
1413
if (err) return reject(err);
1514
// Prefer opus
1615
const canDemux = info.formats.find(filter) && info.length_seconds != 0;
1716
if (canDemux) Object.assign(options, { filter });
17+
else if (info.length_seconds != 0) Object.assign(options, { filter: 'audioonly' });
1818
const ytdlStream = ytdl.downloadFromInfo(info, options);
1919
if (canDemux) {
2020
const demuxer = new prism.opus.WebmDemuxer();

0 commit comments

Comments
 (0)