Save-YTdlpAudio
SYNOPSIS
Downloads a video as an audio file using the highest quality settings
SYNTAX
Save-YTdlpAudio [-Url] <String[]> [-OutputPath <String>] [-OutputTemplate <String>] [-AudioFormat <String>]
[-AudioQuality <String>] [-ConcurrentFragments <Int32>] [-NoOverwrites] [-NoPlaylist]
[-CookiesFromBrowser <String>] [-ExecutablePath <String>] [-FfmpegLocation <String>]
[-AdditionalArguments <String[]>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
[<CommonParameters>]
DESCRIPTION
The Save-YTdlpAudio function downloads the best available audio of a video & converts it to an audio format such as mp3 using the highest quality settings.
The following yt-dlp options are used: –format “bestaudio/best” –extract-audio –audio-format mp3 –audio-quality 0 –concurrent-fragments 12 –embed-metadata –embed-thumbnail –convert-thumbnails jpg
FFmpeg is required to convert the audio, use Install-YTdlp to install yt-dlp along with FFmpeg using winget.
EXAMPLES
EXAMPLE 1
Save-YTdlpAudio -Url 'https://www.youtube.com/watch?v=cE0wfjsybIQ'
Downloads the audio of the video as the highest quality mp3 into the current directory
EXAMPLE 2
Save-YTdlpAudio -Url 'https://www.youtube.com/watch?v=cE0wfjsybIQ' -AudioFormat flac -OutputPath 'C:\Music' -NoOverwrites -Verbose
Downloads the audio as a flac file, saves it to C:\Music, & skips files that already exist
EXAMPLE 3
'https://www.youtube.com/watch?v=cE0wfjsybIQ' | Save-YTdlpAudio -WhatIf
Shows the yt-dlp command line that would be run without downloading anything
PARAMETERS
-Url
One or more URLs of the videos to download
Type: String[]
Parameter Sets: (All)
Aliases: Uri
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
-OutputPath
The directory files are saved to
Default value: The current PowerShell location
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-OutputTemplate
The yt-dlp output filename template
Default value: %(title)s.%(ext)s
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: %(title)s.%(ext)s
Accept pipeline input: False
Accept wildcard characters: False
-AudioFormat
The audio format to convert to
Default value: mp3
Allowed values: ‘best’, ‘aac’, ‘alac’, ‘flac’, ‘m4a’, ‘mp3’, ‘opus’, ‘vorbis’, ‘wav’
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Mp3
Accept pipeline input: False
Accept wildcard characters: False
-AudioQuality
A value from 0 (best) to 10 (worst) for variable bitrate, or a bitrate such as 320K
Default value: 0
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
-ConcurrentFragments
The number of fragments of a DASH/HLS video to download concurrently
Default value: 12
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 12
Accept pipeline input: False
Accept wildcard characters: False
-NoOverwrites
Do not overwrite files that already exist
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-NoPlaylist
Download only the video if the URL refers to a video & a playlist
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-CookiesFromBrowser
The browser to load cookies from
Example: firefox or chrome:Profile 1
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ExecutablePath
Defines an explicit path to the yt-dlp executable
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-FfmpegLocation
The location of the ffmpeg binary or its directory
Only needed when ffmpeg is not found on the PATH
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-AdditionalArguments
Any additional raw yt-dlp command line arguments
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
System.String
OUTPUTS
System.IO.FileInfo
NOTES
Copyright 1990-2026 Celerium
NAME: Save-YTdlpAudio Type: Public
AUTHOR: David Schulte
DATE: 2025-11-11
EMAIL: celerium@Celerium.org
TODO: