Global

Type Definitions

ConvertAudioOptions

Options for configuring the audio conversion.

Type:
  • Object
Properties:
Name Type Attributes Default Description
inputOptions Array.<string> <optional>
[]

The input options for the conversion.

outputOptions Array.<string> <optional>
[]

The output options for the conversion.

format string <optional>
'mp3'

The desired output format (e.g., 'mp3', 'aac').

bitrate string | number <optional>
128

The audio bitrate (e.g., '128k'), it may be a number or a string with an optional k suffix.

frequency number <optional>
44100

The audio sampling frequency in Hz.

codec string <optional>
'libmp3lame'

The audio codec to use (e.g., 'libmp3lame').

channels number <optional>
2

The number of audio channels (2 for stereo).

deleteOld boolean <optional>
false

Whether to delete the original file after conversion.

quiet boolean <optional>
false

Whether to suppress the conversion progress and error message or not.

Since:
  • 1.0.0
Source:
See:

DownloadOptions

An object to configure the download process on singleDownload and batchDownload functions.

Type:
  • Object
Properties:
Name Type Attributes Default Description
cwd string <optional>
'.'

The current working directory. If not specified, defaults to the current directory.

outDir string <optional>
'.'

The output directory where downloaded files will be saved. If not specified, defaults to the current directory.

convertAudio boolean <optional>
true

Whether to convert the downloaded audio to a specified format. Defaults to true.

converterOptions ConvertAudioOptions <optional>
audiconv.defaultOptions

Options for the audio converter. If not specified, defaults to defaultOptions.

quiet boolean <optional>
false

Whether to suppress console output. Defaults to false.

Since:
  • 1.0.0
Source:

YTMP3Config

A typedef representating the configuration object containing options to configure the both download and audio conversion process.

Type:
  • Object
Properties:
Name Type Attributes Description
downloadOptions DownloadOptions

Options related to the download process.

audioConverterOptions ConvertAudioOptions <optional>

Options related to the audio conversion process, if not defined in downloadOptions. This field will be ignored if the downloadOptions.converterOptions property are defined and not contains a nullable value.

Since:
  • 1.0.0
Source: