In befor code,
```js
if(opusFormats.length === 0){
type = StreamType.Arbitrary
final.push(audioFormat[audioFormat.length - 1])
}
else{
type = StreamType.WebmOpus
final.push(opusFormats[opusFormats.length - 1])
}
if(final.length === 0) {
type = StreamType.Arbitrary
final.push(info.format[info.format.length - 1])
}
```
length of final cannot be 0 coz it only check `opusFormats.length === 0`.
Why play-dl ?
ytdl-core has some issues with miniget and also stream abort issues. On the other hand, youtube-dl is a very perfect alternative but it takes time to launch. Hence, play-dl is created to avoid these issues along with providing comparatively faster performance than others.
Download videos/playlists or search for videos
This is a light-weight youtube downloader and searcher.
- searches by video, playlist, channel
- obtains audio playback url
Installation
npm install play-dl@latest
Importing
import * as play from 'play-dl' // ES-6 import or TS import
const play = require('play-dl') //JS importing
Instructions for Spotify are here
Examples
Docs
Description
Languages
TypeScript
100%