Save-YTdlpVideo
SYNOPSIS
Downloads a video using the highest quality settings
SYNTAX
Save-YTdlpVideo [-Url] <String[]> [-OutputPath <String>] [-OutputTemplate <String>]
[-MergeOutputFormat <String>] [-FormatSort <String>] [-ConcurrentFragments <Int32>] [-NoOverwrites]
[-NoPlaylist] [-EmbedSubtitles] [-SubtitleLanguages <String[]>] [-CookiesFromBrowser <String>]
[-ExecutablePath <String>] [-FfmpegLocation <String>] [-AdditionalArguments <String[]>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
The Save-YTdlpVideo function downloads a video using the highest quality settings.
The following yt-dlp options are used: –format “bestvideo*+bestaudio/best” –format-sort “res,fps,hdr,vcodec,acodec,br” –merge-output-format mkv –concurrent-fragments 12 –embed-metadata –embed-chapters –embed-thumbnail –convert-thumbnails jpg
FFmpeg is required to merge the video & audio streams, use Install-YTdlp to install yt-dlp along with FFmpeg using winget.
EXAMPLES
EXAMPLE 1
Save-YTdlpVideo -Url 'https://www.youtube.com/watch?v=cE0wfjsybIQ'
Downloads the video using the highest settings into the current directory
EXAMPLE 2
Save-YTdlpVideo -Url 'https://www.youtube.com/watch?v=cE0wfjsybIQ' -OutputPath 'C:\Videos' -MergeOutputFormat mp4 -NoPlaylist
Downloads the video, merges it into a mp4, & saves it to C:\Videos
EXAMPLE 3
'https://www.youtube.com/watch?v=cE0wfjsybIQ' | Save-YTdlpVideo -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
-MergeOutputFormat
Container used when video & audio streams are merged
mkv supports every codec so it is the default to avoid re-encoding
Default value: mkv
Allowed values: ‘avi’, ‘flv’, ‘mkv’, ‘mov’, ‘mp4’, ‘webm’
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Mkv
Accept pipeline input: False
Accept wildcard characters: False
-FormatSort
Sort order used to pick the best format
Default value: res,fps,hdr,vcodec,acodec,br
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Res,fps,hdr,vcodec,acodec,br
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
-EmbedSubtitles
Embed subtitles in the file
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-SubtitleLanguages
The subtitle languages to download
Example: en.*,ja
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
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-YTdlpVideo Type: Public
AUTHOR: David Schulte
DATE: 2025-11-11
EMAIL: celerium@Celerium.org
TODO: