File tree 1 file changed +2
-3
lines changed
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ const prism = require('prism-media');
4
4
function filter ( format ) {
5
5
return format . audioEncoding === 'opus' &&
6
6
format . container === 'webm' &&
7
- format . audio_sample_rate == 48000 &&
8
- ! format . live ; // prism cannot yet play live webm files
7
+ format . audio_sample_rate == 48000 ;
9
8
}
10
9
11
10
module . exports = function download ( url , options = { } ) {
@@ -14,7 +13,7 @@ module.exports = function download(url, options = {}) {
14
13
ytdl . getInfo ( url , ( err , info ) => {
15
14
if ( err ) return reject ( err ) ;
16
15
// Prefer opus
17
- const canDemux = info . formats . find ( filter ) ;
16
+ const canDemux = info . formats . find ( filter ) && info . length_seconds != 0 ;
18
17
if ( canDemux ) Object . assign ( options , { filter } ) ;
19
18
const ytdlStream = ytdl . downloadFromInfo ( info , options ) ;
20
19
if ( canDemux ) {
You can’t perform that action at this time.
0 commit comments