ytdlp

package module
v0.0.0-...-632315d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 33 Imported by: 0

README

logo

🔗 Table of Contents

✨ Features

  • CLI bindings for yt-dlp -- including all flags/commands.
  • Optional Install* helpers to auto-download the latest supported version of yt-dlp, ffmpeg, ffprobe and bun, including proper checksum validation for secure downloads (yt-dlp only).
    • Worry less about making sure yt-dlp is installed wherever go-ytdlp is running from!
  • Carried over help documentation for all functions/methods.
  • Flags with arguments have type mappings according to what the actual flags expect.
  • Completely generated, ensuring it's easy to update to future yt-dlp versions.
  • Deprecated flags are marked as deprecated in a way that should be caught by most IDEs/linters.
  • Stdout/Stderr parsing, with timestamps, and optional JSON post-processing.

✨ Help Documentation Example

help documentation example


⚙ Usage

go get -u github.com/NexonSU/go-ytdlp@latest

👏 Examples

Simple

See also _examples/simple/main.go, which includes writing results (stdout/stderr/etc) as JSON.

package main

import (
	"context"

	"github.com/NexonSU/go-ytdlp"
)

func main() {
	// If yt-dlp isn't installed yet, download and cache it for further use.
	ytdlp.MustInstall(context.TODO(), nil)

	dl := ytdlp.New().
		FormatSort("res,ext:mp4:m4a").
		RecodeVideo("mp4").
		Output("%(extractor)s - %(title)s.%(ext)s")

	_, err := dl.Run(context.TODO(), "https://www.youtube.com/watch?v=dQw4w9WgXcQ")
	if err != nil {
		panic(err)
	}
}

Fancy UI using BubbleTea

This example shows how to use go-ytdlp and BubbleTea to create a fancy, though relatively simple, UI for downloading videos.

BubbleTea demo

Source: bubble-dl


📦 Install Function(s) & Binary Management

The Install* function helpers in go-ytdlp allow you to automatically download and cache the required binaries (yt-dlp, ffmpeg, ffprobe and bun) for your platform. This makes it easy to get started without manually installing these dependencies, and ensures the correct versions are used.

Note: Download/installation of ffmpeg, ffprobe and bun is only supported on a handful of platforms. It is still recommended to install them via other means if your platform is not listed below.

yt-dlp

OS/Arch Download Source
darwin_amd64 https://github.com/yt-dlp/yt-dlp
darwin_arm64 https://github.com/yt-dlp/yt-dlp
linux_amd64 https://github.com/yt-dlp/yt-dlp
linux_arm64 https://github.com/yt-dlp/yt-dlp
linux_armv7l https://github.com/yt-dlp/yt-dlp
windows_amd64 https://github.com/yt-dlp/yt-dlp

ffmpeg & ffprobe

OS/Arch ffmpeg/ffprobe Download Source
darwin_amd64 https://evermeet.cx/ffmpeg/
linux_amd64 https://github.com/yt-dlp/FFmpeg-Builds
linux_arm64 https://github.com/yt-dlp/FFmpeg-Builds
windows_amd64 https://github.com/yt-dlp/FFmpeg-Builds
windows_arm https://github.com/yt-dlp/FFmpeg-Builds

bun

OS/Arch bun Download Source
darwin_amd64 https://github.com/oven-sh/bun/releases/latest/download/bun-darwin-x64.zip
darwin_arm64 https://github.com/oven-sh/bun/releases/latest/download/bun-darwin-aarch64.zip
linux_amd64 https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64.zip
linux_arm64 https://github.com/oven-sh/bun/releases/latest/download/bun-linux-aarch64.zip
windows_amd64 https://github.com/oven-sh/bun/releases/latest/download/bun-windows-x64.zip
Using a different JS runtime

Multiple JavaScript runtimes are supported by yt-dlp, but they are disabled by default. You can add a different runtime to the list of enabled ones using .JsRuntimes("node") or clear the list using .NoJsRuntimes(). If no options are set, bun will be enabled by default.

Refer to the official documentation for more information.

FlagConfig: JSON to/from Flags Conversion & Usage

The FlagConfig type in go-ytdlp enables conversion between JSON and yt-dlp command-line flags. This is useful for scenarios such as HTTP APIs, web UIs, or persisting flag configurations in a database.

  • Bidirectional Conversion: Easily marshal and unmarshal yt-dlp flags to and from JSON. Use Command.SetFlagConfig and Command.GetFlagConfig to set/get the flag config.
  • Validation: Use the provided validation functions and JSON schema to ensure correctness. The JSON body allows duplicate flags (unless using the provided json schema), so always validate before use.
  • JSON Schema: The schema (available via the optiondata.JSONSchema variable and also located here) can be used for type generation in other languages (e.g. TypeScript) and for client-side validation (e.g. using something like json-schema-to-zod when working with a web UI).
  • Persistence: If storing flag configs in a database, note that yt-dlp flags can change or be removed at any time (in correlation to updates of go-ytdlp). Always validate after loading from storage.
    • If validation fails, clear the invalid values in the JSON before retrying (e.g. using the ErrMultipleJSONParsingFlags and ErrJSONParsingFlag error types, which include the path in the JSON where the issue occurred).
  • SupportedExtractors: If persisting the values from this generated type, remember that extractors can be changed or removed by yt-dlp at any time (in correlation to updates of go-ytdlp). If a user requests a retry and the extractor is missing, consider defaulting to generic or another fallback.
  • Intended Usage: FlagConfig is designed for JSON marshalling/unmarshalling only. It is not intended for direct use in Go code unless you are building HTTP servers, persisting configs, or similar use cases. The builder pattern should be used in all other cases.

Example: HTTP Server which Invokes go-ytdlp

You can find an example of how to use the FlagConfig type for HTTP server integration in the _examples/http-server directory.


🙋♂ Support & Assistance

  • ❤ Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
  • 🙋♂ Take a look at the support document on guidelines for tips on how to ask the right questions.
  • 🐞 For all features/bugs/issues/questions/etc, head over here.

🤝 Contributing

  • ❤ Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
  • 📋 Please review the contributing doc for submitting issues/a guide on submitting pull requests and helping out.
  • 🗝 For anything security related, please review this repositories security policy.

⚖ License

MIT License

Copyright (c) 2023 Liam Stanley <liam@liam.sh>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Also located here

Documentation

Index

Constants

View Source
const (
	// Channel of yt-dlp that go-ytdlp was generated with.
	Channel = "stable"

	// Version of yt-dlp that go-ytdlp was generated with.
	Version = "2025.12.08"
)

Variables

AllConcatPlaylistOptions are all of the possible values for the ConcatPlaylist option.

AllFixupOptions are all of the possible values for the Fixup option.

View Source
var SupportedExtractors = []*Extractor{}/* 1862 elements not displayed */

Functions

func GetCacheDir

func GetCacheDir() (string, error)

GetCacheDir returns the cache directory for go-ytdlp. Note that it may not be created yet.

func MustInstall

func MustInstall(ctx context.Context, opts *InstallOptions)

MustInstall is the same as Install, but will panic if an error occurs (essentially ensuring yt-dlp is installed, before continuing), and doesn't return any results.

func MustInstallBun

func MustInstallBun(ctx context.Context, opts *InstallBunOptions)

MustInstallBun is similar to InstallBun, but panics if there is an error.

func MustInstallFFmpeg

func MustInstallFFmpeg(ctx context.Context, opts *InstallFFmpegOptions)

MustInstallFFmpeg is similar to InstallFFmpeg, but panics if there is an error.

func MustInstallFFprobe

func MustInstallFFprobe(ctx context.Context, opts *InstallFFmpegOptions)

MustInstallFFprobe is similar to InstallFFprobe, but panics if there is an error.

func RemoveInstallCache

func RemoveInstallCache() error

RemoveInstallCache removes the cache directory for go-ytdlp, and clears in-memory install resolve caches for all binaries.

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

func New

func New() *Command

New is the recommended way to return a new yt-dlp command builder. Once all flags are set, you can call [Run] to invoke yt-dlp with the necessary args, or the independent execution method (e.g. Version).

func (*Command) AbortOnError

func (c *Command) AbortOnError() *Command

Abort downloading of further videos if an error occurs

Additional information:

  • See Command.UnsetAbortOnError, for unsetting the flag.
  • AbortOnError maps to cli flags: --abort-on-error/--no-ignore-errors.
  • From option group: "General"

func (*Command) AbortOnUnavailableFragments

func (c *Command) AbortOnUnavailableFragments() *Command

Abort download if a fragment is unavailable

Additional information:

  • See Command.UnsetAbortOnUnavailableFragments, for unsetting the flag.
  • AbortOnUnavailableFragments maps to cli flags: --abort-on-unavailable-fragments/--no-skip-unavailable-fragments.
  • From option group: "Download"

func (*Command) AddHeaders

func (c *Command) AddHeaders(fieldvalue string) *Command

Specify a custom HTTP header and its value, separated by a colon ":". You can use this option multiple times

Additional information:

  • See Command.UnsetAddHeaders, for unsetting the flag.
  • AddHeaders maps to cli flags: --add-headers=FIELD:VALUE.
  • From option group: "Workarounds"

func (*Command) AgeLimit

func (c *Command) AgeLimit(years int) *Command

Download only videos suitable for the given age

Additional information:

  • See Command.UnsetAgeLimit, for unsetting the flag.
  • AgeLimit maps to cli flags: --age-limit=YEARS.
  • From option group: "Video Selection"

func (*Command) AllFormats deprecated

func (c *Command) AllFormats() *Command

AllFormats sets the "all-formats" flag (no description specified).

Additional information:

  • See Command.UnsetAllFormats, for unsetting the flag.
  • AllFormats maps to cli flags: --all-formats (hidden).
  • From option group: "Video Format"

Deprecated: Use Command.Format with `all` as an argument.

func (*Command) AllSubs deprecated

func (c *Command) AllSubs() *Command

AllSubs sets the "all-subs" flag (no description specified).

Additional information:

  • See Command.UnsetAllSubs, for unsetting the flag.
  • AllSubs maps to cli flags: --all-subs (hidden).
  • From option group: "Subtitle"

Deprecated: Use Command.SubLangs with `all` as an argument, in addition to Command.WriteSubs.

func (*Command) AllowDynamicMPD

func (c *Command) AllowDynamicMPD() *Command

Process dynamic DASH manifests (default)

Additional information:

  • See Command.UnsetAllowDynamicMPD, for unsetting the flag.
  • AllowDynamicMPD maps to cli flags: --allow-dynamic-mpd/--no-ignore-dynamic-mpd.
  • From option group: "Extractor"

func (*Command) ApListMSO

func (c *Command) ApListMSO() *Command

List all supported multiple-system operators

Additional information:

  • See Command.UnsetApListMSO, for unsetting the flag.
  • ApListMSO maps to cli flags: --ap-list-mso.
  • From option group: "Authentication"

func (*Command) ApMSO

func (c *Command) ApMSO(mso string) *Command

Adobe Pass multiple-system operator (TV provider) identifier, use --ap-list-mso for a list of available MSOs

Additional information:

  • See Command.UnsetApMSO, for unsetting the flag.
  • ApMSO maps to cli flags: --ap-mso=MSO.
  • From option group: "Authentication"

func (*Command) ApPassword

func (c *Command) ApPassword(password string) *Command

Multiple-system operator account password. If this option is left out, yt-dlp will ask interactively

Additional information:

  • See Command.UnsetApPassword, for unsetting the flag.
  • ApPassword maps to cli flags: --ap-password=PASSWORD.
  • From option group: "Authentication"

func (*Command) ApUsername

func (c *Command) ApUsername(username string) *Command

Multiple-system operator account login

Additional information:

  • See Command.UnsetApUsername, for unsetting the flag.
  • ApUsername maps to cli flags: --ap-username=USERNAME.
  • From option group: "Authentication"

func (*Command) AudioFormat

func (c *Command) AudioFormat(format string) *Command

Format to convert the audio to when -x is used. (currently supported: best (default), aac, alac, flac, m4a, mp3, opus, vorbis, wav). You can specify multiple rules using similar syntax as --remux-video

Additional information:

  • See Command.UnsetAudioFormat, for unsetting the flag.
  • AudioFormat maps to cli flags: --audio-format=FORMAT.
  • From option group: "Post-Processing"

func (*Command) AudioMultistreams

func (c *Command) AudioMultistreams() *Command

Allow multiple audio streams to be merged into a single file

References:

Additional information:

  • See Command.UnsetAudioMultistreams, for unsetting the flag.
  • AudioMultistreams maps to cli flags: --audio-multistreams.
  • From option group: "Video Format"

func (*Command) AudioQuality

func (c *Command) AudioQuality(quality string) *Command

Specify ffmpeg audio quality to use when converting the audio with -x. Insert a value between 0 (best) and 10 (worst) for VBR or a specific bitrate like 128K (default 5)

Additional information:

  • See Command.UnsetAudioQuality, for unsetting the flag.
  • AudioQuality maps to cli flags: --audio-quality=QUALITY.
  • From option group: "Post-Processing"

func (*Command) AutoNumberSize deprecated

func (c *Command) AutoNumberSize(number int) *Command

AutoNumberSize sets the "autonumber-size" flag (no description specified).

Additional information:

  • See Command.UnsetAutoNumberSize, for unsetting the flag.
  • AutoNumberSize maps to cli flags: --autonumber-size=NUMBER (hidden).
  • From option group: "Filesystem"

Deprecated: Use string formatting, e.g. `%(autonumber)03d`.

func (*Command) AutoNumberStart deprecated

func (c *Command) AutoNumberStart(number int) *Command

AutoNumberStart sets the "autonumber-start" flag (no description specified).

Additional information:

  • See Command.UnsetAutoNumberStart, for unsetting the flag.
  • AutoNumberStart maps to cli flags: --autonumber-start=NUMBER (hidden).
  • From option group: "Filesystem"

Deprecated: Use internal field formatting like `%(autonumber+NUMBER)s`.

func (*Command) BatchFile

func (c *Command) BatchFile(file string) *Command

File containing URLs to download ("-" for stdin), one URL per line. Lines starting with "#", ";" or "]" are considered as comments and ignored

Additional information:

  • See Command.UnsetBatchFile, for unsetting the flag.
  • BatchFile maps to cli flags: -a/--batch-file=FILE.
  • From option group: "Filesystem"

func (*Command) BidiWorkaround

func (c *Command) BidiWorkaround() *Command

Work around terminals that lack bidirectional text support. Requires bidiv or fribidi executable in PATH

Additional information:

  • See Command.UnsetBidiWorkaround, for unsetting the flag.
  • BidiWorkaround maps to cli flags: --bidi-workaround.
  • From option group: "Workarounds"

func (*Command) BreakMatchFilters

func (c *Command) BreakMatchFilters(filter string) *Command

Same as "--match-filters" but stops the download process when a video is rejected

Additional information:

  • See Command.UnsetBreakMatchFilters, for unsetting the flag.
  • BreakMatchFilters maps to cli flags: --break-match-filters=FILTER.
  • From option group: "Video Selection"

func (*Command) BreakOnExisting

func (c *Command) BreakOnExisting() *Command

Stop the download process when encountering a file that is in the archive supplied with the --download-archive option

Additional information:

  • See Command.UnsetBreakOnExisting, for unsetting the flag.
  • BreakOnExisting maps to cli flags: --break-on-existing.
  • From option group: "Video Selection"

func (*Command) BreakOnReject deprecated

func (c *Command) BreakOnReject() *Command

BreakOnReject sets the "break-on-reject" flag (no description specified).

Additional information:

  • See Command.UnsetBreakOnReject, for unsetting the flag.
  • BreakOnReject maps to cli flags: --break-on-reject (hidden).
  • From option group: "Video Selection"

Deprecated: Use Command.BreakMatchFilters instead.

func (*Command) BreakPerInput

func (c *Command) BreakPerInput() *Command

Alters --max-downloads, --break-on-existing, --break-match-filters, and autonumber to reset per input URL

Additional information:

  • See Command.UnsetBreakPerInput, for unsetting the flag.
  • BreakPerInput maps to cli flags: --break-per-input.
  • From option group: "Video Selection"

func (*Command) BufferSize

func (c *Command) BufferSize(size string) *Command

Size of download buffer, e.g. 1024 or 16K (default is 1024)

Additional information:

  • See Command.UnsetBufferSize, for unsetting the flag.
  • BufferSize maps to cli flags: --buffer-size=SIZE.
  • From option group: "Download"

func (*Command) BuildCommand

func (c *Command) BuildCommand(ctx context.Context, args ...string) *exec.Cmd

BuildCommand builds the command to be executed. args passed here are any additional arguments to be passed to yt-dlp (commonly URLs or similar). This should not be used directly unless you want to reference the arguments passed to yt-dlp.

func (*Command) CacheDir

func (c *Command) CacheDir(dir string) *Command

Location in the filesystem where yt-dlp can store some downloaded information (such as client ids and signatures) permanently. By default ${XDG_CACHE_HOME}/yt-dlp

Additional information:

  • See Command.UnsetCacheDir, for unsetting the flag.
  • CacheDir maps to cli flags: --cache-dir=DIR.
  • From option group: "Filesystem"

func (*Command) CheckAllFormats

func (c *Command) CheckAllFormats() *Command

Check all formats for whether they are actually downloadable

Additional information:

  • See Command.UnsetCheckAllFormats, for unsetting the flag.
  • CheckAllFormats maps to cli flags: --check-all-formats.
  • From option group: "Video Format"

func (*Command) CheckFormats

func (c *Command) CheckFormats() *Command

Make sure formats are selected only from those that are actually downloadable

Additional information:

  • See Command.UnsetCheckFormats, for unsetting the flag.
  • CheckFormats maps to cli flags: --check-formats.
  • From option group: "Video Format"

func (*Command) CleanInfoJSON

func (c *Command) CleanInfoJSON() *Command

Remove some internal metadata such as filenames from the infojson (default)

Additional information:

  • See Command.UnsetCleanInfoJSON, for unsetting the flag.
  • CleanInfoJSON maps to cli flags: --clean-info-json/--clean-infojson.
  • From option group: "Filesystem"

func (*Command) ClientCertificate

func (c *Command) ClientCertificate(certfile string) *Command

Path to client certificate file in PEM format. May include the private key

Additional information:

  • See Command.UnsetClientCertificate, for unsetting the flag.
  • ClientCertificate maps to cli flags: --client-certificate=CERTFILE.
  • From option group: "Authentication"

func (*Command) ClientCertificateKey

func (c *Command) ClientCertificateKey(keyfile string) *Command

Path to private key file for client certificate

Additional information:

  • See Command.UnsetClientCertificateKey, for unsetting the flag.
  • ClientCertificateKey maps to cli flags: --client-certificate-key=KEYFILE.
  • From option group: "Authentication"

func (*Command) ClientCertificatePassword

func (c *Command) ClientCertificatePassword(password string) *Command

Password for client certificate private key, if encrypted. If not provided, and the key is encrypted, yt-dlp will ask interactively

Additional information:

  • See Command.UnsetClientCertificatePassword, for unsetting the flag.
  • ClientCertificatePassword maps to cli flags: --client-certificate-password=PASSWORD.
  • From option group: "Authentication"

func (*Command) Clone

func (c *Command) Clone() *Command

Clone returns a copy of the command, with all flags, env vars, executable, working directory, etc copied over.

func (*Command) Color

func (c *Command) Color(policy string) *Command

Whether to emit color codes in output, optionally prefixed by the STREAM (stdout or stderr) to apply the setting to. Can be one of "always", "auto" (default), "never", or "no_color" (use non color terminal sequences). Use "auto-tty" or "no_color-tty" to decide based on terminal support only. Can be used multiple times

Additional information:

  • See Command.UnsetColor, for unsetting the flag.
  • Color maps to cli flags: --color=[STREAM:]POLICY.
  • From option group: "General"

func (*Command) CompatOptions

func (c *Command) CompatOptions(opts string) *Command

Options that can help keep compatibility with youtube-dl or youtube-dlc configurations by reverting some of the changes made in yt-dlp. See "Differences in default behavior" for details

References:

Additional information:

  • See Command.UnsetCompatOptions, for unsetting the flag.
  • CompatOptions maps to cli flags: --compat-options=OPTS.
  • From option group: "General"

func (*Command) ConcatPlaylist

func (c *Command) ConcatPlaylist(policy ConcatPlaylistOption) *Command

Concatenate videos in a playlist. One of "never", "always", or "multi_video" (default; only when the videos form a single show). All the video files must have the same codecs and number of streams to be concatenable. The "pl_video:" prefix can be used with "--paths" and "--output" to set the output filename for the concatenated files. See "OUTPUT TEMPLATE" for details

References:

Additional information:

  • See Command.UnsetConcatPlaylist, for unsetting the flag.
  • ConcatPlaylist maps to cli flags: --concat-playlist=POLICY.
  • From option group: "Post-Processing"

func (*Command) ConcurrentFragments

func (c *Command) ConcurrentFragments(n int) *Command

Number of fragments of a dash/hlsnative video that should be downloaded concurrently (default is 1)

Additional information:

  • See Command.UnsetConcurrentFragments, for unsetting the flag.
  • ConcurrentFragments maps to cli flags: -N/--concurrent-fragments=N.
  • From option group: "Download"

func (*Command) ConfigLocations

func (c *Command) ConfigLocations(path string) *Command

Location of the main configuration file; either the path to the config or its containing directory ("-" for stdin). Can be used multiple times and inside other configuration files

Additional information:

  • See Command.UnsetConfigLocations, for unsetting the flag.
  • ConfigLocations maps to cli flags: --config-locations=PATH.
  • From option group: "General"

func (*Command) ConsoleTitle

func (c *Command) ConsoleTitle() *Command

Display progress in console titlebar

Additional information:

  • See Command.UnsetConsoleTitle, for unsetting the flag.
  • ConsoleTitle maps to cli flags: --console-title.
  • From option group: "Verbosity Simulation"

func (*Command) Continue

func (c *Command) Continue() *Command

Resume partially downloaded files/fragments (default)

Additional information:

  • See Command.UnsetContinue, for unsetting the flag.
  • Continue maps to cli flags: -c/--continue.
  • From option group: "Filesystem"

func (*Command) ConvertSubs

func (c *Command) ConvertSubs(format string) *Command

Convert the subtitles to another format (currently supported: ass, lrc, srt, vtt). Use "--convert-subs none" to disable conversion (default)

Additional information:

  • See Command.UnsetConvertSubs, for unsetting the flag.
  • ConvertSubs maps to cli flags: --convert-subs/--convert-sub/--convert-subtitles=FORMAT.
  • From option group: "Post-Processing"

func (*Command) ConvertThumbnails

func (c *Command) ConvertThumbnails(format string) *Command

Convert the thumbnails to another format (currently supported: jpg, png, webp). You can specify multiple rules using similar syntax as "--remux-video". Use "--convert-thumbnails none" to disable conversion (default)

Additional information:

  • See Command.UnsetConvertThumbnails, for unsetting the flag.
  • ConvertThumbnails maps to cli flags: --convert-thumbnails=FORMAT.
  • From option group: "Post-Processing"

func (*Command) Cookies

func (c *Command) Cookies(file string) *Command

Netscape formatted file to read cookies from and dump cookie jar in

Additional information:

  • See Command.UnsetCookies, for unsetting the flag.
  • Cookies maps to cli flags: --cookies=FILE.
  • From option group: "Filesystem"

func (*Command) CookiesFromBrowser

func (c *Command) CookiesFromBrowser(browser string) *Command

The name of the browser to load cookies from. Currently supported browsers are: brave, chrome, chromium, edge, firefox, opera, safari, vivaldi, whale. Optionally, the KEYRING used for decrypting Chromium cookies on Linux, the name/path of the PROFILE to load cookies from, and the CONTAINER name (if Firefox) ("none" for no container) can be given with their respective separators. By default, all containers of the most recently accessed profile are used. Currently supported keyrings are: basictext, gnomekeyring, kwallet, kwallet5, kwallet6

Additional information:

  • See Command.UnsetCookiesFromBrowser, for unsetting the flag.
  • CookiesFromBrowser maps to cli flags: --cookies-from-browser=BROWSER[+KEYRING][:PROFILE][::CONTAINER].
  • From option group: "Filesystem"

func (*Command) Date

func (c *Command) Date(date string) *Command

Download only videos uploaded on this date. The date can be "YYYYMMDD" or in the format [now|today|yesterday][-N[day|week|month|year]]. E.g. "--date today-2weeks" downloads only videos uploaded on the same day two weeks ago

Additional information:

  • See Command.UnsetDate, for unsetting the flag.
  • Date maps to cli flags: --date=DATE.
  • From option group: "Video Selection"

func (*Command) DateAfter

func (c *Command) DateAfter(date string) *Command

Download only videos uploaded on or after this date. The date formats accepted are the same as --date

Additional information:

  • See Command.UnsetDateAfter, for unsetting the flag.
  • DateAfter maps to cli flags: --dateafter=DATE.
  • From option group: "Video Selection"

func (*Command) DateBefore

func (c *Command) DateBefore(date string) *Command

Download only videos uploaded on or before this date. The date formats accepted are the same as --date

Additional information:

  • See Command.UnsetDateBefore, for unsetting the flag.
  • DateBefore maps to cli flags: --datebefore=DATE.
  • From option group: "Video Selection"

func (*Command) DefaultSearch

func (c *Command) DefaultSearch(prefix string) *Command

Use this prefix for unqualified URLs. E.g. "gvsearch2:python" downloads two videos from google videos for the search term "python". Use the value "auto" to let yt-dlp guess ("auto_warning" to emit a warning when guessing). "error" just throws an error. The default value "fixup_error" repairs broken URLs, but emits an error if this is not possible instead of searching

Additional information:

  • See Command.UnsetDefaultSearch, for unsetting the flag.
  • DefaultSearch maps to cli flags: --default-search=PREFIX.
  • From option group: "General"

func (*Command) DownloadArchive

func (c *Command) DownloadArchive(file string) *Command

Download only videos not listed in the archive file. Record the IDs of all downloaded videos in it

Additional information:

  • See Command.UnsetDownloadArchive, for unsetting the flag.
  • DownloadArchive maps to cli flags: --download-archive=FILE.
  • From option group: "Video Selection"

func (*Command) DownloadSections

func (c *Command) DownloadSections(regex string) *Command

Download only chapters that match the regular expression. A "*" prefix denotes time-range instead of chapter. Negative timestamps are calculated from the end. "*from-url" can be used to download between the "start_time" and "end_time" extracted from the URL. Needs ffmpeg. This option can be used multiple times to download multiple sections, e.g. --download-sections "*10:15-inf" --download-sections "intro"

Additional information:

  • See Command.UnsetDownloadSections, for unsetting the flag.
  • DownloadSections maps to cli flags: --download-sections=REGEX.
  • From option group: "Download"

func (*Command) Downloader

func (c *Command) Downloader(name string) *Command

Name or path of the external downloader to use (optionally) prefixed by the protocols (http, ftp, m3u8, dash, rstp, rtmp, mms) to use it for. Currently supports native, aria2c, axel, curl, ffmpeg, httpie, wget. You can use this option multiple times to set different downloaders for different protocols. E.g. --downloader aria2c --downloader "dash,m3u8:native" will use aria2c for http/ftp downloads, and the native downloader for dash/m3u8 downloads

Additional information:

  • See Command.UnsetDownloader, for unsetting the flag.
  • Downloader maps to cli flags: --downloader/--external-downloader=[PROTO:]NAME.
  • From option group: "Download"

func (*Command) DownloaderArgs

func (c *Command) DownloaderArgs(nameargs string) *Command

Give these arguments to the external downloader. Specify the downloader name and the arguments separated by a colon ":". For ffmpeg, arguments can be passed to different positions using the same syntax as --postprocessor-args. You can use this option multiple times to give different arguments to different downloaders

Additional information:

  • See Command.UnsetDownloaderArgs, for unsetting the flag.
  • DownloaderArgs maps to cli flags: --downloader-args/--external-downloader-args=NAME:ARGS.
  • From option group: "Download"

func (*Command) DumpJSON

func (c *Command) DumpJSON() *Command

Quiet, but print JSON information for each video. Simulate unless --no-simulate is used. See "OUTPUT TEMPLATE" for a description of available keys

References:

Additional information:

  • See Command.UnsetDumpJSON, for unsetting the flag.
  • DumpJSON maps to cli flags: -j/--dump-json.
  • From option group: "Verbosity Simulation"

func (*Command) DumpPages

func (c *Command) DumpPages() *Command

Print downloaded pages encoded using base64 to debug problems (very verbose)

Additional information:

  • See Command.UnsetDumpPages, for unsetting the flag.
  • DumpPages maps to cli flags: --dump-pages.
  • From option group: "Verbosity Simulation"

func (*Command) DumpSingleJSON

func (c *Command) DumpSingleJSON() *Command

Quiet, but print JSON information for each URL or infojson passed. Simulate unless --no-simulate is used. If the URL refers to a playlist, the whole playlist information is dumped in a single line

Additional information:

  • See Command.UnsetDumpSingleJSON, for unsetting the flag.
  • DumpSingleJSON maps to cli flags: -J/--dump-single-json.
  • From option group: "Verbosity Simulation"

func (*Command) EmbedChapters

func (c *Command) EmbedChapters() *Command

Add chapter markers to the video file

Additional information:

  • See Command.UnsetEmbedChapters, for unsetting the flag.
  • EmbedChapters maps to cli flags: --embed-chapters/--add-chapters.
  • From option group: "Post-Processing"

func (*Command) EmbedInfoJSON

func (c *Command) EmbedInfoJSON() *Command

Embed the infojson as an attachment to mkv/mka video files

Additional information:

  • See Command.UnsetEmbedInfoJSON, for unsetting the flag.
  • EmbedInfoJSON maps to cli flags: --embed-info-json.
  • From option group: "Post-Processing"

func (*Command) EmbedMetadata

func (c *Command) EmbedMetadata() *Command

Embed metadata to the video file. Also embeds chapters/infojson if present unless --no-embed-chapters/--no-embed-info-json are used

Additional information:

  • See Command.UnsetEmbedMetadata, for unsetting the flag.
  • EmbedMetadata maps to cli flags: --embed-metadata/--add-metadata.
  • From option group: "Post-Processing"

func (*Command) EmbedSubs

func (c *Command) EmbedSubs() *Command

Embed subtitles in the video (only for mp4, webm and mkv videos)

Additional information:

  • See Command.UnsetEmbedSubs, for unsetting the flag.
  • EmbedSubs maps to cli flags: --embed-subs.
  • From option group: "Post-Processing"

func (*Command) EmbedThumbnail

func (c *Command) EmbedThumbnail() *Command

Embed thumbnail in the video as cover art

Additional information:

  • See Command.UnsetEmbedThumbnail, for unsetting the flag.
  • EmbedThumbnail maps to cli flags: --embed-thumbnail.
  • From option group: "Post-Processing"

func (*Command) EnableFileURLs

func (c *Command) EnableFileURLs() *Command

Enable file:// URLs. This is disabled by default for security reasons.

Additional information:

  • See Command.UnsetEnableFileURLs, for unsetting the flag.
  • EnableFileURLs maps to cli flags: --enable-file-urls.
  • From option group: "Network"

func (*Command) Encoding

func (c *Command) Encoding(encoding string) *Command

Force the specified encoding (experimental)

Additional information:

  • See Command.UnsetEncoding, for unsetting the flag.
  • Encoding maps to cli flags: --encoding=ENCODING.
  • From option group: "Workarounds"

func (*Command) Exec

func (c *Command) Exec(cmd string) *Command

Execute a command, optionally prefixed with when to execute it, separated by a ":". Supported values of "WHEN" are the same as that of --use-postprocessor (default: after_move). The same syntax as the output template can be used to pass any field as arguments to the command. If no fields are passed, %(filepath,_filename|)q is appended to the end of the command. This option can be used multiple times

Additional information:

  • See Command.UnsetExec, for unsetting the flag.
  • Exec maps to cli flags: --exec=[WHEN:]CMD.
  • From option group: "Post-Processing"

func (*Command) ExecBeforeDownload deprecated

func (c *Command) ExecBeforeDownload(cmd string) *Command

ExecBeforeDownload sets the "exec-before-download" flag (no description specified).

Additional information:

  • See Command.UnsetExecBeforeDownload, for unsetting the flag.
  • ExecBeforeDownload maps to cli flags: --exec-before-download=CMD (hidden).
  • From option group: "Post-Processing"

Deprecated: Use Command.Exec with `before_dl:CMD` as an argument.

func (*Command) ExtractAudio

func (c *Command) ExtractAudio() *Command

Convert video files to audio-only files (requires ffmpeg and ffprobe)

Additional information:

  • See Command.UnsetExtractAudio, for unsetting the flag.
  • ExtractAudio maps to cli flags: -x/--extract-audio.
  • From option group: "Post-Processing"

func (*Command) ExtractorArgs

func (c *Command) ExtractorArgs(ieKeyargs string) *Command

Pass ARGS arguments to the IE_KEY extractor. See "EXTRACTOR ARGUMENTS" for details. You can use this option multiple times to give arguments for different extractors

References:

Additional information:

  • See Command.UnsetExtractorArgs, for unsetting the flag.
  • ExtractorArgs maps to cli flags: --extractor-args=IE_KEY:ARGS.
  • From option group: "Extractor"

func (*Command) ExtractorDescriptions

func (c *Command) ExtractorDescriptions(ctx context.Context) (*Result, error)

Output descriptions of all supported extractors and exit

Additional information:

  • ExtractorDescriptions maps to cli flags: --extractor-descriptions.
  • From option group: "General"

func (*Command) ExtractorRetries

func (c *Command) ExtractorRetries(retries string) *Command

Number of retries for known extractor errors (default is 3), or "infinite"

Additional information:

  • See Command.UnsetExtractorRetries, for unsetting the flag.
  • ExtractorRetries maps to cli flags: --extractor-retries=RETRIES.
  • From option group: "Extractor"

func (*Command) FFmpegLocation

func (c *Command) FFmpegLocation(path string) *Command

Location of the ffmpeg binary; either the path to the binary or its containing directory

Additional information:

  • See Command.UnsetFFmpegLocation, for unsetting the flag.
  • FFmpegLocation maps to cli flags: --ffmpeg-location=PATH.
  • From option group: "Post-Processing"

func (*Command) FileAccessRetries

func (c *Command) FileAccessRetries(retries string) *Command

Number of times to retry on file access error (default is 3), or "infinite"

Additional information:

  • See Command.UnsetFileAccessRetries, for unsetting the flag.
  • FileAccessRetries maps to cli flags: --file-access-retries=RETRIES.
  • From option group: "Download"

func (*Command) Fixup

func (c *Command) Fixup(policy FixupOption) *Command

Automatically correct known faults of the file. One of never (do nothing), warn (only emit a warning), detect_or_warn (the default; fix the file if we can, warn otherwise), force (try fixing even if the file already exists)

Additional information:

  • See Command.UnsetFixup, for unsetting the flag.
  • Fixup maps to cli flags: --fixup=POLICY.
  • From option group: "Post-Processing"

func (*Command) FlatPlaylist

func (c *Command) FlatPlaylist() *Command

Do not extract a playlist's URL result entries; some entry metadata may be missing and downloading may be bypassed

Additional information:

  • See Command.UnsetFlatPlaylist, for unsetting the flag.
  • FlatPlaylist maps to cli flags: --flat-playlist.
  • From option group: "General"

func (*Command) ForceGenericExtractor deprecated

func (c *Command) ForceGenericExtractor() *Command

ForceGenericExtractor sets the "force-generic-extractor" flag (no description specified).

Additional information:

  • See Command.UnsetForceGenericExtractor, for unsetting the flag.
  • ForceGenericExtractor maps to cli flags: --force-generic-extractor (hidden).
  • From option group: "General"

Deprecated: Use Command.UseExtractors with `generic,default` as an argument.

func (*Command) ForceIPv4

func (c *Command) ForceIPv4() *Command

Make all connections via IPv4

Additional information:

  • See Command.UnsetForceIPv4, for unsetting the flag.
  • ForceIPv4 maps to cli flags: -4/--force-ipv4.
  • From option group: "Network"

func (*Command) ForceIPv6

func (c *Command) ForceIPv6() *Command

Make all connections via IPv6

Additional information:

  • See Command.UnsetForceIPv6, for unsetting the flag.
  • ForceIPv6 maps to cli flags: -6/--force-ipv6.
  • From option group: "Network"

func (*Command) ForceKeyframesAtCuts

func (c *Command) ForceKeyframesAtCuts() *Command

Force keyframes at cuts when downloading/splitting/removing sections. This is slow due to needing a re-encode, but the resulting video may have fewer artifacts around the cuts

Additional information:

  • See Command.UnsetForceKeyframesAtCuts, for unsetting the flag.
  • ForceKeyframesAtCuts maps to cli flags: --force-keyframes-at-cuts.
  • From option group: "Post-Processing"

func (*Command) ForceOverwrites

func (c *Command) ForceOverwrites() *Command

Overwrite all video and metadata files. This option includes --no-continue

Additional information:

  • See Command.UnsetForceOverwrites, for unsetting the flag.
  • ForceOverwrites maps to cli flags: --force-overwrites/--yes-overwrites.
  • From option group: "Filesystem"

func (*Command) ForceWriteArchive

func (c *Command) ForceWriteArchive() *Command

Force download archive entries to be written as far as no errors occur, even if -s or another simulation option is used

Additional information:

  • See Command.UnsetForceWriteArchive, for unsetting the flag.
  • ForceWriteArchive maps to cli flags: --force-write-archive/--force-write-download-archive/--force-download-archive.
  • From option group: "Verbosity Simulation"

func (*Command) Format

func (c *Command) Format(format string) *Command

Video format code, see "FORMAT SELECTION" for more details

References:

Additional information:

  • See Command.UnsetFormat, for unsetting the flag.
  • Format maps to cli flags: -f/--format=FORMAT.
  • From option group: "Video Format"

func (*Command) FormatSort

func (c *Command) FormatSort(sortorder string) *Command

Sort the formats by the fields given, see "Sorting Formats" for more details

References:

Additional information:

  • See Command.UnsetFormatSort, for unsetting the flag.
  • FormatSort maps to cli flags: -S/--format-sort=SORTORDER.
  • From option group: "Video Format"

func (*Command) FormatSortForce

func (c *Command) FormatSortForce() *Command

Force user specified sort order to have precedence over all fields, see "Sorting Formats" for more details

References:

Additional information:

  • See Command.UnsetFormatSortForce, for unsetting the flag.
  • FormatSortForce maps to cli flags: --format-sort-force/--S-force=FORMAT.
  • From option group: "Video Format"

func (*Command) FragmentRetries

func (c *Command) FragmentRetries(retries string) *Command

Number of retries for a fragment (default is 10), or "infinite" (DASH, hlsnative and ISM)

Additional information:

  • See Command.UnsetFragmentRetries, for unsetting the flag.
  • FragmentRetries maps to cli flags: --fragment-retries=RETRIES.
  • From option group: "Download"

func (*Command) GeoBypass deprecated

func (c *Command) GeoBypass() *Command

GeoBypass sets the "geo-bypass" flag (no description specified).

Additional information:

  • See Command.UnsetGeoBypass, for unsetting the flag.
  • GeoBypass maps to cli flags: --geo-bypass (hidden).
  • From option group: "Geo-restriction"

Deprecated: Use Command.XFF with `default` as an argument.

func (*Command) GeoBypassCountry deprecated

func (c *Command) GeoBypassCountry(code string) *Command

GeoBypassCountry sets the "geo-bypass-country" flag (no description specified).

Additional information:

  • See Command.UnsetGeoBypassCountry, for unsetting the flag.
  • GeoBypassCountry maps to cli flags: --geo-bypass-country=CODE (hidden).
  • From option group: "Geo-restriction"

Deprecated: Use Command.XFF with `CODE` as an argument.

func (*Command) GeoBypassIPBlock deprecated

func (c *Command) GeoBypassIPBlock(ipBlock string) *Command

GeoBypassIPBlock sets the "geo-bypass-ip-block" flag (no description specified).

Additional information:

  • See Command.UnsetGeoBypassIPBlock, for unsetting the flag.
  • GeoBypassIPBlock maps to cli flags: --geo-bypass-ip-block=IP_BLOCK (hidden).
  • From option group: "Geo-restriction"

Deprecated: Use Command.XFF with `IP_BLOCK` as an argument.

func (*Command) GeoVerificationProxy

func (c *Command) GeoVerificationProxy(url string) *Command

Use this proxy to verify the IP address for some geo-restricted sites. The default proxy specified by --proxy (or none, if the option is not present) is used for the actual downloading

Additional information:

  • See Command.UnsetGeoVerificationProxy, for unsetting the flag.
  • GeoVerificationProxy maps to cli flags: --geo-verification-proxy=URL.
  • From option group: "Geo-restriction"

func (*Command) GetDescription deprecated

func (c *Command) GetDescription() *Command

GetDescription sets the "get-description" flag (no description specified).

Additional information:

  • See Command.UnsetGetDescription, for unsetting the flag.
  • GetDescription maps to cli flags: --get-description (hidden).
  • From option group: "Verbosity Simulation"

Deprecated: Use Command.Print with `description` as an argument.

func (*Command) GetDuration deprecated

func (c *Command) GetDuration() *Command

GetDuration sets the "get-duration" flag (no description specified).

Additional information:

  • See Command.UnsetGetDuration, for unsetting the flag.
  • GetDuration maps to cli flags: --get-duration (hidden).
  • From option group: "Verbosity Simulation"

Deprecated: Use Command.Print with `duration_string` as an argument.

func (*Command) GetFilename deprecated

func (c *Command) GetFilename() *Command

GetFilename sets the "get-filename" flag (no description specified).

Additional information:

  • See Command.UnsetGetFilename, for unsetting the flag.
  • GetFilename maps to cli flags: --get-filename (hidden).
  • From option group: "Verbosity Simulation"

Deprecated: Use Command.Print with `filename` as an argument.

func (*Command) GetFlagConfig

func (c *Command) GetFlagConfig() *FlagConfig

GetFlagConfig returns a copy of the flag config.

func (*Command) GetFormat deprecated

func (c *Command) GetFormat() *Command

GetFormat sets the "get-format" flag (no description specified).

Additional information:

  • See Command.UnsetGetFormat, for unsetting the flag.
  • GetFormat maps to cli flags: --get-format (hidden).
  • From option group: "Verbosity Simulation"

Deprecated: Use Command.Print with `format` as an argument.

func (*Command) GetID deprecated

func (c *Command) GetID() *Command

GetID sets the "get-id" flag (no description specified).

Additional information:

  • See Command.UnsetGetID, for unsetting the flag.
  • GetID maps to cli flags: --get-id (hidden).
  • From option group: "Verbosity Simulation"

Deprecated: Use Command.Print with `id` as an argument.

func (*Command) GetThumbnail deprecated

func (c *Command) GetThumbnail() *Command

GetThumbnail sets the "get-thumbnail" flag (no description specified).

Additional information:

  • See Command.UnsetGetThumbnail, for unsetting the flag.
  • GetThumbnail maps to cli flags: --get-thumbnail (hidden).
  • From option group: "Verbosity Simulation"

Deprecated: Use Command.Print with `thumbnail` as an argument.

func (*Command) GetTitle deprecated

func (c *Command) GetTitle() *Command

GetTitle sets the "get-title" flag (no description specified).

Additional information:

  • See Command.UnsetGetTitle, for unsetting the flag.
  • GetTitle maps to cli flags: -e/--get-title (hidden).
  • From option group: "Verbosity Simulation"

Deprecated: Use Command.Print with `title` as an argument.

func (*Command) GetURL deprecated

func (c *Command) GetURL() *Command

GetURL sets the "get-url" flag (no description specified).

Additional information:

  • See Command.UnsetGetURL, for unsetting the flag.
  • GetURL maps to cli flags: -g/--get-url (hidden).
  • From option group: "Verbosity Simulation"

Deprecated: Use Command.Print with `urls` as an argument.

func (*Command) HLSPreferFFmpeg deprecated

func (c *Command) HLSPreferFFmpeg() *Command

HLSPreferFFmpeg sets the "hls-prefer-ffmpeg" flag (no description specified).

Additional information:

  • See Command.UnsetHLSPreferFFmpeg, for unsetting the flag.
  • HLSPreferFFmpeg maps to cli flags: --hls-prefer-ffmpeg (hidden).
  • From option group: "Download"

Deprecated: Use Command.Downloader with `m3u8:ffmpeg` as an argument.

func (*Command) HLSPreferNative deprecated

func (c *Command) HLSPreferNative() *Command

HLSPreferNative sets the "hls-prefer-native" flag (no description specified).

Additional information:

  • See Command.UnsetHLSPreferNative, for unsetting the flag.
  • HLSPreferNative maps to cli flags: --hls-prefer-native (hidden).
  • From option group: "Download"

Deprecated: Use Command.Downloader with `m3u8:native` as an argument.

func (*Command) HLSSplitDiscontinuity

func (c *Command) HLSSplitDiscontinuity() *Command

Split HLS playlists to different formats at discontinuities such as ad breaks

Additional information:

func (*Command) HLSUseMPEGTS

func (c *Command) HLSUseMPEGTS() *Command

Use the mpegts container for HLS videos; allowing some players to play the video while downloading, and reducing the chance of file corruption if download is interrupted. This is enabled by default for live streams

Additional information:

  • See Command.UnsetHLSUseMPEGTS, for unsetting the flag.
  • HLSUseMPEGTS maps to cli flags: --hls-use-mpegts.
  • From option group: "Download"

func (*Command) HTTPChunkSize

func (c *Command) HTTPChunkSize(size string) *Command

Size of a chunk for chunk-based HTTP downloading, e.g. 10485760 or 10M (default is disabled). May be useful for bypassing bandwidth throttling imposed by a webserver (experimental)

Additional information:

  • See Command.UnsetHTTPChunkSize, for unsetting the flag.
  • HTTPChunkSize maps to cli flags: --http-chunk-size=SIZE.
  • From option group: "Download"

func (*Command) ID deprecated

func (c *Command) ID() *Command

ID sets the "id" flag (no description specified).

Additional information:

  • See Command.UnsetID, for unsetting the flag.
  • ID maps to cli flags: --id (hidden).
  • From option group: "Filesystem"

Deprecated: Use Command.Output with `%(id)s.%(ext)s` as an argument.

func (*Command) IgnoreConfig

func (c *Command) IgnoreConfig() *Command

Don't load any more configuration files except those given to --config-locations. For backward compatibility, if this option is found inside the system configuration file, the user configuration is not loaded.

Additional information:

  • See Command.UnsetIgnoreConfig, for unsetting the flag.
  • IgnoreConfig maps to cli flags: --ignore-config/--no-config.
  • From option group: "General"

func (*Command) IgnoreDynamicMPD

func (c *Command) IgnoreDynamicMPD() *Command

Do not process dynamic DASH manifests

Additional information:

  • See Command.UnsetIgnoreDynamicMPD, for unsetting the flag.
  • IgnoreDynamicMPD maps to cli flags: --ignore-dynamic-mpd/--no-allow-dynamic-mpd.
  • From option group: "Extractor"

func (*Command) IgnoreErrors

func (c *Command) IgnoreErrors() *Command

Ignore download and postprocessing errors. The download will be considered successful even if the postprocessing fails

Additional information:

  • See Command.UnsetIgnoreErrors, for unsetting the flag.
  • IgnoreErrors maps to cli flags: -i/--ignore-errors.
  • From option group: "General"

func (*Command) IgnoreNoFormatsError

func (c *Command) IgnoreNoFormatsError() *Command

Ignore "No video formats" error. Useful for extracting metadata even if the videos are not actually available for download (experimental)

Additional information:

  • See Command.UnsetIgnoreNoFormatsError, for unsetting the flag.
  • IgnoreNoFormatsError maps to cli flags: --ignore-no-formats-error.
  • From option group: "Verbosity Simulation"

func (*Command) Impersonate

func (c *Command) Impersonate(client string) *Command

Client to impersonate for requests. E.g. chrome, chrome-110, chrome:windows-10. Pass --impersonate="" to impersonate any client. Note that forcing impersonation for all requests may have a detrimental impact on download speed and stability

Additional information:

  • See Command.UnsetImpersonate, for unsetting the flag.
  • Impersonate maps to cli flags: --impersonate=CLIENT[:OS].
  • From option group: "Network"

func (*Command) JsRuntimes

func (c *Command) JsRuntimes(runtime string) *Command

Additional JavaScript runtime to enable, with an optional location for the runtime (either the path to the binary or its containing directory). This option can be used multiple times to enable multiple runtimes. Supported runtimes are (in order of priority, from highest to lowest): deno, node, quickjs, bun. Only "deno" is enabled by default. The highest priority runtime that is both enabled and available will be used. In order to use a lower priority runtime when "deno" is available, --no-js-runtimes needs to be passed before enabling other runtimes

Additional information:

  • See Command.UnsetJsRuntimes, for unsetting the flag.
  • JsRuntimes maps to cli flags: --js-runtimes=RUNTIME[:PATH].
  • From option group: "General"

func (*Command) KeepFragments

func (c *Command) KeepFragments() *Command

Keep downloaded fragments on disk after downloading is finished

Additional information:

  • See Command.UnsetKeepFragments, for unsetting the flag.
  • KeepFragments maps to cli flags: --keep-fragments.
  • From option group: "Download"

func (*Command) KeepVideo

func (c *Command) KeepVideo() *Command

Keep the intermediate video file on disk after post-processing

Additional information:

  • See Command.UnsetKeepVideo, for unsetting the flag.
  • KeepVideo maps to cli flags: -k/--keep-video.
  • From option group: "Post-Processing"

func (*Command) LazyPlaylist

func (c *Command) LazyPlaylist() *Command

Process entries in the playlist as they are received. This disables n_entries, --playlist-random and --playlist-reverse

Additional information:

  • See Command.UnsetLazyPlaylist, for unsetting the flag.
  • LazyPlaylist maps to cli flags: --lazy-playlist.
  • From option group: "Download"

func (*Command) LegacyServerConnect

func (c *Command) LegacyServerConnect() *Command

Explicitly allow HTTPS connection to servers that do not support RFC 5746 secure renegotiation

Additional information:

  • See Command.UnsetLegacyServerConnect, for unsetting the flag.
  • LegacyServerConnect maps to cli flags: --legacy-server-connect.
  • From option group: "Workarounds"

func (*Command) LimitRate

func (c *Command) LimitRate(rate string) *Command

Maximum download rate in bytes per second, e.g. 50K or 4.2M

Additional information:

  • See Command.UnsetLimitRate, for unsetting the flag.
  • LimitRate maps to cli flags: -r/--limit-rate/--rate-limit=RATE.
  • From option group: "Download"

func (*Command) ListExtractors

func (c *Command) ListExtractors(ctx context.Context) (*Result, error)

List all supported extractors and exit

Additional information:

  • ListExtractors maps to cli flags: --list-extractors.
  • From option group: "General"

func (*Command) ListFormats deprecated

func (c *Command) ListFormats() *Command

List available formats of each video. Simulate unless --no-simulate is used

Additional information:

  • See Command.UnsetListFormats, for unsetting the flag.
  • ListFormats maps to cli flags: -F/--list-formats.
  • From option group: "Video Format"

Deprecated: Use Command.Print with `formats_table` as an argument.

func (*Command) ListFormatsAsTable deprecated

func (c *Command) ListFormatsAsTable() *Command

ListFormatsAsTable sets the "list-formats-as-table" flag (no description specified).

Additional information:

  • See Command.UnsetListFormatsAsTable, for unsetting the flag.
  • ListFormatsAsTable maps to cli flags: --list-formats-as-table (hidden).
  • From option group: "Video Format"

Deprecated: Use Command.ListFormatsAsTable or Command.CompatOptions with `-list-formats` as an argument.

func (*Command) ListFormatsOld deprecated

func (c *Command) ListFormatsOld() *Command

ListFormatsOld sets the "list-formats-old" flag (no description specified).

Additional information:

  • See Command.UnsetListFormatsOld, for unsetting the flag.
  • ListFormatsOld maps to cli flags: --list-formats-old/--no-list-formats-as-table (hidden).
  • From option group: "Video Format"

Deprecated: Use Command.CompatOptions with `list-formats` as an argument.

func (*Command) ListImpersonateTargets

func (c *Command) ListImpersonateTargets() *Command

List available clients to impersonate.

Additional information:

func (*Command) ListSubs

func (c *Command) ListSubs() *Command

List available subtitles of each video. Simulate unless --no-simulate is used

Additional information:

  • See Command.UnsetListSubs, for unsetting the flag.
  • ListSubs maps to cli flags: --list-subs.
  • From option group: "Subtitle"

func (*Command) ListThumbnails deprecated

func (c *Command) ListThumbnails() *Command

List available thumbnails of each video. Simulate unless --no-simulate is used

Additional information:

  • See Command.UnsetListThumbnails, for unsetting the flag.
  • ListThumbnails maps to cli flags: --list-thumbnails.
  • From option group: "Thumbnail"

Deprecated: Call Command.Print twice, once with `thumbnails_table` as an argument, then with `playlist:thumbnails_table` as an argument.

func (*Command) LiveFromStart

func (c *Command) LiveFromStart() *Command

Download livestreams from the start. Currently experimental and only supported for YouTube and Twitch

Additional information:

  • See Command.UnsetLiveFromStart, for unsetting the flag.
  • LiveFromStart maps to cli flags: --live-from-start.
  • From option group: "General"

func (*Command) LoadInfoJSON

func (c *Command) LoadInfoJSON(file string) *Command

JSON file containing the video information (created with the "--write-info-json" option)

Additional information:

  • See Command.UnsetLoadInfoJSON, for unsetting the flag.
  • LoadInfoJSON maps to cli flags: --load-info-json=FILE.
  • From option group: "Filesystem"

func (*Command) MarkWatched

func (c *Command) MarkWatched() *Command

Mark videos watched (even with --simulate)

Additional information:

  • See Command.UnsetMarkWatched, for unsetting the flag.
  • MarkWatched maps to cli flags: --mark-watched.
  • From option group: "General"

func (*Command) MatchFilters

func (c *Command) MatchFilters(filter string) *Command

Generic video filter. Any "OUTPUT TEMPLATE" field can be compared with a number or a string using the operators defined in "Filtering Formats". You can also simply specify a field to match if the field is present, use "!field" to check if the field is not present, and "&" to check multiple conditions. Use a "\" to escape "&" or quotes if needed. If used multiple times, the filter matches if at least one of the conditions is met. E.g. --match-filters !is_live --match-filters "like_count>?100 & description~='(?i)\bcats \& dogs\b'" matches only videos that are not live OR those that have a like count more than 100 (or the like field is not available) and also has a description that contains the phrase "cats & dogs" (caseless). Use "--match-filters -" to interactively ask whether to download each video

Additional information:

  • See Command.UnsetMatchFilters, for unsetting the flag.
  • MatchFilters maps to cli flags: --match-filters=FILTER.
  • From option group: "Video Selection"

func (*Command) MatchTitle deprecated

func (c *Command) MatchTitle(regex string) *Command

MatchTitle sets the "match-title" flag (no description specified).

Additional information:

  • See Command.UnsetMatchTitle, for unsetting the flag.
  • MatchTitle maps to cli flags: --match-title=REGEX (hidden).
  • From option group: "Video Selection"

Deprecated: Use Command.MatchFilters instead (e.g. `title ~= (?i)REGEX`).

func (*Command) MaxDownloads

func (c *Command) MaxDownloads(number int) *Command

Abort after downloading NUMBER files

Additional information:

  • See Command.UnsetMaxDownloads, for unsetting the flag.
  • MaxDownloads maps to cli flags: --max-downloads=NUMBER.
  • From option group: "Video Selection"

func (*Command) MaxFileSize

func (c *Command) MaxFileSize(size string) *Command

Abort download if filesize is larger than SIZE, e.g. 50k or 44.6M

Additional information:

  • See Command.UnsetMaxFileSize, for unsetting the flag.
  • MaxFileSize maps to cli flags: --max-filesize=SIZE.
  • From option group: "Video Selection"

func (*Command) MaxSleepInterval

func (c *Command) MaxSleepInterval(seconds float64) *Command

Maximum number of seconds to sleep. Can only be used along with --min-sleep-interval

Additional information:

  • See Command.UnsetMaxSleepInterval, for unsetting the flag.
  • MaxSleepInterval maps to cli flags: --max-sleep-interval=SECONDS.
  • From option group: "Workarounds"

func (*Command) MaxViews deprecated

func (c *Command) MaxViews(count int) *Command

MaxViews sets the "max-views" flag (no description specified).

Additional information:

  • See Command.UnsetMaxViews, for unsetting the flag.
  • MaxViews maps to cli flags: --max-views=COUNT (hidden).
  • From option group: "Video Selection"

Deprecated: Use Command.MatchFilters instead (e.g. `view_count <=? COUNT`).

func (*Command) MergeOutputFormat

func (c *Command) MergeOutputFormat(format string) *Command

Containers that may be used when merging formats, separated by "/", e.g. "mp4/mkv". Ignored if no merge is required. (currently supported: avi, flv, mkv, mov, mp4, webm)

Additional information:

  • See Command.UnsetMergeOutputFormat, for unsetting the flag.
  • MergeOutputFormat maps to cli flags: --merge-output-format=FORMAT.
  • From option group: "Video Format"

func (*Command) MetadataFromTitle deprecated

func (c *Command) MetadataFromTitle(format string) *Command

MetadataFromTitle sets the "metadata-from-title" flag (no description specified).

Additional information:

  • See Command.UnsetMetadataFromTitle, for unsetting the flag.
  • MetadataFromTitle maps to cli flags: --metadata-from-title=FORMAT (hidden).
  • From option group: "Post-Processing"

Deprecated: Use Command.ParseMetadata with `%(title)s:FORMAT` as an argument.

func (*Command) MinFileSize

func (c *Command) MinFileSize(size string) *Command

Abort download if filesize is smaller than SIZE, e.g. 50k or 44.6M

Additional information:

  • See Command.UnsetMinFileSize, for unsetting the flag.
  • MinFileSize maps to cli flags: --min-filesize=SIZE.
  • From option group: "Video Selection"

func (*Command) MinViews deprecated

func (c *Command) MinViews(count int) *Command

MinViews sets the "min-views" flag (no description specified).

Additional information:

  • See Command.UnsetMinViews, for unsetting the flag.
  • MinViews maps to cli flags: --min-views=COUNT (hidden).
  • From option group: "Video Selection"

Deprecated: Use Command.MatchFilters instead (e.g. `view_count >=? COUNT`).

func (*Command) Mtime

func (c *Command) Mtime() *Command

Use the Last-modified header to set the file modification time

Additional information:

  • See Command.UnsetMtime, for unsetting the flag.
  • Mtime maps to cli flags: --mtime.
  • From option group: "Filesystem"

func (*Command) Netrc

func (c *Command) Netrc() *Command

Use .netrc authentication data

Additional information:

  • See Command.UnsetNetrc, for unsetting the flag.
  • Netrc maps to cli flags: -n/--netrc.
  • From option group: "Authentication"

func (*Command) NetrcCmd

func (c *Command) NetrcCmd(netrcCmd string) *Command

Command to execute to get the credentials for an extractor.

Additional information:

  • See Command.UnsetNetrcCmd, for unsetting the flag.
  • NetrcCmd maps to cli flags: --netrc-cmd=NETRC_CMD.
  • From option group: "Authentication"

func (*Command) NetrcLocation

func (c *Command) NetrcLocation(path string) *Command

Location of .netrc authentication data; either the path or its containing directory. Defaults to ~/.netrc

Additional information:

  • See Command.UnsetNetrcLocation, for unsetting the flag.
  • NetrcLocation maps to cli flags: --netrc-location=PATH.
  • From option group: "Authentication"

func (*Command) Newline

func (c *Command) Newline() *Command

Output progress bar as new lines

Additional information:

  • See Command.UnsetNewline, for unsetting the flag.
  • Newline maps to cli flags: --newline.
  • From option group: "Verbosity Simulation"

func (*Command) NoAbortOnError

func (c *Command) NoAbortOnError() *Command

Continue with next video on download errors; e.g. to skip unavailable videos in a playlist (default)

Additional information:

  • See Command.UnsetAbortOnError, for unsetting the flag.
  • NoAbortOnError maps to cli flags: --no-abort-on-error.
  • From option group: "General"

func (*Command) NoAudioMultistreams

func (c *Command) NoAudioMultistreams() *Command

Only one audio stream is downloaded for each output file (default)

Additional information:

  • See Command.UnsetAudioMultistreams, for unsetting the flag.
  • NoAudioMultistreams maps to cli flags: --no-audio-multistreams.
  • From option group: "Video Format"

func (*Command) NoBatchFile

func (c *Command) NoBatchFile() *Command

Do not read URLs from batch file (default)

Additional information:

  • See Command.UnsetBatchFile, for unsetting the flag.
  • NoBatchFile maps to cli flags: --no-batch-file.
  • From option group: "Filesystem"

func (*Command) NoBreakMatchFilters

func (c *Command) NoBreakMatchFilters() *Command

Do not use any --break-match-filters (default)

Additional information:

  • See Command.UnsetBreakMatchFilters, for unsetting the flag.
  • NoBreakMatchFilters maps to cli flags: --no-break-match-filters.
  • From option group: "Video Selection"

func (*Command) NoBreakOnExisting

func (c *Command) NoBreakOnExisting() *Command

Do not stop the download process when encountering a file that is in the archive (default)

Additional information:

  • See Command.UnsetBreakOnExisting, for unsetting the flag.
  • NoBreakOnExisting maps to cli flags: --no-break-on-existing.
  • From option group: "Video Selection"

func (*Command) NoBreakPerInput

func (c *Command) NoBreakPerInput() *Command

--break-on-existing and similar options terminates the entire download queue

Additional information:

  • See Command.UnsetBreakPerInput, for unsetting the flag.
  • NoBreakPerInput maps to cli flags: --no-break-per-input.
  • From option group: "Video Selection"

func (*Command) NoCacheDir

func (c *Command) NoCacheDir() *Command

Disable filesystem caching

Additional information:

  • See Command.UnsetCacheDir, for unsetting the flag.
  • NoCacheDir maps to cli flags: --no-cache-dir.
  • From option group: "Filesystem"

func (*Command) NoCheckCertificates

func (c *Command) NoCheckCertificates() *Command

Suppress HTTPS certificate validation

Additional information:

  • See Command.UnsetCheckCertificates, for unsetting the flag.
  • NoCheckCertificates maps to cli flags: --no-check-certificates.
  • From option group: "Workarounds"

func (*Command) NoCheckFormats

func (c *Command) NoCheckFormats() *Command

Do not check that the formats are actually downloadable

Additional information:

  • See Command.UnsetCheckFormats, for unsetting the flag.
  • NoCheckFormats maps to cli flags: --no-check-formats.
  • From option group: "Video Format"

func (*Command) NoCleanInfoJSON

func (c *Command) NoCleanInfoJSON() *Command

Write all fields to the infojson

Additional information:

  • See Command.UnsetCleanInfoJSON, for unsetting the flag.
  • NoCleanInfoJSON maps to cli flags: --no-clean-info-json/--no-clean-infojson.
  • From option group: "Filesystem"

func (*Command) NoColors deprecated

func (c *Command) NoColors() *Command

NoColors sets the "no-colors" flag (no description specified).

Additional information:

  • See Command.UnsetColors, for unsetting the flag.
  • NoColors maps to cli flags: --no-colors/--no-colours (hidden).
  • From option group: "General"

Deprecated: Use Command.Color with `no_color` as an argument.

func (*Command) NoConfigLocations

func (c *Command) NoConfigLocations() *Command

Do not load any custom configuration files (default). When given inside a configuration file, ignore all previous --config-locations defined in the current file

Additional information:

  • See Command.UnsetConfigLocations, for unsetting the flag.
  • NoConfigLocations maps to cli flags: --no-config-locations.
  • From option group: "General"

func (*Command) NoContinue

func (c *Command) NoContinue() *Command

Do not resume partially downloaded fragments. If the file is not fragmented, restart download of the entire file

Additional information:

  • See Command.UnsetContinue, for unsetting the flag.
  • NoContinue maps to cli flags: --no-continue.
  • From option group: "Filesystem"

func (*Command) NoCookies

func (c *Command) NoCookies() *Command

Do not read/dump cookies from/to file (default)

Additional information:

  • See Command.UnsetCookies, for unsetting the flag.
  • NoCookies maps to cli flags: --no-cookies=FILE.
  • From option group: "Filesystem"

func (*Command) NoCookiesFromBrowser

func (c *Command) NoCookiesFromBrowser() *Command

Do not load cookies from browser (default)

Additional information:

  • See Command.UnsetCookiesFromBrowser, for unsetting the flag.
  • NoCookiesFromBrowser maps to cli flags: --no-cookies-from-browser.
  • From option group: "Filesystem"

func (*Command) NoDownloadArchive

func (c *Command) NoDownloadArchive() *Command

Do not use archive file (default)

Additional information:

  • See Command.UnsetDownloadArchive, for unsetting the flag.
  • NoDownloadArchive maps to cli flags: --no-download-archive.
  • From option group: "Video Selection"

func (*Command) NoEmbedChapters

func (c *Command) NoEmbedChapters() *Command

Do not add chapter markers (default)

Additional information:

  • See Command.UnsetEmbedChapters, for unsetting the flag.
  • NoEmbedChapters maps to cli flags: --no-embed-chapters/--no-add-chapters.
  • From option group: "Post-Processing"

func (*Command) NoEmbedInfoJSON

func (c *Command) NoEmbedInfoJSON() *Command

Do not embed the infojson as an attachment to the video file

Additional information:

  • See Command.UnsetEmbedInfoJSON, for unsetting the flag.
  • NoEmbedInfoJSON maps to cli flags: --no-embed-info-json.
  • From option group: "Post-Processing"

func (*Command) NoEmbedMetadata

func (c *Command) NoEmbedMetadata() *Command

Do not add metadata to file (default)

Additional information:

  • See Command.UnsetEmbedMetadata, for unsetting the flag.
  • NoEmbedMetadata maps to cli flags: --no-embed-metadata/--no-add-metadata.
  • From option group: "Post-Processing"

func (*Command) NoEmbedSubs

func (c *Command) NoEmbedSubs() *Command

Do not embed subtitles (default)

Additional information:

  • See Command.UnsetEmbedSubs, for unsetting the flag.
  • NoEmbedSubs maps to cli flags: --no-embed-subs.
  • From option group: "Post-Processing"

func (*Command) NoEmbedThumbnail

func (c *Command) NoEmbedThumbnail() *Command

Do not embed thumbnail (default)

Additional information:

  • See Command.UnsetEmbedThumbnail, for unsetting the flag.
  • NoEmbedThumbnail maps to cli flags: --no-embed-thumbnail.
  • From option group: "Post-Processing"

func (*Command) NoExec

func (c *Command) NoExec() *Command

Remove any previously defined --exec

Additional information:

  • See Command.UnsetExec, for unsetting the flag.
  • NoExec maps to cli flags: --no-exec.
  • From option group: "Post-Processing"

func (*Command) NoExecBeforeDownload deprecated

func (c *Command) NoExecBeforeDownload() *Command

NoExecBeforeDownload sets the "no-exec-before-download" flag (no description specified).

Additional information:

  • See Command.UnsetExecBeforeDownload, for unsetting the flag.
  • NoExecBeforeDownload maps to cli flags: --no-exec-before-download (hidden).
  • From option group: "Post-Processing"

Deprecated: Use Command.NoExec instead.

func (*Command) NoFlatPlaylist

func (c *Command) NoFlatPlaylist() *Command

Fully extract the videos of a playlist (default)

Additional information:

  • See Command.UnsetFlatPlaylist, for unsetting the flag.
  • NoFlatPlaylist maps to cli flags: --no-flat-playlist.
  • From option group: "General"

func (*Command) NoForceKeyframesAtCuts

func (c *Command) NoForceKeyframesAtCuts() *Command

Do not force keyframes around the chapters when cutting/splitting (default)

Additional information:

  • See Command.UnsetForceKeyframesAtCuts, for unsetting the flag.
  • NoForceKeyframesAtCuts maps to cli flags: --no-force-keyframes-at-cuts.
  • From option group: "Post-Processing"

func (*Command) NoForceOverwrites

func (c *Command) NoForceOverwrites() *Command

Do not overwrite the video, but overwrite related files (default)

Additional information:

  • See Command.UnsetForceOverwrites, for unsetting the flag.
  • NoForceOverwrites maps to cli flags: --no-force-overwrites.
  • From option group: "Filesystem"

func (*Command) NoFormatSortForce

func (c *Command) NoFormatSortForce() *Command

Some fields have precedence over the user specified sort order (default)

Additional information:

  • See Command.UnsetFormatSortForce, for unsetting the flag.
  • NoFormatSortForce maps to cli flags: --no-format-sort-force=FORMAT.
  • From option group: "Video Format"

func (*Command) NoGeoBypass deprecated

func (c *Command) NoGeoBypass() *Command

NoGeoBypass sets the "no-geo-bypass" flag (no description specified).

Additional information:

  • See Command.UnsetGeoBypass, for unsetting the flag.
  • NoGeoBypass maps to cli flags: --no-geo-bypass (hidden).
  • From option group: "Geo-restriction"

Deprecated: Use Command.XFF with `never` as an argument.

func (*Command) NoHLSSplitDiscontinuity

func (c *Command) NoHLSSplitDiscontinuity() *Command

Do not split HLS playlists into different formats at discontinuities such as ad breaks (default)

Additional information:

func (*Command) NoHLSUseMPEGTS

func (c *Command) NoHLSUseMPEGTS() *Command

Do not use the mpegts container for HLS videos. This is default when not downloading live streams

Additional information:

  • See Command.UnsetHLSUseMPEGTS, for unsetting the flag.
  • NoHLSUseMPEGTS maps to cli flags: --no-hls-use-mpegts.
  • From option group: "Download"

func (*Command) NoIgnoreNoFormatsError

func (c *Command) NoIgnoreNoFormatsError() *Command

Throw error when no downloadable video formats are found (default)

Additional information:

  • See Command.UnsetIgnoreNoFormatsError, for unsetting the flag.
  • NoIgnoreNoFormatsError maps to cli flags: --no-ignore-no-formats-error.
  • From option group: "Verbosity Simulation"

func (*Command) NoJsRuntimes

func (c *Command) NoJsRuntimes() *Command

Clear JavaScript runtimes to enable, including defaults and those provided by previous --js-runtimes

Additional information:

  • See Command.UnsetJsRuntimes, for unsetting the flag.
  • NoJsRuntimes maps to cli flags: --no-js-runtimes.
  • From option group: "General"

func (*Command) NoKeepFragments

func (c *Command) NoKeepFragments() *Command

Delete downloaded fragments after downloading is finished (default)

Additional information:

  • See Command.UnsetKeepFragments, for unsetting the flag.
  • NoKeepFragments maps to cli flags: --no-keep-fragments.
  • From option group: "Download"

func (*Command) NoKeepVideo

func (c *Command) NoKeepVideo() *Command

Delete the intermediate video file after post-processing (default)

Additional information:

  • See Command.UnsetKeepVideo, for unsetting the flag.
  • NoKeepVideo maps to cli flags: --no-keep-video.
  • From option group: "Post-Processing"

func (*Command) NoLazyPlaylist

func (c *Command) NoLazyPlaylist() *Command

Process videos in the playlist only after the entire playlist is parsed (default)

Additional information:

  • See Command.UnsetLazyPlaylist, for unsetting the flag.
  • NoLazyPlaylist maps to cli flags: --no-lazy-playlist.
  • From option group: "Download"

func (*Command) NoLiveFromStart

func (c *Command) NoLiveFromStart() *Command

Download livestreams from the current time (default)

Additional information:

  • See Command.UnsetLiveFromStart, for unsetting the flag.
  • NoLiveFromStart maps to cli flags: --no-live-from-start.
  • From option group: "General"

func (*Command) NoMarkWatched

func (c *Command) NoMarkWatched() *Command

Do not mark videos watched (default)

Additional information:

  • See Command.UnsetMarkWatched, for unsetting the flag.
  • NoMarkWatched maps to cli flags: --no-mark-watched.
  • From option group: "General"

func (*Command) NoMatchFilters

func (c *Command) NoMatchFilters() *Command

Do not use any --match-filters (default)

Additional information:

  • See Command.UnsetMatchFilters, for unsetting the flag.
  • NoMatchFilters maps to cli flags: --no-match-filters.
  • From option group: "Video Selection"

func (*Command) NoMtime

func (c *Command) NoMtime() *Command

Do not use the Last-modified header to set the file modification time (default)

Additional information:

  • See Command.UnsetMtime, for unsetting the flag.
  • NoMtime maps to cli flags: --no-mtime.
  • From option group: "Filesystem"

func (*Command) NoOverwrites

func (c *Command) NoOverwrites() *Command

Do not overwrite any files

Additional information:

  • See Command.UnsetOverwrites, for unsetting the flag.
  • NoOverwrites maps to cli flags: -w/--no-overwrites.
  • From option group: "Filesystem"

func (*Command) NoPart

func (c *Command) NoPart() *Command

Do not use .part files - write directly into output file

Additional information:

  • See Command.UnsetPart, for unsetting the flag.
  • NoPart maps to cli flags: --no-part.
  • From option group: "Filesystem"

func (*Command) NoPlaylist

func (c *Command) NoPlaylist() *Command

Download only the video, if the URL refers to a video and a playlist

Additional information:

  • See Command.UnsetPlaylist, for unsetting the flag.
  • NoPlaylist maps to cli flags: --no-playlist.
  • From option group: "Video Selection"

func (*Command) NoPlaylistReverse deprecated

func (c *Command) NoPlaylistReverse() *Command

NoPlaylistReverse sets the "no-playlist-reverse" flag (no description specified).

Additional information:

  • See Command.UnsetPlaylistReverse, for unsetting the flag.
  • NoPlaylistReverse maps to cli flags: --no-playlist-reverse (hidden).
  • From option group: "Download"

Deprecated: It is now the default behavior.

func (*Command) NoPluginDirs

func (c *Command) NoPluginDirs() *Command

Clear plugin directories to search, including defaults and those provided by previous --plugin-dirs

Additional information:

  • See Command.UnsetPluginDirs, for unsetting the flag.
  • NoPluginDirs maps to cli flags: --no-plugin-dirs.
  • From option group: "General"

func (*Command) NoPostOverwrites

func (c *Command) NoPostOverwrites() *Command

Do not overwrite post-processed files

Additional information:

  • See Command.UnsetPostOverwrites, for unsetting the flag.
  • NoPostOverwrites maps to cli flags: --no-post-overwrites.
  • From option group: "Post-Processing"

func (*Command) NoPreferFreeFormats

func (c *Command) NoPreferFreeFormats() *Command

Don't give any special preference to free containers (default)

Additional information:

  • See Command.UnsetPreferFreeFormats, for unsetting the flag.
  • NoPreferFreeFormats maps to cli flags: --no-prefer-free-formats.
  • From option group: "Video Format"

func (*Command) NoProgress

func (c *Command) NoProgress() *Command

Do not print progress bar

Additional information:

  • See Command.UnsetProgress, for unsetting the flag.
  • NoProgress maps to cli flags: --no-progress.
  • From option group: "Verbosity Simulation"

func (*Command) NoQuiet

func (c *Command) NoQuiet() *Command

Deactivate quiet mode. (Default)

Additional information:

  • See Command.UnsetQuiet, for unsetting the flag.
  • NoQuiet maps to cli flags: --no-quiet.
  • From option group: "Verbosity Simulation"

func (*Command) NoRemoteComponents

func (c *Command) NoRemoteComponents() *Command

Disallow fetching of all remote components, including any previously allowed by --remote-components or defaults.

Additional information:

  • See Command.UnsetRemoteComponents, for unsetting the flag.
  • NoRemoteComponents maps to cli flags: --no-remote-components.
  • From option group: "General"

func (*Command) NoRemoveChapters

func (c *Command) NoRemoveChapters() *Command

Do not remove any chapters from the file (default)

Additional information:

  • See Command.UnsetRemoveChapters, for unsetting the flag.
  • NoRemoveChapters maps to cli flags: --no-remove-chapters.
  • From option group: "Post-Processing"

func (*Command) NoResizeBuffer

func (c *Command) NoResizeBuffer() *Command

Do not automatically adjust the buffer size

Additional information:

  • See Command.UnsetResizeBuffer, for unsetting the flag.
  • NoResizeBuffer maps to cli flags: --no-resize-buffer.
  • From option group: "Download"

func (*Command) NoRestrictFilenames

func (c *Command) NoRestrictFilenames() *Command

Allow Unicode characters, "&" and spaces in filenames (default)

Additional information:

  • See Command.UnsetRestrictFilenames, for unsetting the flag.
  • NoRestrictFilenames maps to cli flags: --no-restrict-filenames.
  • From option group: "Filesystem"

func (*Command) NoSimulate

func (c *Command) NoSimulate() *Command

Download the video even if printing/listing options are used

Additional information:

  • See Command.UnsetSimulate, for unsetting the flag.
  • NoSimulate maps to cli flags: --no-simulate.
  • From option group: "Verbosity Simulation"

func (*Command) NoSplitChapters

func (c *Command) NoSplitChapters() *Command

Do not split video based on chapters (default)

Additional information:

  • See Command.UnsetSplitChapters, for unsetting the flag.
  • NoSplitChapters maps to cli flags: --no-split-chapters/--no-split-tracks.
  • From option group: "Post-Processing"

func (*Command) NoSponsorblock

func (c *Command) NoSponsorblock() *Command

Disable both --sponsorblock-mark and --sponsorblock-remove

Additional information:

  • See Command.UnsetSponsorblock, for unsetting the flag.
  • NoSponsorblock maps to cli flags: --no-sponsorblock.
  • From option group: "SponsorBlock"

func (*Command) NoUpdate

func (c *Command) NoUpdate() *Command

Do not check for updates (default)

Additional information:

  • See Command.UnsetUpdate, for unsetting the flag.
  • NoUpdate maps to cli flags: --no-update.
  • From option group: "General"

func (*Command) NoVideoMultistreams

func (c *Command) NoVideoMultistreams() *Command

Only one video stream is downloaded for each output file (default)

Additional information:

  • See Command.UnsetVideoMultistreams, for unsetting the flag.
  • NoVideoMultistreams maps to cli flags: --no-video-multistreams.
  • From option group: "Video Format"

func (*Command) NoWaitForVideo

func (c *Command) NoWaitForVideo() *Command

Do not wait for scheduled streams (default)

Additional information:

  • See Command.UnsetWaitForVideo, for unsetting the flag.
  • NoWaitForVideo maps to cli flags: --no-wait-for-video.
  • From option group: "General"

func (*Command) NoWarnings

func (c *Command) NoWarnings() *Command

Ignore warnings

Additional information:

  • See Command.UnsetWarnings, for unsetting the flag.
  • NoWarnings maps to cli flags: --no-warnings.
  • From option group: "Verbosity Simulation"

func (*Command) NoWindowsFilenames

func (c *Command) NoWindowsFilenames() *Command

Sanitize filenames only minimally

Additional information:

  • See Command.UnsetWindowsFilenames, for unsetting the flag.
  • NoWindowsFilenames maps to cli flags: --no-windows-filenames.
  • From option group: "Filesystem"

func (*Command) NoWriteAutoSubs

func (c *Command) NoWriteAutoSubs() *Command

Do not write auto-generated subtitles (default)

Additional information:

  • See Command.UnsetWriteAutoSubs, for unsetting the flag.
  • NoWriteAutoSubs maps to cli flags: --no-write-auto-subs/--no-write-automatic-subs.
  • From option group: "Subtitle"

func (*Command) NoWriteComments

func (c *Command) NoWriteComments() *Command

Do not retrieve video comments unless the extraction is known to be quick

Additional information:

  • See Command.UnsetWriteComments, for unsetting the flag.
  • NoWriteComments maps to cli flags: --no-write-comments/--no-get-comments.
  • From option group: "Filesystem"

func (*Command) NoWriteDescription

func (c *Command) NoWriteDescription() *Command

Do not write video description (default)

Additional information:

  • See Command.UnsetWriteDescription, for unsetting the flag.
  • NoWriteDescription maps to cli flags: --no-write-description.
  • From option group: "Filesystem"

func (*Command) NoWriteInfoJSON

func (c *Command) NoWriteInfoJSON() *Command

Do not write video metadata (default)

Additional information:

  • See Command.UnsetWriteInfoJSON, for unsetting the flag.
  • NoWriteInfoJSON maps to cli flags: --no-write-info-json.
  • From option group: "Filesystem"

func (*Command) NoWritePlaylistMetafiles

func (c *Command) NoWritePlaylistMetafiles() *Command

Do not write playlist metadata when using --write-info-json, --write-description etc.

Additional information:

func (*Command) NoWriteSubs

func (c *Command) NoWriteSubs() *Command

Do not write subtitle file (default)

Additional information:

  • See Command.UnsetWriteSubs, for unsetting the flag.
  • NoWriteSubs maps to cli flags: --no-write-subs/--no-write-srt.
  • From option group: "Subtitle"

func (*Command) NoWriteThumbnail

func (c *Command) NoWriteThumbnail() *Command

Do not write thumbnail image to disk (default)

Additional information:

  • See Command.UnsetWriteThumbnail, for unsetting the flag.
  • NoWriteThumbnail maps to cli flags: --no-write-thumbnail.
  • From option group: "Thumbnail"

func (*Command) Output

func (c *Command) Output(template string) *Command

Output filename template; see "OUTPUT TEMPLATE" for details

References:

Additional information:

  • See Command.UnsetOutput, for unsetting the flag.
  • Output maps to cli flags: -o/--output=[TYPES:]TEMPLATE.
  • From option group: "Filesystem"

func (*Command) OutputNaPlaceholder

func (c *Command) OutputNaPlaceholder(text string) *Command

Placeholder for unavailable fields in --output (default: "NA")

Additional information:

  • See Command.UnsetOutputNaPlaceholder, for unsetting the flag.
  • OutputNaPlaceholder maps to cli flags: --output-na-placeholder=TEXT.
  • From option group: "Filesystem"

func (*Command) ParseMetadata

func (c *Command) ParseMetadata(fromto string) *Command

Parse additional metadata like title/artist from other fields; see "MODIFYING METADATA" for details. Supported values of "WHEN" are the same as that of --use-postprocessor (default: pre_process)

References:

Additional information:

  • See Command.UnsetParseMetadata, for unsetting the flag.
  • ParseMetadata maps to cli flags: --parse-metadata=[WHEN:]FROM:TO.
  • From option group: "Post-Processing"

func (*Command) Part

func (c *Command) Part() *Command

Use .part files instead of writing directly into output file (default)

Additional information:

  • See Command.UnsetPart, for unsetting the flag.
  • Part maps to cli flags: --part.
  • From option group: "Filesystem"

func (*Command) Password

func (c *Command) Password(password string) *Command

Account password. If this option is left out, yt-dlp will ask interactively

Additional information:

  • See Command.UnsetPassword, for unsetting the flag.
  • Password maps to cli flags: -p/--password=PASSWORD.
  • From option group: "Authentication"

func (*Command) Paths

func (c *Command) Paths(path string) *Command

The paths where the files should be downloaded. Specify the type of file and the path separated by a colon ":". All the same TYPES as --output are supported. Additionally, you can also provide "home" (default) and "temp" paths. All intermediary files are first downloaded to the temp path and then the final files are moved over to the home path after download is finished. This option is ignored if --output is an absolute path

Additional information:

  • See Command.UnsetPaths, for unsetting the flag.
  • Paths maps to cli flags: -P/--paths=[TYPES:]PATH.
  • From option group: "Filesystem"

func (*Command) PlaylistEnd deprecated

func (c *Command) PlaylistEnd(number int) *Command

PlaylistEnd sets the "playlist-end" flag (no description specified).

Additional information:

  • See Command.UnsetPlaylistEnd, for unsetting the flag.
  • PlaylistEnd maps to cli flags: --playlist-end=NUMBER (hidden).
  • From option group: "Video Selection"

Deprecated: Use Command.PlaylistItems with `:<your-number>` as an argument.

func (*Command) PlaylistItems

func (c *Command) PlaylistItems(itemSpec string) *Command

Comma-separated playlist_index of the items to download. You can specify a range using "[START]:[STOP][:STEP]". For backward compatibility, START-STOP is also supported. Use negative indices to count from the right and negative STEP to download in reverse order. E.g. "-I 1:3,7,-5::2" used on a playlist of size 15 will download the items at index 1,2,3,7,11,13,15

Additional information:

  • See Command.UnsetPlaylistItems, for unsetting the flag.
  • PlaylistItems maps to cli flags: -I/--playlist-items=ITEM_SPEC.
  • From option group: "Video Selection"

func (*Command) PlaylistRandom

func (c *Command) PlaylistRandom() *Command

Download playlist videos in random order

Additional information:

  • See Command.UnsetPlaylistRandom, for unsetting the flag.
  • PlaylistRandom maps to cli flags: --playlist-random.
  • From option group: "Download"

func (*Command) PlaylistReverse deprecated

func (c *Command) PlaylistReverse() *Command

PlaylistReverse sets the "playlist-reverse" flag (no description specified).

Additional information:

  • See Command.UnsetPlaylistReverse, for unsetting the flag.
  • PlaylistReverse maps to cli flags: --playlist-reverse (hidden).
  • From option group: "Download"

Deprecated: Use Command.PlaylistItems with `::-1` as an argument.

func (*Command) PlaylistStart deprecated

func (c *Command) PlaylistStart(number int) *Command

PlaylistStart sets the "playlist-start" flag (no description specified).

Additional information:

  • See Command.UnsetPlaylistStart, for unsetting the flag.
  • PlaylistStart maps to cli flags: --playlist-start=NUMBER (hidden).
  • From option group: "Video Selection"

Deprecated: Use Command.PlaylistItems with `<your-number>:` as an argument.

func (*Command) PluginDirs

func (c *Command) PluginDirs(dir string) *Command

Path to an additional directory to search for plugins. This option can be used multiple times to add multiple directories. Use "default" to search the default plugin directories (default)

Additional information:

  • See Command.UnsetPluginDirs, for unsetting the flag.
  • PluginDirs maps to cli flags: --plugin-dirs=DIR.
  • From option group: "General"

func (*Command) PostOverwrites

func (c *Command) PostOverwrites() *Command

Overwrite post-processed files (default)

Additional information:

  • See Command.UnsetPostOverwrites, for unsetting the flag.
  • PostOverwrites maps to cli flags: --post-overwrites.
  • From option group: "Post-Processing"

func (*Command) PostProcessorArgs

func (c *Command) PostProcessorArgs(nameargs string) *Command

Give these arguments to the postprocessors. Specify the postprocessor/executable name and the arguments separated by a colon ":" to give the argument to the specified postprocessor/executable. Supported PP are: Merger, ModifyChapters, SplitChapters, ExtractAudio, VideoRemuxer, VideoConvertor, Metadata, EmbedSubtitle, EmbedThumbnail, SubtitlesConvertor, ThumbnailsConvertor, FixupStretched, FixupM4a, FixupM3u8, FixupTimestamp and FixupDuration. The supported executables are: AtomicParsley, FFmpeg and FFprobe. You can also specify "PP+EXE:ARGS" to give the arguments to the specified executable only when being used by the specified postprocessor. Additionally, for ffmpeg/ffprobe, "_i"/"_o" can be appended to the prefix optionally followed by a number to pass the argument before the specified input/output file, e.g. --ppa "Merger+ffmpeg_i1:-v quiet". You can use this option multiple times to give different arguments to different postprocessors.

Additional information:

  • See Command.UnsetPostProcessorArgs, for unsetting the flag.
  • PostProcessorArgs maps to cli flags: --postprocessor-args/--ppa=NAME:ARGS.
  • From option group: "Post-Processing"

func (*Command) PreferFreeFormats

func (c *Command) PreferFreeFormats() *Command

Prefer video formats with free containers over non-free ones of the same quality. Use with "-S ext" to strictly prefer free containers irrespective of quality

Additional information:

  • See Command.UnsetPreferFreeFormats, for unsetting the flag.
  • PreferFreeFormats maps to cli flags: --prefer-free-formats.
  • From option group: "Video Format"

func (*Command) PreferInsecure

func (c *Command) PreferInsecure() *Command

Use an unencrypted connection to retrieve information about the video (Currently supported only for YouTube)

Additional information:

  • See Command.UnsetPreferInsecure, for unsetting the flag.
  • PreferInsecure maps to cli flags: --prefer-insecure/--prefer-unsecure.
  • From option group: "Workarounds"

func (*Command) PresetAlias

func (c *Command) PresetAlias(preset string) *Command

Applies a predefined set of options. e.g. --preset-alias mp3. The following presets are available: mp3, aac, mp4, mkv, sleep. See the "Preset Aliases" section at the end for more info. This option can be used multiple times

Additional information:

  • See Command.UnsetPresetAlias, for unsetting the flag.
  • PresetAlias maps to cli flags: -t/--preset-alias=PRESET.
  • From option group: "General"

func (*Command) Print

func (c *Command) Print(template string) *Command

Field name or output template to print to screen, optionally prefixed with when to print it, separated by a ":". Supported values of "WHEN" are the same as that of --use-postprocessor (default: video). Implies --quiet. Implies --simulate unless --no-simulate or later stages of WHEN are used. This option can be used multiple times

Additional information:

  • See Command.UnsetPrint, for unsetting the flag.
  • Print maps to cli flags: -O/--print=[WHEN:]TEMPLATE.
  • From option group: "Verbosity Simulation"

func (*Command) PrintJSON

func (c *Command) PrintJSON() *Command

PrintJSON sets the "print-json" flag (no description specified).

Additional information:

  • See Command.UnsetPrintJSON, for unsetting the flag.
  • PrintJSON maps to cli flags: --print-json (hidden).
  • From option group: "Verbosity Simulation"

func (*Command) PrintToFile

func (c *Command) PrintToFile(template, file string) *Command

Append given template to the file. The values of WHEN and TEMPLATE are the same as that of --print. FILE uses the same syntax as the output template. This option can be used multiple times

Additional information:

  • See Command.UnsetPrintToFile, for unsetting the flag.
  • PrintToFile maps to cli flags: --print-to-file=[WHEN:]TEMPLATE FILE.
  • From option group: "Verbosity Simulation"

func (*Command) PrintTraffic

func (c *Command) PrintTraffic() *Command

Display sent and read HTTP traffic

Additional information:

  • See Command.UnsetPrintTraffic, for unsetting the flag.
  • PrintTraffic maps to cli flags: --print-traffic.
  • From option group: "Verbosity Simulation"

func (*Command) Progress

func (c *Command) Progress() *Command

Show progress bar, even if in quiet mode

Additional information:

  • See Command.UnsetProgress, for unsetting the flag.
  • Progress maps to cli flags: --progress.
  • From option group: "Verbosity Simulation"

func (*Command) ProgressDelta

func (c *Command) ProgressDelta(seconds float64) *Command

Time between progress output (default: 0)

Additional information:

  • See Command.UnsetProgressDelta, for unsetting the flag.
  • ProgressDelta maps to cli flags: --progress-delta=SECONDS.
  • From option group: "Verbosity Simulation"

func (*Command) ProgressFunc

func (c *Command) ProgressFunc(frequency time.Duration, fn ProgressCallbackFunc) *Command

ProgressFunc can be used to register a callback function that will be called when yt-dlp sends progress updates. The callback function will be called with any information that yt-dlp is able to provide, including sending separate updates for each file, playlist, etc that may be downloaded.

func (*Command) ProgressTemplate

func (c *Command) ProgressTemplate(template string) *Command

Template for progress outputs, optionally prefixed with one of "download:" (default), "download-title:" (the console title), "postprocess:", or "postprocess-title:". The video's fields are accessible under the "info" key and the progress attributes are accessible under "progress" key. E.g. --console-title --progress-template "download-title:%(info.id)s-%(progress.eta)s"

Additional information:

  • See Command.UnsetProgressTemplate, for unsetting the flag.
  • ProgressTemplate maps to cli flags: --progress-template=[TYPES:]TEMPLATE.
  • From option group: "Verbosity Simulation"

func (*Command) Proxy

func (c *Command) Proxy(url string) *Command

Use the specified HTTP/HTTPS/SOCKS proxy. To enable SOCKS proxy, specify a proper scheme, e.g. socks5://user:pass@127.0.0.1:1080/. Pass in an empty string (--proxy "") for direct connection

Additional information:

  • See Command.UnsetProxy, for unsetting the flag.
  • Proxy maps to cli flags: --proxy=URL.
  • From option group: "Network"

func (*Command) Quiet

func (c *Command) Quiet() *Command

Activate quiet mode. If used with --verbose, print the log to stderr

Additional information:

  • See Command.UnsetQuiet, for unsetting the flag.
  • Quiet maps to cli flags: -q/--quiet.
  • From option group: "Verbosity Simulation"

func (*Command) RecodeVideo

func (c *Command) RecodeVideo(format string) *Command

Re-encode the video into another format if necessary. The syntax and supported formats are the same as --remux-video

Additional information:

  • See Command.UnsetRecodeVideo, for unsetting the flag.
  • RecodeVideo maps to cli flags: --recode-video=FORMAT.
  • From option group: "Post-Processing"

func (*Command) Referer deprecated

func (c *Command) Referer(url string) *Command

Referer sets the "referer" flag (no description specified).

Additional information:

  • See Command.UnsetReferer, for unsetting the flag.
  • Referer maps to cli flags: --referer=URL (hidden).
  • From option group: "Workarounds"

Deprecated: Use Command.AddHeaders instead (e.g. `Referer:URL`).

func (*Command) RejectTitle deprecated

func (c *Command) RejectTitle(regex string) *Command

RejectTitle sets the "reject-title" flag (no description specified).

Additional information:

  • See Command.UnsetRejectTitle, for unsetting the flag.
  • RejectTitle maps to cli flags: --reject-title=REGEX (hidden).
  • From option group: "Video Selection"

Deprecated: Use Command.MatchFilters instead (e.g. `title !~= (?i)REGEX`).

func (*Command) RemoteComponents

func (c *Command) RemoteComponents(component string) *Command

Remote components to allow yt-dlp to fetch when required. This option is currently not needed if you are using an official executable or have the requisite version of the yt-dlp-ejs package installed. You can use this option multiple times to allow multiple components. Supported values: ejs:npm (external JavaScript components from npm), ejs:github (external JavaScript components from yt-dlp-ejs GitHub). By default, no remote components are allowed

Additional information:

  • See Command.UnsetRemoteComponents, for unsetting the flag.
  • RemoteComponents maps to cli flags: --remote-components=COMPONENT.
  • From option group: "General"

func (*Command) RemoveChapters

func (c *Command) RemoveChapters(regex string) *Command

Remove chapters whose title matches the given regular expression. The syntax is the same as --download-sections. This option can be used multiple times

Additional information:

  • See Command.UnsetRemoveChapters, for unsetting the flag.
  • RemoveChapters maps to cli flags: --remove-chapters=REGEX.
  • From option group: "Post-Processing"

func (*Command) RemuxVideo

func (c *Command) RemuxVideo(format string) *Command

Remux the video into another container if necessary (currently supported: avi, flv, gif, mkv, mov, mp4, webm, aac, aiff, alac, flac, m4a, mka, mp3, ogg, opus, vorbis, wav). If the target container does not support the video/audio codec, remuxing will fail. You can specify multiple rules; e.g. "aac>m4a/mov>mp4/mkv" will remux aac to m4a, mov to mp4 and anything else to mkv

Additional information:

  • See Command.UnsetRemuxVideo, for unsetting the flag.
  • RemuxVideo maps to cli flags: --remux-video=FORMAT.
  • From option group: "Post-Processing"

func (*Command) ReplaceInMetadata

func (c *Command) ReplaceInMetadata(fields, regex, replace string) *Command

Replace text in a metadata field using the given regex. This option can be used multiple times. Supported values of "WHEN" are the same as that of --use-postprocessor (default: pre_process)

References:

Additional information:

  • See Command.UnsetReplaceInMetadata, for unsetting the flag.
  • ReplaceInMetadata maps to cli flags: --replace-in-metadata=[WHEN:]FIELDS REGEX REPLACE.
  • From option group: "Post-Processing"

func (*Command) ResizeBuffer

func (c *Command) ResizeBuffer() *Command

The buffer size is automatically resized from an initial value of --buffer-size (default)

Additional information:

  • See Command.UnsetResizeBuffer, for unsetting the flag.
  • ResizeBuffer maps to cli flags: --resize-buffer.
  • From option group: "Download"

func (*Command) RestrictFilenames

func (c *Command) RestrictFilenames() *Command

Restrict filenames to only ASCII characters, and avoid "&" and spaces in filenames

Additional information:

  • See Command.UnsetRestrictFilenames, for unsetting the flag.
  • RestrictFilenames maps to cli flags: --restrict-filenames.
  • From option group: "Filesystem"

func (*Command) Retries

func (c *Command) Retries(retries string) *Command

Number of retries (default is 10), or "infinite"

Additional information:

  • See Command.UnsetRetries, for unsetting the flag.
  • Retries maps to cli flags: -R/--retries=RETRIES.
  • From option group: "Download"

func (*Command) RetrySleep

func (c *Command) RetrySleep(expr string) *Command

Time to sleep between retries in seconds (optionally) prefixed by the type of retry (http (default), fragment, file_access, extractor) to apply the sleep to. EXPR can be a number, linear=START[:END[:STEP=1]] or exp=START[:END[:BASE=2]]. This option can be used multiple times to set the sleep for the different retry types, e.g. --retry-sleep linear=1::2 --retry-sleep fragment:exp=1:20

Additional information:

  • See Command.UnsetRetrySleep, for unsetting the flag.
  • RetrySleep maps to cli flags: --retry-sleep=[TYPE:]EXPR.
  • From option group: "Download"

func (*Command) RmCacheDir

func (c *Command) RmCacheDir() *Command

Delete all filesystem cache files

Additional information:

  • See Command.UnsetRmCacheDir, for unsetting the flag.
  • RmCacheDir maps to cli flags: --rm-cache-dir.
  • From option group: "Filesystem"

func (*Command) Run

func (c *Command) Run(ctx context.Context, args ...string) (*Result, error)

Run invokes yt-dlp with the provided arguments (and any flags previously set), and returns the results (stdout/stderr, exit code, etc). args should be the URLs that would normally be passed in to yt-dlp.

func (*Command) SetCancelMaxWait

func (c *Command) SetCancelMaxWait(value time.Duration) *Command

SetCancelMaxWait sets the maximum wait time before the command is killed, after the context is cancelled. Defaults to 1 second.

func (*Command) SetEnvVar

func (c *Command) SetEnvVar(key, value string) *Command

SetEnvVar sets an environment variable for the command. If value is empty, it will be removed. If the key is "PATH", it will be merged with the parent process's PATH, (where explicit values provided here will take precedence). See also [SetEnvVarInherit].

func (*Command) SetEnvVarInherit

func (c *Command) SetEnvVarInherit(enabled bool) *Command

SetEnvVarInherit sets whether the command should inherit environment variables from the parent process. If enabled, the command will inherit the parent process's environment variables, and any environment variables set with [SetEnvVar] will be merged with the parent process's environment variables. If disabled, the command will only use the environment variables set with [SetEnvVar] (with the exception of PATH). Explicitly set env vars with [SetEnvVar] will always take precedence over the parent process's environment variables.

func (*Command) SetExecutable

func (c *Command) SetExecutable(path string) *Command

SetExecutable sets the executable path to yt-dlp for the command.

func (*Command) SetFlagConfig

func (c *Command) SetFlagConfig(flagConfig *FlagConfig) *Command

SetFlagConfig sets the flag config for the command, overriding ALL previously set flags. If nil is provided, a new empty flag config will be used.

func (*Command) SetSeparateProcessGroup

func (c *Command) SetSeparateProcessGroup(value bool) *Command

SetSeparateProcessGroup sets whether the command should be run in a separate process group. This is useful to avoid propagating signals from the app process. NOTE: This is only supported on Windows and Unix-like systems.

func (*Command) SetWorkDir

func (c *Command) SetWorkDir(path string) *Command

SetWorkDir sets the working directory for the command. Defaults to current working directory.

func (*Command) Simulate

func (c *Command) Simulate() *Command

Do not download the video and do not write anything to disk

Additional information:

  • See Command.UnsetSimulate, for unsetting the flag.
  • Simulate maps to cli flags: -s/--simulate.
  • From option group: "Verbosity Simulation"

func (*Command) SkipDownload

func (c *Command) SkipDownload() *Command

Do not download the video but write all related files

Additional information:

  • See Command.UnsetSkipDownload, for unsetting the flag.
  • SkipDownload maps to cli flags: --skip-download/--no-download.
  • From option group: "Verbosity Simulation"

func (*Command) SkipPlaylistAfterErrors

func (c *Command) SkipPlaylistAfterErrors(n int) *Command

Number of allowed failures until the rest of the playlist is skipped

Additional information:

func (*Command) SkipUnavailableFragments

func (c *Command) SkipUnavailableFragments() *Command

Skip unavailable fragments for DASH, hlsnative and ISM downloads (default)

Additional information:

  • See Command.UnsetSkipUnavailableFragments, for unsetting the flag.
  • SkipUnavailableFragments maps to cli flags: --skip-unavailable-fragments/--no-abort-on-unavailable-fragments.
  • From option group: "Download"

func (*Command) SleepInterval

func (c *Command) SleepInterval(seconds float64) *Command

Number of seconds to sleep before each download. This is the minimum time to sleep when used along with --max-sleep-interval

Additional information:

  • See Command.UnsetSleepInterval, for unsetting the flag.
  • SleepInterval maps to cli flags: --sleep-interval/--min-sleep-interval=SECONDS.
  • From option group: "Workarounds"

func (*Command) SleepRequests

func (c *Command) SleepRequests(seconds float64) *Command

Number of seconds to sleep between requests during data extraction

Additional information:

  • See Command.UnsetSleepRequests, for unsetting the flag.
  • SleepRequests maps to cli flags: --sleep-requests=SECONDS.
  • From option group: "Workarounds"

func (*Command) SleepSubtitles

func (c *Command) SleepSubtitles(seconds int) *Command

Number of seconds to sleep before each subtitle download

Additional information:

  • See Command.UnsetSleepSubtitles, for unsetting the flag.
  • SleepSubtitles maps to cli flags: --sleep-subtitles=SECONDS.
  • From option group: "Workarounds"

func (*Command) SocketTimeout

func (c *Command) SocketTimeout(seconds float64) *Command

Time to wait before giving up, in seconds

Additional information:

  • See Command.UnsetSocketTimeout, for unsetting the flag.
  • SocketTimeout maps to cli flags: --socket-timeout=SECONDS.
  • From option group: "Network"

func (*Command) SourceAddress

func (c *Command) SourceAddress(ip string) *Command

Client-side IP address to bind to

Additional information:

  • See Command.UnsetSourceAddress, for unsetting the flag.
  • SourceAddress maps to cli flags: --source-address=IP.
  • From option group: "Network"

func (*Command) SplitChapters

func (c *Command) SplitChapters() *Command

Split video into multiple files based on internal chapters. The "chapter:" prefix can be used with "--paths" and "--output" to set the output filename for the split files. See "OUTPUT TEMPLATE" for details

References:

Additional information:

  • See Command.UnsetSplitChapters, for unsetting the flag.
  • SplitChapters maps to cli flags: --split-chapters/--split-tracks.
  • From option group: "Post-Processing"

func (*Command) SponsorblockAPI

func (c *Command) SponsorblockAPI(url string) *Command

SponsorBlock API location, defaults to https://sponsor.ajay.app

Additional information:

  • See Command.UnsetSponsorblockAPI, for unsetting the flag.
  • SponsorblockAPI maps to cli flags: --sponsorblock-api=URL.
  • From option group: "SponsorBlock"

func (*Command) SponsorblockChapterTitle

func (c *Command) SponsorblockChapterTitle(template string) *Command

An output template for the title of the SponsorBlock chapters created by --sponsorblock-mark. The only available fields are start_time, end_time, category, categories, name, category_names. Defaults to "[SponsorBlock]: %(category_names)l"

Additional information:

  • See Command.UnsetSponsorblockChapterTitle, for unsetting the flag.
  • SponsorblockChapterTitle maps to cli flags: --sponsorblock-chapter-title=TEMPLATE.
  • From option group: "SponsorBlock"

func (*Command) SponsorblockMark

func (c *Command) SponsorblockMark(cats string) *Command

SponsorBlock categories to create chapters for, separated by commas. Available categories are sponsor, intro, outro, selfpromo, preview, filler, interaction, music_offtopic, hook, poi_highlight, chapter, all and default (=all). You can prefix the category with a "-" to exclude it. See [1] for descriptions of the categories. E.g. --sponsorblock-mark all,-preview [1] https://wiki.sponsor.ajay.app/w/Segment_Categories

Additional information:

  • See Command.UnsetSponsorblockMark, for unsetting the flag.
  • SponsorblockMark maps to cli flags: --sponsorblock-mark=CATS.
  • From option group: "SponsorBlock"

func (*Command) SponsorblockRemove

func (c *Command) SponsorblockRemove(cats string) *Command

SponsorBlock categories to be removed from the video file, separated by commas. If a category is present in both mark and remove, remove takes precedence. The syntax and available categories are the same as for --sponsorblock-mark except that "default" refers to "all,-filler" and poi_highlight, chapter are not available

Additional information:

  • See Command.UnsetSponsorblockRemove, for unsetting the flag.
  • SponsorblockRemove maps to cli flags: --sponsorblock-remove=CATS.
  • From option group: "SponsorBlock"

func (*Command) SubFormat

func (c *Command) SubFormat(format string) *Command

Subtitle format; accepts formats preference separated by "/", e.g. "srt" or "ass/srt/best"

Additional information:

  • See Command.UnsetSubFormat, for unsetting the flag.
  • SubFormat maps to cli flags: --sub-format=FORMAT.
  • From option group: "Subtitle"

func (*Command) SubLangs

func (c *Command) SubLangs(langs string) *Command

Languages of the subtitles to download (can be regex) or "all" separated by commas, e.g. --sub-langs "en.*,ja" (where "en.*" is a regex pattern that matches "en" followed by 0 or more of any character). You can prefix the language code with a "-" to exclude it from the requested languages, e.g. --sub-langs all,-live_chat. Use --list-subs for a list of available language tags

Additional information:

  • See Command.UnsetSubLangs, for unsetting the flag.
  • SubLangs maps to cli flags: --sub-langs/--srt-langs=LANGS.
  • From option group: "Subtitle"

func (*Command) ThrottledRate

func (c *Command) ThrottledRate(rate string) *Command

Minimum download rate in bytes per second below which throttling is assumed and the video data is re-extracted, e.g. 100K

Additional information:

  • See Command.UnsetThrottledRate, for unsetting the flag.
  • ThrottledRate maps to cli flags: --throttled-rate=RATE.
  • From option group: "Download"

func (*Command) TrimFilenames

func (c *Command) TrimFilenames(length int) *Command

Limit the filename length (excluding extension) to the specified number of characters

Additional information:

  • See Command.UnsetTrimFilenames, for unsetting the flag.
  • TrimFilenames maps to cli flags: --trim-filenames/--trim-file-names=LENGTH.
  • From option group: "Filesystem"

func (*Command) TwoFactor

func (c *Command) TwoFactor(twofactor string) *Command

Two-factor authentication code

Additional information:

  • See Command.UnsetTwoFactor, for unsetting the flag.
  • TwoFactor maps to cli flags: -2/--twofactor=TWOFACTOR.
  • From option group: "Authentication"

func (*Command) UnsetAbortOnError

func (c *Command) UnsetAbortOnError() *Command

UnsetAbortOnError unsets any flags that were previously set by one of:

func (*Command) UnsetAbortOnUnavailableFragments

func (c *Command) UnsetAbortOnUnavailableFragments() *Command

UnsetAbortOnUnavailableFragments unsets any flags that were previously set by one of:

func (*Command) UnsetAddHeaders

func (c *Command) UnsetAddHeaders() *Command

UnsetAddHeaders unsets any flags that were previously set by one of:

func (*Command) UnsetAgeLimit

func (c *Command) UnsetAgeLimit() *Command

UnsetAgeLimit unsets any flags that were previously set by one of:

func (*Command) UnsetAllFormats deprecated

func (c *Command) UnsetAllFormats() *Command

UnsetAllFormats unsets any flags that were previously set by one of:

Deprecated: Use Command.Format with `all` as an argument.

func (*Command) UnsetAllSubs deprecated

func (c *Command) UnsetAllSubs() *Command

UnsetAllSubs unsets any flags that were previously set by one of:

Deprecated: Use Command.SubLangs with `all` as an argument, in addition to Command.WriteSubs.

func (*Command) UnsetAllowDynamicMPD

func (c *Command) UnsetAllowDynamicMPD() *Command

UnsetAllowDynamicMPD unsets any flags that were previously set by one of:

func (*Command) UnsetApListMSO

func (c *Command) UnsetApListMSO() *Command

UnsetApListMSO unsets any flags that were previously set by one of:

func (*Command) UnsetApMSO

func (c *Command) UnsetApMSO() *Command

UnsetApMSO unsets any flags that were previously set by one of:

func (*Command) UnsetApPassword

func (c *Command) UnsetApPassword() *Command

UnsetApPassword unsets any flags that were previously set by one of:

func (*Command) UnsetApUsername

func (c *Command) UnsetApUsername() *Command

UnsetApUsername unsets any flags that were previously set by one of:

func (*Command) UnsetAudioFormat

func (c *Command) UnsetAudioFormat() *Command

UnsetAudioFormat unsets any flags that were previously set by one of:

func (*Command) UnsetAudioMultistreams

func (c *Command) UnsetAudioMultistreams() *Command

UnsetAudioMultistreams unsets any flags that were previously set by one of:

func (*Command) UnsetAudioQuality

func (c *Command) UnsetAudioQuality() *Command

UnsetAudioQuality unsets any flags that were previously set by one of:

func (*Command) UnsetAutoNumberSize deprecated

func (c *Command) UnsetAutoNumberSize() *Command

UnsetAutoNumberSize unsets any flags that were previously set by one of:

Deprecated: Use string formatting, e.g. `%(autonumber)03d`.

func (*Command) UnsetAutoNumberStart deprecated

func (c *Command) UnsetAutoNumberStart() *Command

UnsetAutoNumberStart unsets any flags that were previously set by one of:

Deprecated: Use internal field formatting like `%(autonumber+NUMBER)s`.

func (*Command) UnsetBatchFile

func (c *Command) UnsetBatchFile() *Command

UnsetBatchFile unsets any flags that were previously set by one of:

func (*Command) UnsetBidiWorkaround

func (c *Command) UnsetBidiWorkaround() *Command

UnsetBidiWorkaround unsets any flags that were previously set by one of:

func (*Command) UnsetBreakMatchFilters

func (c *Command) UnsetBreakMatchFilters() *Command

UnsetBreakMatchFilters unsets any flags that were previously set by one of:

func (*Command) UnsetBreakOnExisting

func (c *Command) UnsetBreakOnExisting() *Command

UnsetBreakOnExisting unsets any flags that were previously set by one of:

func (*Command) UnsetBreakOnReject deprecated

func (c *Command) UnsetBreakOnReject() *Command

UnsetBreakOnReject unsets any flags that were previously set by one of:

Deprecated: Use Command.BreakMatchFilters instead.

func (*Command) UnsetBreakPerInput

func (c *Command) UnsetBreakPerInput() *Command

UnsetBreakPerInput unsets any flags that were previously set by one of:

func (*Command) UnsetBufferSize

func (c *Command) UnsetBufferSize() *Command

UnsetBufferSize unsets any flags that were previously set by one of:

func (*Command) UnsetCacheDir

func (c *Command) UnsetCacheDir() *Command

UnsetCacheDir unsets any flags that were previously set by one of:

func (*Command) UnsetCheckAllFormats

func (c *Command) UnsetCheckAllFormats() *Command

UnsetCheckAllFormats unsets any flags that were previously set by one of:

func (*Command) UnsetCheckCertificates

func (c *Command) UnsetCheckCertificates() *Command

UnsetCheckCertificates unsets any flags that were previously set by one of:

func (*Command) UnsetCheckFormats

func (c *Command) UnsetCheckFormats() *Command

UnsetCheckFormats unsets any flags that were previously set by one of:

func (*Command) UnsetCleanInfoJSON

func (c *Command) UnsetCleanInfoJSON() *Command

UnsetCleanInfoJSON unsets any flags that were previously set by one of:

func (*Command) UnsetClientCertificate

func (c *Command) UnsetClientCertificate() *Command

UnsetClientCertificate unsets any flags that were previously set by one of:

func (*Command) UnsetClientCertificateKey

func (c *Command) UnsetClientCertificateKey() *Command

UnsetClientCertificateKey unsets any flags that were previously set by one of:

func (*Command) UnsetClientCertificatePassword

func (c *Command) UnsetClientCertificatePassword() *Command

UnsetClientCertificatePassword unsets any flags that were previously set by one of:

func (*Command) UnsetColor

func (c *Command) UnsetColor() *Command

UnsetColor unsets any flags that were previously set by one of:

func (*Command) UnsetColors deprecated

func (c *Command) UnsetColors() *Command

UnsetColors unsets any flags that were previously set by one of:

Deprecated: Use Command.Color with `no_color` as an argument.

func (*Command) UnsetCompatOptions

func (c *Command) UnsetCompatOptions() *Command

UnsetCompatOptions unsets any flags that were previously set by one of:

func (*Command) UnsetConcatPlaylist

func (c *Command) UnsetConcatPlaylist() *Command

UnsetConcatPlaylist unsets any flags that were previously set by one of:

func (*Command) UnsetConcurrentFragments

func (c *Command) UnsetConcurrentFragments() *Command

UnsetConcurrentFragments unsets any flags that were previously set by one of:

func (*Command) UnsetConfigLocations

func (c *Command) UnsetConfigLocations() *Command

UnsetConfigLocations unsets any flags that were previously set by one of:

func (*Command) UnsetConsoleTitle

func (c *Command) UnsetConsoleTitle() *Command

UnsetConsoleTitle unsets any flags that were previously set by one of:

func (*Command) UnsetContinue

func (c *Command) UnsetContinue() *Command

UnsetContinue unsets any flags that were previously set by one of:

func (*Command) UnsetConvertSubs

func (c *Command) UnsetConvertSubs() *Command

UnsetConvertSubs unsets any flags that were previously set by one of:

func (*Command) UnsetConvertThumbnails

func (c *Command) UnsetConvertThumbnails() *Command

UnsetConvertThumbnails unsets any flags that were previously set by one of:

func (*Command) UnsetCookies

func (c *Command) UnsetCookies() *Command

UnsetCookies unsets any flags that were previously set by one of:

func (*Command) UnsetCookiesFromBrowser

func (c *Command) UnsetCookiesFromBrowser() *Command

UnsetCookiesFromBrowser unsets any flags that were previously set by one of:

func (*Command) UnsetDate

func (c *Command) UnsetDate() *Command

UnsetDate unsets any flags that were previously set by one of:

func (*Command) UnsetDateAfter

func (c *Command) UnsetDateAfter() *Command

UnsetDateAfter unsets any flags that were previously set by one of:

func (*Command) UnsetDateBefore

func (c *Command) UnsetDateBefore() *Command

UnsetDateBefore unsets any flags that were previously set by one of:

func (*Command) UnsetDefaultSearch

func (c *Command) UnsetDefaultSearch() *Command

UnsetDefaultSearch unsets any flags that were previously set by one of:

func (*Command) UnsetDownloadArchive

func (c *Command) UnsetDownloadArchive() *Command

UnsetDownloadArchive unsets any flags that were previously set by one of:

func (*Command) UnsetDownloadSections

func (c *Command) UnsetDownloadSections() *Command

UnsetDownloadSections unsets any flags that were previously set by one of:

func (*Command) UnsetDownloader

func (c *Command) UnsetDownloader() *Command

UnsetDownloader unsets any flags that were previously set by one of:

func (*Command) UnsetDownloaderArgs

func (c *Command) UnsetDownloaderArgs() *Command

UnsetDownloaderArgs unsets any flags that were previously set by one of:

func (*Command) UnsetDumpJSON

func (c *Command) UnsetDumpJSON() *Command

UnsetDumpJSON unsets any flags that were previously set by one of:

func (*Command) UnsetDumpPages

func (c *Command) UnsetDumpPages() *Command

UnsetDumpPages unsets any flags that were previously set by one of:

func (*Command) UnsetDumpSingleJSON

func (c *Command) UnsetDumpSingleJSON() *Command

UnsetDumpSingleJSON unsets any flags that were previously set by one of:

func (*Command) UnsetEmbedChapters

func (c *Command) UnsetEmbedChapters() *Command

UnsetEmbedChapters unsets any flags that were previously set by one of:

func (*Command) UnsetEmbedInfoJSON

func (c *Command) UnsetEmbedInfoJSON() *Command

UnsetEmbedInfoJSON unsets any flags that were previously set by one of:

func (*Command) UnsetEmbedMetadata

func (c *Command) UnsetEmbedMetadata() *Command

UnsetEmbedMetadata unsets any flags that were previously set by one of:

func (*Command) UnsetEmbedSubs

func (c *Command) UnsetEmbedSubs() *Command

UnsetEmbedSubs unsets any flags that were previously set by one of:

func (*Command) UnsetEmbedThumbnail

func (c *Command) UnsetEmbedThumbnail() *Command

UnsetEmbedThumbnail unsets any flags that were previously set by one of:

func (*Command) UnsetEnableFileURLs

func (c *Command) UnsetEnableFileURLs() *Command

UnsetEnableFileURLs unsets any flags that were previously set by one of:

func (*Command) UnsetEncoding

func (c *Command) UnsetEncoding() *Command

UnsetEncoding unsets any flags that were previously set by one of:

func (*Command) UnsetExec

func (c *Command) UnsetExec() *Command

UnsetExec unsets any flags that were previously set by one of:

func (*Command) UnsetExecBeforeDownload deprecated

func (c *Command) UnsetExecBeforeDownload() *Command

UnsetExecBeforeDownload unsets any flags that were previously set by one of:

Deprecated: Use Command.Exec with `before_dl:CMD` as an argument.

func (*Command) UnsetExtractAudio

func (c *Command) UnsetExtractAudio() *Command

UnsetExtractAudio unsets any flags that were previously set by one of:

func (*Command) UnsetExtractorArgs

func (c *Command) UnsetExtractorArgs() *Command

UnsetExtractorArgs unsets any flags that were previously set by one of:

func (*Command) UnsetExtractorRetries

func (c *Command) UnsetExtractorRetries() *Command

UnsetExtractorRetries unsets any flags that were previously set by one of:

func (*Command) UnsetFFmpegLocation

func (c *Command) UnsetFFmpegLocation() *Command

UnsetFFmpegLocation unsets any flags that were previously set by one of:

func (*Command) UnsetFileAccessRetries

func (c *Command) UnsetFileAccessRetries() *Command

UnsetFileAccessRetries unsets any flags that were previously set by one of:

func (*Command) UnsetFixup

func (c *Command) UnsetFixup() *Command

UnsetFixup unsets any flags that were previously set by one of:

func (*Command) UnsetFlatPlaylist

func (c *Command) UnsetFlatPlaylist() *Command

UnsetFlatPlaylist unsets any flags that were previously set by one of:

func (*Command) UnsetForceGenericExtractor deprecated

func (c *Command) UnsetForceGenericExtractor() *Command

UnsetForceGenericExtractor unsets any flags that were previously set by one of:

Deprecated: Use Command.UseExtractors with `generic,default` as an argument.

func (*Command) UnsetForceIPv4

func (c *Command) UnsetForceIPv4() *Command

UnsetForceIPv4 unsets any flags that were previously set by one of:

func (*Command) UnsetForceIPv6

func (c *Command) UnsetForceIPv6() *Command

UnsetForceIPv6 unsets any flags that were previously set by one of:

func (*Command) UnsetForceKeyframesAtCuts

func (c *Command) UnsetForceKeyframesAtCuts() *Command

UnsetForceKeyframesAtCuts unsets any flags that were previously set by one of:

func (*Command) UnsetForceOverwrites

func (c *Command) UnsetForceOverwrites() *Command

UnsetForceOverwrites unsets any flags that were previously set by one of:

func (*Command) UnsetForceWriteArchive

func (c *Command) UnsetForceWriteArchive() *Command

UnsetForceWriteArchive unsets any flags that were previously set by one of:

func (*Command) UnsetFormat

func (c *Command) UnsetFormat() *Command

UnsetFormat unsets any flags that were previously set by one of:

func (*Command) UnsetFormatSort

func (c *Command) UnsetFormatSort() *Command

UnsetFormatSort unsets any flags that were previously set by one of:

func (*Command) UnsetFormatSortForce

func (c *Command) UnsetFormatSortForce() *Command

UnsetFormatSortForce unsets any flags that were previously set by one of:

func (*Command) UnsetFragmentRetries

func (c *Command) UnsetFragmentRetries() *Command

UnsetFragmentRetries unsets any flags that were previously set by one of:

func (*Command) UnsetGeoBypass deprecated

func (c *Command) UnsetGeoBypass() *Command

UnsetGeoBypass unsets any flags that were previously set by one of:

Deprecated: Use Command.XFF with `default` as an argument.

func (*Command) UnsetGeoBypassCountry deprecated

func (c *Command) UnsetGeoBypassCountry() *Command

UnsetGeoBypassCountry unsets any flags that were previously set by one of:

Deprecated: Use Command.XFF with `CODE` as an argument.

func (*Command) UnsetGeoBypassIPBlock deprecated

func (c *Command) UnsetGeoBypassIPBlock() *Command

UnsetGeoBypassIPBlock unsets any flags that were previously set by one of:

Deprecated: Use Command.XFF with `IP_BLOCK` as an argument.

func (*Command) UnsetGeoVerificationProxy

func (c *Command) UnsetGeoVerificationProxy() *Command

UnsetGeoVerificationProxy unsets any flags that were previously set by one of:

func (*Command) UnsetGetDescription deprecated

func (c *Command) UnsetGetDescription() *Command

UnsetGetDescription unsets any flags that were previously set by one of:

Deprecated: Use Command.Print with `description` as an argument.

func (*Command) UnsetGetDuration deprecated

func (c *Command) UnsetGetDuration() *Command

UnsetGetDuration unsets any flags that were previously set by one of:

Deprecated: Use Command.Print with `duration_string` as an argument.

func (*Command) UnsetGetFilename deprecated

func (c *Command) UnsetGetFilename() *Command

UnsetGetFilename unsets any flags that were previously set by one of:

Deprecated: Use Command.Print with `filename` as an argument.

func (*Command) UnsetGetFormat deprecated

func (c *Command) UnsetGetFormat() *Command

UnsetGetFormat unsets any flags that were previously set by one of:

Deprecated: Use Command.Print with `format` as an argument.

func (*Command) UnsetGetID deprecated

func (c *Command) UnsetGetID() *Command

UnsetGetID unsets any flags that were previously set by one of:

Deprecated: Use Command.Print with `id` as an argument.

func (*Command) UnsetGetThumbnail deprecated

func (c *Command) UnsetGetThumbnail() *Command

UnsetGetThumbnail unsets any flags that were previously set by one of:

Deprecated: Use Command.Print with `thumbnail` as an argument.

func (*Command) UnsetGetTitle deprecated

func (c *Command) UnsetGetTitle() *Command

UnsetGetTitle unsets any flags that were previously set by one of:

Deprecated: Use Command.Print with `title` as an argument.

func (*Command) UnsetGetURL deprecated

func (c *Command) UnsetGetURL() *Command

UnsetGetURL unsets any flags that were previously set by one of:

Deprecated: Use Command.Print with `urls` as an argument.

func (*Command) UnsetHLSPreferFFmpeg deprecated

func (c *Command) UnsetHLSPreferFFmpeg() *Command

UnsetHLSPreferFFmpeg unsets any flags that were previously set by one of:

Deprecated: Use Command.Downloader with `m3u8:ffmpeg` as an argument.

func (*Command) UnsetHLSPreferNative deprecated

func (c *Command) UnsetHLSPreferNative() *Command

UnsetHLSPreferNative unsets any flags that were previously set by one of:

Deprecated: Use Command.Downloader with `m3u8:native` as an argument.

func (*Command) UnsetHLSSplitDiscontinuity

func (c *Command) UnsetHLSSplitDiscontinuity() *Command

UnsetHLSSplitDiscontinuity unsets any flags that were previously set by one of:

func (*Command) UnsetHLSUseMPEGTS

func (c *Command) UnsetHLSUseMPEGTS() *Command

UnsetHLSUseMPEGTS unsets any flags that were previously set by one of:

func (*Command) UnsetHTTPChunkSize

func (c *Command) UnsetHTTPChunkSize() *Command

UnsetHTTPChunkSize unsets any flags that were previously set by one of:

func (*Command) UnsetID deprecated

func (c *Command) UnsetID() *Command

UnsetID unsets any flags that were previously set by one of:

Deprecated: Use Command.Output with `%(id)s.%(ext)s` as an argument.

func (*Command) UnsetIgnoreConfig

func (c *Command) UnsetIgnoreConfig() *Command

UnsetIgnoreConfig unsets any flags that were previously set by one of:

func (*Command) UnsetIgnoreDynamicMPD

func (c *Command) UnsetIgnoreDynamicMPD() *Command

UnsetIgnoreDynamicMPD unsets any flags that were previously set by one of:

func (*Command) UnsetIgnoreErrors

func (c *Command) UnsetIgnoreErrors() *Command

UnsetIgnoreErrors unsets any flags that were previously set by one of:

func (*Command) UnsetIgnoreNoFormatsError

func (c *Command) UnsetIgnoreNoFormatsError() *Command

UnsetIgnoreNoFormatsError unsets any flags that were previously set by one of:

func (*Command) UnsetImpersonate

func (c *Command) UnsetImpersonate() *Command

UnsetImpersonate unsets any flags that were previously set by one of:

func (*Command) UnsetJsRuntimes

func (c *Command) UnsetJsRuntimes() *Command

UnsetJsRuntimes unsets any flags that were previously set by one of:

func (*Command) UnsetKeepFragments

func (c *Command) UnsetKeepFragments() *Command

UnsetKeepFragments unsets any flags that were previously set by one of:

func (*Command) UnsetKeepVideo

func (c *Command) UnsetKeepVideo() *Command

UnsetKeepVideo unsets any flags that were previously set by one of:

func (*Command) UnsetLazyPlaylist

func (c *Command) UnsetLazyPlaylist() *Command

UnsetLazyPlaylist unsets any flags that were previously set by one of:

func (*Command) UnsetLegacyServerConnect

func (c *Command) UnsetLegacyServerConnect() *Command

UnsetLegacyServerConnect unsets any flags that were previously set by one of:

func (*Command) UnsetLimitRate

func (c *Command) UnsetLimitRate() *Command

UnsetLimitRate unsets any flags that were previously set by one of:

func (*Command) UnsetListFormats deprecated

func (c *Command) UnsetListFormats() *Command

UnsetListFormats unsets any flags that were previously set by one of:

Deprecated: Use Command.Print with `formats_table` as an argument.

func (*Command) UnsetListFormatsAsTable deprecated

func (c *Command) UnsetListFormatsAsTable() *Command

UnsetListFormatsAsTable unsets any flags that were previously set by one of:

Deprecated: Use Command.ListFormatsAsTable or Command.CompatOptions with `-list-formats` as an argument.

func (*Command) UnsetListFormatsOld deprecated

func (c *Command) UnsetListFormatsOld() *Command

UnsetListFormatsOld unsets any flags that were previously set by one of:

Deprecated: Use Command.CompatOptions with `list-formats` as an argument.

func (*Command) UnsetListImpersonateTargets

func (c *Command) UnsetListImpersonateTargets() *Command

UnsetListImpersonateTargets unsets any flags that were previously set by one of:

func (*Command) UnsetListSubs

func (c *Command) UnsetListSubs() *Command

UnsetListSubs unsets any flags that were previously set by one of:

func (*Command) UnsetListThumbnails deprecated

func (c *Command) UnsetListThumbnails() *Command

UnsetListThumbnails unsets any flags that were previously set by one of:

Deprecated: Call Command.Print twice, once with `thumbnails_table` as an argument, then with `playlist:thumbnails_table` as an argument.

func (*Command) UnsetLiveFromStart

func (c *Command) UnsetLiveFromStart() *Command

UnsetLiveFromStart unsets any flags that were previously set by one of:

func (*Command) UnsetLoadInfoJSON

func (c *Command) UnsetLoadInfoJSON() *Command

UnsetLoadInfoJSON unsets any flags that were previously set by one of:

func (*Command) UnsetMarkWatched

func (c *Command) UnsetMarkWatched() *Command

UnsetMarkWatched unsets any flags that were previously set by one of:

func (*Command) UnsetMatchFilters

func (c *Command) UnsetMatchFilters() *Command

UnsetMatchFilters unsets any flags that were previously set by one of:

func (*Command) UnsetMatchTitle deprecated

func (c *Command) UnsetMatchTitle() *Command

UnsetMatchTitle unsets any flags that were previously set by one of:

Deprecated: Use Command.MatchFilters instead (e.g. `title ~= (?i)REGEX`).

func (*Command) UnsetMaxDownloads

func (c *Command) UnsetMaxDownloads() *Command

UnsetMaxDownloads unsets any flags that were previously set by one of:

func (*Command) UnsetMaxFileSize

func (c *Command) UnsetMaxFileSize() *Command

UnsetMaxFileSize unsets any flags that were previously set by one of:

func (*Command) UnsetMaxSleepInterval

func (c *Command) UnsetMaxSleepInterval() *Command

UnsetMaxSleepInterval unsets any flags that were previously set by one of:

func (*Command) UnsetMaxViews deprecated

func (c *Command) UnsetMaxViews() *Command

UnsetMaxViews unsets any flags that were previously set by one of:

Deprecated: Use Command.MatchFilters instead (e.g. `view_count <=? COUNT`).

func (*Command) UnsetMergeOutputFormat

func (c *Command) UnsetMergeOutputFormat() *Command

UnsetMergeOutputFormat unsets any flags that were previously set by one of:

func (*Command) UnsetMetadataFromTitle deprecated

func (c *Command) UnsetMetadataFromTitle() *Command

UnsetMetadataFromTitle unsets any flags that were previously set by one of:

Deprecated: Use Command.ParseMetadata with `%(title)s:FORMAT` as an argument.

func (*Command) UnsetMinFileSize

func (c *Command) UnsetMinFileSize() *Command

UnsetMinFileSize unsets any flags that were previously set by one of:

func (*Command) UnsetMinViews deprecated

func (c *Command) UnsetMinViews() *Command

UnsetMinViews unsets any flags that were previously set by one of:

Deprecated: Use Command.MatchFilters instead (e.g. `view_count >=? COUNT`).

func (*Command) UnsetMtime

func (c *Command) UnsetMtime() *Command

UnsetMtime unsets any flags that were previously set by one of:

func (*Command) UnsetNetrc

func (c *Command) UnsetNetrc() *Command

UnsetNetrc unsets any flags that were previously set by one of:

func (*Command) UnsetNetrcCmd

func (c *Command) UnsetNetrcCmd() *Command

UnsetNetrcCmd unsets any flags that were previously set by one of:

func (*Command) UnsetNetrcLocation

func (c *Command) UnsetNetrcLocation() *Command

UnsetNetrcLocation unsets any flags that were previously set by one of:

func (*Command) UnsetNewline

func (c *Command) UnsetNewline() *Command

UnsetNewline unsets any flags that were previously set by one of:

func (*Command) UnsetOutput

func (c *Command) UnsetOutput() *Command

UnsetOutput unsets any flags that were previously set by one of:

func (*Command) UnsetOutputNaPlaceholder

func (c *Command) UnsetOutputNaPlaceholder() *Command

UnsetOutputNaPlaceholder unsets any flags that were previously set by one of:

func (*Command) UnsetOverwrites

func (c *Command) UnsetOverwrites() *Command

UnsetOverwrites unsets any flags that were previously set by one of:

func (*Command) UnsetParseMetadata

func (c *Command) UnsetParseMetadata() *Command

UnsetParseMetadata unsets any flags that were previously set by one of:

func (*Command) UnsetPart

func (c *Command) UnsetPart() *Command

UnsetPart unsets any flags that were previously set by one of:

func (*Command) UnsetPassword

func (c *Command) UnsetPassword() *Command

UnsetPassword unsets any flags that were previously set by one of:

func (*Command) UnsetPaths

func (c *Command) UnsetPaths() *Command

UnsetPaths unsets any flags that were previously set by one of:

func (*Command) UnsetPlaylist

func (c *Command) UnsetPlaylist() *Command

UnsetPlaylist unsets any flags that were previously set by one of:

func (*Command) UnsetPlaylistEnd deprecated

func (c *Command) UnsetPlaylistEnd() *Command

UnsetPlaylistEnd unsets any flags that were previously set by one of:

Deprecated: Use Command.PlaylistItems with `:<your-number>` as an argument.

func (*Command) UnsetPlaylistItems

func (c *Command) UnsetPlaylistItems() *Command

UnsetPlaylistItems unsets any flags that were previously set by one of:

func (*Command) UnsetPlaylistRandom

func (c *Command) UnsetPlaylistRandom() *Command

UnsetPlaylistRandom unsets any flags that were previously set by one of:

func (*Command) UnsetPlaylistReverse deprecated

func (c *Command) UnsetPlaylistReverse() *Command

UnsetPlaylistReverse unsets any flags that were previously set by one of:

Deprecated: Use Command.PlaylistItems with `::-1` as an argument.

func (*Command) UnsetPlaylistStart deprecated

func (c *Command) UnsetPlaylistStart() *Command

UnsetPlaylistStart unsets any flags that were previously set by one of:

Deprecated: Use Command.PlaylistItems with `<your-number>:` as an argument.

func (*Command) UnsetPluginDirs

func (c *Command) UnsetPluginDirs() *Command

UnsetPluginDirs unsets any flags that were previously set by one of:

func (*Command) UnsetPostOverwrites

func (c *Command) UnsetPostOverwrites() *Command

UnsetPostOverwrites unsets any flags that were previously set by one of:

func (*Command) UnsetPostProcessorArgs

func (c *Command) UnsetPostProcessorArgs() *Command

UnsetPostProcessorArgs unsets any flags that were previously set by one of:

func (*Command) UnsetPreferFreeFormats

func (c *Command) UnsetPreferFreeFormats() *Command

UnsetPreferFreeFormats unsets any flags that were previously set by one of:

func (*Command) UnsetPreferInsecure

func (c *Command) UnsetPreferInsecure() *Command

UnsetPreferInsecure unsets any flags that were previously set by one of:

func (*Command) UnsetPresetAlias

func (c *Command) UnsetPresetAlias() *Command

UnsetPresetAlias unsets any flags that were previously set by one of:

func (*Command) UnsetPrint

func (c *Command) UnsetPrint() *Command

UnsetPrint unsets any flags that were previously set by one of:

func (*Command) UnsetPrintJSON

func (c *Command) UnsetPrintJSON() *Command

UnsetPrintJSON unsets any flags that were previously set by one of:

func (*Command) UnsetPrintToFile

func (c *Command) UnsetPrintToFile() *Command

UnsetPrintToFile unsets any flags that were previously set by one of:

func (*Command) UnsetPrintTraffic

func (c *Command) UnsetPrintTraffic() *Command

UnsetPrintTraffic unsets any flags that were previously set by one of:

func (*Command) UnsetProgress

func (c *Command) UnsetProgress() *Command

UnsetProgress unsets any flags that were previously set by one of:

func (*Command) UnsetProgressDelta

func (c *Command) UnsetProgressDelta() *Command

UnsetProgressDelta unsets any flags that were previously set by one of:

func (*Command) UnsetProgressFunc

func (c *Command) UnsetProgressFunc() *Command

UnsetProgressFunc can be used to unset the progress function that was previously set with Command.ProgressFunc.

func (*Command) UnsetProgressTemplate

func (c *Command) UnsetProgressTemplate() *Command

UnsetProgressTemplate unsets any flags that were previously set by one of:

func (*Command) UnsetProxy

func (c *Command) UnsetProxy() *Command

UnsetProxy unsets any flags that were previously set by one of:

func (*Command) UnsetQuiet

func (c *Command) UnsetQuiet() *Command

UnsetQuiet unsets any flags that were previously set by one of:

func (*Command) UnsetRecodeVideo

func (c *Command) UnsetRecodeVideo() *Command

UnsetRecodeVideo unsets any flags that were previously set by one of:

func (*Command) UnsetReferer deprecated

func (c *Command) UnsetReferer() *Command

UnsetReferer unsets any flags that were previously set by one of:

Deprecated: Use Command.AddHeaders instead (e.g. `Referer:URL`).

func (*Command) UnsetRejectTitle deprecated

func (c *Command) UnsetRejectTitle() *Command

UnsetRejectTitle unsets any flags that were previously set by one of:

Deprecated: Use Command.MatchFilters instead (e.g. `title !~= (?i)REGEX`).

func (*Command) UnsetRemoteComponents

func (c *Command) UnsetRemoteComponents() *Command

UnsetRemoteComponents unsets any flags that were previously set by one of:

func (*Command) UnsetRemoveChapters

func (c *Command) UnsetRemoveChapters() *Command

UnsetRemoveChapters unsets any flags that were previously set by one of:

func (*Command) UnsetRemuxVideo

func (c *Command) UnsetRemuxVideo() *Command

UnsetRemuxVideo unsets any flags that were previously set by one of:

func (*Command) UnsetReplaceInMetadata

func (c *Command) UnsetReplaceInMetadata() *Command

UnsetReplaceInMetadata unsets any flags that were previously set by one of:

func (*Command) UnsetResizeBuffer

func (c *Command) UnsetResizeBuffer() *Command

UnsetResizeBuffer unsets any flags that were previously set by one of:

func (*Command) UnsetRestrictFilenames

func (c *Command) UnsetRestrictFilenames() *Command

UnsetRestrictFilenames unsets any flags that were previously set by one of:

func (*Command) UnsetRetries

func (c *Command) UnsetRetries() *Command

UnsetRetries unsets any flags that were previously set by one of:

func (*Command) UnsetRetrySleep

func (c *Command) UnsetRetrySleep() *Command

UnsetRetrySleep unsets any flags that were previously set by one of:

func (*Command) UnsetRmCacheDir

func (c *Command) UnsetRmCacheDir() *Command

UnsetRmCacheDir unsets any flags that were previously set by one of:

func (*Command) UnsetSimulate

func (c *Command) UnsetSimulate() *Command

UnsetSimulate unsets any flags that were previously set by one of:

func (*Command) UnsetSkipDownload

func (c *Command) UnsetSkipDownload() *Command

UnsetSkipDownload unsets any flags that were previously set by one of:

func (*Command) UnsetSkipPlaylistAfterErrors

func (c *Command) UnsetSkipPlaylistAfterErrors() *Command

UnsetSkipPlaylistAfterErrors unsets any flags that were previously set by one of:

func (*Command) UnsetSkipUnavailableFragments

func (c *Command) UnsetSkipUnavailableFragments() *Command

UnsetSkipUnavailableFragments unsets any flags that were previously set by one of:

func (*Command) UnsetSleepInterval

func (c *Command) UnsetSleepInterval() *Command

UnsetSleepInterval unsets any flags that were previously set by one of:

func (*Command) UnsetSleepRequests

func (c *Command) UnsetSleepRequests() *Command

UnsetSleepRequests unsets any flags that were previously set by one of:

func (*Command) UnsetSleepSubtitles

func (c *Command) UnsetSleepSubtitles() *Command

UnsetSleepSubtitles unsets any flags that were previously set by one of:

func (*Command) UnsetSocketTimeout

func (c *Command) UnsetSocketTimeout() *Command

UnsetSocketTimeout unsets any flags that were previously set by one of:

func (*Command) UnsetSourceAddress

func (c *Command) UnsetSourceAddress() *Command

UnsetSourceAddress unsets any flags that were previously set by one of:

func (*Command) UnsetSplitChapters

func (c *Command) UnsetSplitChapters() *Command

UnsetSplitChapters unsets any flags that were previously set by one of:

func (*Command) UnsetSponsorblock

func (c *Command) UnsetSponsorblock() *Command

UnsetSponsorblock unsets any flags that were previously set by one of:

func (*Command) UnsetSponsorblockAPI

func (c *Command) UnsetSponsorblockAPI() *Command

UnsetSponsorblockAPI unsets any flags that were previously set by one of:

func (*Command) UnsetSponsorblockChapterTitle

func (c *Command) UnsetSponsorblockChapterTitle() *Command

UnsetSponsorblockChapterTitle unsets any flags that were previously set by one of:

func (*Command) UnsetSponsorblockMark

func (c *Command) UnsetSponsorblockMark() *Command

UnsetSponsorblockMark unsets any flags that were previously set by one of:

func (*Command) UnsetSponsorblockRemove

func (c *Command) UnsetSponsorblockRemove() *Command

UnsetSponsorblockRemove unsets any flags that were previously set by one of:

func (*Command) UnsetSubFormat

func (c *Command) UnsetSubFormat() *Command

UnsetSubFormat unsets any flags that were previously set by one of:

func (*Command) UnsetSubLangs

func (c *Command) UnsetSubLangs() *Command

UnsetSubLangs unsets any flags that were previously set by one of:

func (*Command) UnsetThrottledRate

func (c *Command) UnsetThrottledRate() *Command

UnsetThrottledRate unsets any flags that were previously set by one of:

func (*Command) UnsetTrimFilenames

func (c *Command) UnsetTrimFilenames() *Command

UnsetTrimFilenames unsets any flags that were previously set by one of:

func (*Command) UnsetTwoFactor

func (c *Command) UnsetTwoFactor() *Command

UnsetTwoFactor unsets any flags that were previously set by one of:

func (*Command) UnsetUpdate

func (c *Command) UnsetUpdate() *Command

UnsetUpdate unsets any flags that were previously set by one of:

func (*Command) UnsetUseExtractors

func (c *Command) UnsetUseExtractors() *Command

UnsetUseExtractors unsets any flags that were previously set by one of:

func (*Command) UnsetUsePostProcessor

func (c *Command) UnsetUsePostProcessor() *Command

UnsetUsePostProcessor unsets any flags that were previously set by one of:

func (*Command) UnsetUserAgent deprecated

func (c *Command) UnsetUserAgent() *Command

UnsetUserAgent unsets any flags that were previously set by one of:

Deprecated: Use Command.AddHeaders instead (e.g. `User-Agent:UA`).

func (*Command) UnsetUsername

func (c *Command) UnsetUsername() *Command

UnsetUsername unsets any flags that were previously set by one of:

func (*Command) UnsetVerbose

func (c *Command) UnsetVerbose() *Command

UnsetVerbose unsets any flags that were previously set by one of:

func (*Command) UnsetVideoMultistreams

func (c *Command) UnsetVideoMultistreams() *Command

UnsetVideoMultistreams unsets any flags that were previously set by one of:

func (*Command) UnsetVideoPassword

func (c *Command) UnsetVideoPassword() *Command

UnsetVideoPassword unsets any flags that were previously set by one of:

func (*Command) UnsetWaitForVideo

func (c *Command) UnsetWaitForVideo() *Command

UnsetWaitForVideo unsets any flags that were previously set by one of:

func (*Command) UnsetWarnings

func (c *Command) UnsetWarnings() *Command

UnsetWarnings unsets any flags that were previously set by one of:

func (*Command) UnsetWindowsFilenames

func (c *Command) UnsetWindowsFilenames() *Command

UnsetWindowsFilenames unsets any flags that were previously set by one of:

func (*Command) UnsetWriteAllThumbnails

func (c *Command) UnsetWriteAllThumbnails() *Command

UnsetWriteAllThumbnails unsets any flags that were previously set by one of:

func (*Command) UnsetWriteAutoSubs

func (c *Command) UnsetWriteAutoSubs() *Command

UnsetWriteAutoSubs unsets any flags that were previously set by one of:

func (*Command) UnsetWriteComments

func (c *Command) UnsetWriteComments() *Command

UnsetWriteComments unsets any flags that were previously set by one of:

func (*Command) UnsetWriteDescription

func (c *Command) UnsetWriteDescription() *Command

UnsetWriteDescription unsets any flags that were previously set by one of:

func (c *Command) UnsetWriteDesktopLink() *Command

UnsetWriteDesktopLink unsets any flags that were previously set by one of:

func (*Command) UnsetWriteInfoJSON

func (c *Command) UnsetWriteInfoJSON() *Command

UnsetWriteInfoJSON unsets any flags that were previously set by one of:

func (c *Command) UnsetWriteLink() *Command

UnsetWriteLink unsets any flags that were previously set by one of:

func (*Command) UnsetWritePages

func (c *Command) UnsetWritePages() *Command

UnsetWritePages unsets any flags that were previously set by one of:

func (*Command) UnsetWritePlaylistMetafiles

func (c *Command) UnsetWritePlaylistMetafiles() *Command

UnsetWritePlaylistMetafiles unsets any flags that were previously set by one of:

func (*Command) UnsetWriteSubs

func (c *Command) UnsetWriteSubs() *Command

UnsetWriteSubs unsets any flags that were previously set by one of:

func (*Command) UnsetWriteThumbnail

func (c *Command) UnsetWriteThumbnail() *Command

UnsetWriteThumbnail unsets any flags that were previously set by one of:

func (c *Command) UnsetWriteURLLink() *Command

UnsetWriteURLLink unsets any flags that were previously set by one of:

func (c *Command) UnsetWriteWeblocLink() *Command

UnsetWriteWeblocLink unsets any flags that were previously set by one of:

func (*Command) UnsetXFF

func (c *Command) UnsetXFF() *Command

UnsetXFF unsets any flags that were previously set by one of:

func (*Command) UnsetXattrs

func (c *Command) UnsetXattrs() *Command

UnsetXattrs unsets any flags that were previously set by one of:

func (*Command) Update

func (c *Command) Update(ctx context.Context) (*Result, error)

Check if updates are available. You cannot update when running from source code; Use git to pull the latest changes

References:

Additional information:

  • Update maps to cli flags: -U/--update.
  • From option group: "General"

func (*Command) UpdateTo

func (c *Command) UpdateTo(ctx context.Context, value string) (*Result, error)

Upgrade/downgrade to a specific version. CHANNEL can be a repository as well. CHANNEL and TAG default to "stable" and "latest" respectively if omitted; See "UPDATE" for details. Supported channels: stable, nightly, master

References:

Additional information:

  • UpdateTo maps to cli flags: --update-to=[CHANNEL]@[TAG].
  • From option group: "General"

func (*Command) UseExtractors

func (c *Command) UseExtractors(names string) *Command

Extractor names to use separated by commas. You can also use regexes, "all", "default" and "end" (end URL matching); e.g. --ies "holodex.*,end,youtube". Prefix the name with a "-" to exclude it, e.g. --ies default,-generic. Use --list-extractors for a list of extractor names.

Additional information:

  • See Command.UnsetUseExtractors, for unsetting the flag.
  • UseExtractors maps to cli flags: --use-extractors/--ies=NAMES.
  • From option group: "General"

func (*Command) UsePostProcessor

func (c *Command) UsePostProcessor(name string) *Command

The (case-sensitive) name of plugin postprocessors to be enabled, and (optionally) arguments to be passed to it, separated by a colon ":". ARGS are a semicolon ";" delimited list of NAME=VALUE. The "when" argument determines when the postprocessor is invoked. It can be one of "pre_process" (after video extraction), "after_filter" (after video passes filter), "video" (after --format; before --print/--output), "before_dl" (before each video download), "post_process" (after each video download; default), "after_move" (after moving the video file to its final location), "after_video" (after downloading and processing all formats of a video), or "playlist" (at end of playlist). This option can be used multiple times to add different postprocessors

Additional information:

  • See Command.UnsetUsePostProcessor, for unsetting the flag.
  • UsePostProcessor maps to cli flags: --use-postprocessor=NAME[:ARGS].
  • From option group: "Post-Processing"

func (*Command) UserAgent deprecated

func (c *Command) UserAgent(ua string) *Command

UserAgent sets the "user-agent" flag (no description specified).

Additional information:

  • See Command.UnsetUserAgent, for unsetting the flag.
  • UserAgent maps to cli flags: --user-agent=UA (hidden).
  • From option group: "Workarounds"

Deprecated: Use Command.AddHeaders instead (e.g. `User-Agent:UA`).

func (*Command) Username

func (c *Command) Username(username string) *Command

Login with this account ID

Additional information:

  • See Command.UnsetUsername, for unsetting the flag.
  • Username maps to cli flags: -u/--username=USERNAME.
  • From option group: "Authentication"

func (*Command) Verbose

func (c *Command) Verbose() *Command

Print various debugging information

Additional information:

  • See Command.UnsetVerbose, for unsetting the flag.
  • Verbose maps to cli flags: -v/--verbose.
  • From option group: "Verbosity Simulation"

func (*Command) Version

func (c *Command) Version(ctx context.Context) (*Result, error)

Print program version and exit

Additional information:

  • Version maps to cli flags: --version.
  • From option group: "General"

func (*Command) VideoMultistreams

func (c *Command) VideoMultistreams() *Command

Allow multiple video streams to be merged into a single file

References:

Additional information:

  • See Command.UnsetVideoMultistreams, for unsetting the flag.
  • VideoMultistreams maps to cli flags: --video-multistreams.
  • From option group: "Video Format"

func (*Command) VideoPassword

func (c *Command) VideoPassword(password string) *Command

Video-specific password

Additional information:

  • See Command.UnsetVideoPassword, for unsetting the flag.
  • VideoPassword maps to cli flags: --video-password=PASSWORD.
  • From option group: "Authentication"

func (*Command) WaitForVideo

func (c *Command) WaitForVideo(min string) *Command

Wait for scheduled streams to become available. Pass the minimum number of seconds (or range) to wait between retries

Additional information:

  • See Command.UnsetWaitForVideo, for unsetting the flag.
  • WaitForVideo maps to cli flags: --wait-for-video=MIN[-MAX].
  • From option group: "General"

func (*Command) WindowsFilenames

func (c *Command) WindowsFilenames() *Command

Force filenames to be Windows-compatible

Additional information:

  • See Command.UnsetWindowsFilenames, for unsetting the flag.
  • WindowsFilenames maps to cli flags: --windows-filenames.
  • From option group: "Filesystem"

func (*Command) WriteAllThumbnails

func (c *Command) WriteAllThumbnails() *Command

Write all thumbnail image formats to disk

Additional information:

  • See Command.UnsetWriteAllThumbnails, for unsetting the flag.
  • WriteAllThumbnails maps to cli flags: --write-all-thumbnails.
  • From option group: "Thumbnail"

func (*Command) WriteAutoSubs

func (c *Command) WriteAutoSubs() *Command

Write automatically generated subtitle file

Additional information:

  • See Command.UnsetWriteAutoSubs, for unsetting the flag.
  • WriteAutoSubs maps to cli flags: --write-auto-subs/--write-automatic-subs.
  • From option group: "Subtitle"

func (*Command) WriteComments

func (c *Command) WriteComments() *Command

Retrieve video comments to be placed in the infojson. The comments are fetched even without this option if the extraction is known to be quick

Additional information:

  • See Command.UnsetWriteComments, for unsetting the flag.
  • WriteComments maps to cli flags: --write-comments/--get-comments.
  • From option group: "Filesystem"

func (*Command) WriteDescription

func (c *Command) WriteDescription() *Command

Write video description to a .description file

Additional information:

  • See Command.UnsetWriteDescription, for unsetting the flag.
  • WriteDescription maps to cli flags: --write-description.
  • From option group: "Filesystem"
func (c *Command) WriteDesktopLink() *Command

Write a .desktop Linux internet shortcut

Additional information:

  • See Command.UnsetWriteDesktopLink, for unsetting the flag.
  • WriteDesktopLink maps to cli flags: --write-desktop-link.
  • From option group: "Internet Shortcut"

func (*Command) WriteInfoJSON

func (c *Command) WriteInfoJSON() *Command

Write video metadata to a .info.json file (this may contain personal information)

Additional information:

  • See Command.UnsetWriteInfoJSON, for unsetting the flag.
  • WriteInfoJSON maps to cli flags: --write-info-json.
  • From option group: "Filesystem"
func (c *Command) WriteLink() *Command

Write an internet shortcut file, depending on the current platform (.url, .webloc or .desktop). The URL may be cached by the OS

Additional information:

  • See Command.UnsetWriteLink, for unsetting the flag.
  • WriteLink maps to cli flags: --write-link.
  • From option group: "Internet Shortcut"

func (*Command) WritePages

func (c *Command) WritePages() *Command

Write downloaded intermediary pages to files in the current directory to debug problems

Additional information:

  • See Command.UnsetWritePages, for unsetting the flag.
  • WritePages maps to cli flags: --write-pages.
  • From option group: "Verbosity Simulation"

func (*Command) WritePlaylistMetafiles

func (c *Command) WritePlaylistMetafiles() *Command

Write playlist metadata in addition to the video metadata when using --write-info-json, --write-description etc. (default)

Additional information:

func (*Command) WriteSubs

func (c *Command) WriteSubs() *Command

Write subtitle file

Additional information:

  • See Command.UnsetWriteSubs, for unsetting the flag.
  • WriteSubs maps to cli flags: --write-subs/--write-srt.
  • From option group: "Subtitle"

func (*Command) WriteThumbnail

func (c *Command) WriteThumbnail() *Command

Write thumbnail image to disk

Additional information:

  • See Command.UnsetWriteThumbnail, for unsetting the flag.
  • WriteThumbnail maps to cli flags: --write-thumbnail.
  • From option group: "Thumbnail"
func (c *Command) WriteURLLink() *Command

Write a .url Windows internet shortcut. The OS caches the URL based on the file path

Additional information:

  • See Command.UnsetWriteURLLink, for unsetting the flag.
  • WriteURLLink maps to cli flags: --write-url-link.
  • From option group: "Internet Shortcut"
func (c *Command) WriteWeblocLink() *Command

Write a .webloc macOS internet shortcut

Additional information:

  • See Command.UnsetWriteWeblocLink, for unsetting the flag.
  • WriteWeblocLink maps to cli flags: --write-webloc-link.
  • From option group: "Internet Shortcut"

func (*Command) XFF

func (c *Command) XFF(value string) *Command

How to fake X-Forwarded-For HTTP header to try bypassing geographic restriction. One of "default" (only when known to be useful), "never", an IP block in CIDR notation, or a two-letter ISO 3166-2 country code

Additional information:

  • See Command.UnsetXFF, for unsetting the flag.
  • XFF maps to cli flags: --xff=VALUE.
  • From option group: "Geo-restriction"

func (*Command) Xattrs

func (c *Command) Xattrs() *Command

Write metadata to the video file's xattrs (using Dublin Core and XDG standards)

Additional information:

  • See Command.UnsetXattrs, for unsetting the flag.
  • Xattrs maps to cli flags: --xattrs/--xattr.
  • From option group: "Post-Processing"

func (*Command) YesPlaylist

func (c *Command) YesPlaylist() *Command

Download the playlist, if the URL refers to a video and a playlist

Additional information:

  • See Command.UnsetPlaylist, for unsetting the flag.
  • YesPlaylist maps to cli flags: --yes-playlist.
  • From option group: "Video Selection"

type ConcatPlaylistOption

type ConcatPlaylistOption string

ConcatPlaylistOption are parameter types for [ConcatPlaylist].

var (
	ConcatPlaylistNever      ConcatPlaylistOption = "never"
	ConcatPlaylistAlways     ConcatPlaylistOption = "always"
	ConcatPlaylistMultiVideo ConcatPlaylistOption = "multi_video"
)

type ErrExitCode

type ErrExitCode struct {
	// contains filtered or unexported fields
}

ErrExitCode is returned when the exit code of the yt-dlp process is non-zero.

func IsExitCodeError

func IsExitCodeError(err error) (*ErrExitCode, bool)

IsExitCodeError returns true when the exit code of the yt-dlp process is non-zero.

func (*ErrExitCode) Error

func (e *ErrExitCode) Error() string

func (*ErrExitCode) Unwrap

func (e *ErrExitCode) Unwrap() error

type ErrJSONParsingFlag

type ErrJSONParsingFlag struct {
	ID       string `json:"id,omitempty"`
	JSONPath string `json:"json_path,omitempty"`
	Flag     string `json:"flag,omitempty"`
	Err      error  `json:"error,omitempty"`
}

func IsJSONParsingFlagError

func IsJSONParsingFlagError(err error) (*ErrJSONParsingFlag, bool)

IsJSONParsingFlagError returns true when the error is a JSON parsing error.

func (*ErrJSONParsingFlag) Error

func (e *ErrJSONParsingFlag) Error() string

func (*ErrJSONParsingFlag) Unwrap

func (e *ErrJSONParsingFlag) Unwrap() error

type ErrMisconfig

type ErrMisconfig struct {
	// contains filtered or unexported fields
}

ErrMisconfig is returned when the yt-dlp executable is not found, or is not configured properly.

func IsMisconfigError

func IsMisconfigError(err error) (*ErrMisconfig, bool)

IsMisconfigError returns true when the yt-dlp executable is not found, or is not configured properly.

func (*ErrMisconfig) Error

func (e *ErrMisconfig) Error() string

func (*ErrMisconfig) Unwrap

func (e *ErrMisconfig) Unwrap() error

type ErrMultipleJSONParsingFlags

type ErrMultipleJSONParsingFlags struct {
	Errors []*ErrJSONParsingFlag `json:"errors,omitempty"`
}

func IsMultipleJSONParsingFlagsError

func IsMultipleJSONParsingFlagsError(err error) (*ErrMultipleJSONParsingFlags, bool)

func (*ErrMultipleJSONParsingFlags) Error

type ErrParsing

type ErrParsing struct {
	// contains filtered or unexported fields
}

ErrParsing is returned when the yt-dlp process fails due to an invalid flag or argument, possibly due to a version mismatch or go-ytdlp bug.

func IsParsingError

func IsParsingError(err error) (*ErrParsing, bool)

IsParsingError returns true when the yt-dlp process fails due to an invalid flag or argument, possibly due to a version mismatch or go-ytdlp bug.

func (*ErrParsing) Error

func (e *ErrParsing) Error() string

func (*ErrParsing) Unwrap

func (e *ErrParsing) Unwrap() error

type ErrUnknown

type ErrUnknown struct {
	// contains filtered or unexported fields
}

ErrUnknown is returned when the error is unknown according to go-ytdlp.

func IsUnknownError

func IsUnknownError(err error) (*ErrUnknown, bool)

IsUnknownError returns true when the error is unknown according to go-ytdlp.

func (*ErrUnknown) Error

func (e *ErrUnknown) Error() string

func (*ErrUnknown) Unwrap

func (e *ErrUnknown) Unwrap() error

type ExtractedAvailability

type ExtractedAvailability string
const (
	ExtractedAvailabilityPrivate        ExtractedAvailability = "private"
	ExtractedAvailabilityPremiumOnly    ExtractedAvailability = "premium_only"
	ExtractedAvailabilitySubscriberOnly ExtractedAvailability = "subscriber_only"
	ExtractedAvailabilityNeedsAuth      ExtractedAvailability = "needs_auth"
	ExtractedAvailabilityUnlisted       ExtractedAvailability = "unlisted"
	ExtractedAvailabilityPublic         ExtractedAvailability = "public"
)

type ExtractedChapterData

type ExtractedChapterData struct {
	// StartTime of the chapter in seconds.
	StartTime *float64 `json:"start_time,omitempty"`

	// EndTime of the chapter in seconds.
	EndTime *float64 `json:"end_time,omitempty"`

	// Title of the chapter.
	Title *string `json:"title,omitempty"`
}

type ExtractedFormat

type ExtractedFormat struct {
	// URL is the mandatory URL representing the media:
	//   - plain file media: HTTP URL of this file.
	//   - RTMP: RTMP URL.
	//   - HLS: URL of the M3U8 media playlist.
	//   - HDS: URL of the F4M manifest.
	//   - DASH:
	//       - HTTP URL to plain file media (in case of
	//         unfragmented media)
	//       - URL of the MPD manifest or base URL
	//         representing the media if MPD manifest
	//         is parsed from a string (in case of
	//         fragmented media)
	//   - MSS: URL of the ISM manifest.
	URL string `json:"url"`

	// RequestData to send in POST request to the URL.
	RequestData *string `json:"request_data,omitempty"`

	// ManifestURL is the URL of the manifest file in case of fragmented media:
	//   - HLS: URL of the M3U8 master playlist.
	//   - HDS: URL of the F4M manifest.
	//   - DASH: URL of the MPD manifest.
	//   - MSS: URL of the ISM manifest.
	ManifestURL *string `json:"manifest_url,omitempty"`

	// Extension is the video filename extension. Will be calculated from URL if missing.
	Extension *string `json:"ext,omitempty"`

	// A human-readable description of the format ("mp4 container with h264/opus").
	// Calculated from the format_id, width, height. and format_note fields if missing.
	Format *string `json:"format,omitempty"`

	// FormatID is a short description of the format ("mp4_h264_opus" or "19").
	// Technically optional, but strongly recommended.
	FormatID *string `json:"format_id,omitempty"`

	// FormatNote is additional info about the format ("3D" or "DASH video").
	FormatNote *string `json:"format_note,omitempty"`

	// Width of the video, if known.
	Width *float64 `json:"width,omitempty"`

	// Height of the video, if known.
	Height *float64 `json:"height,omitempty"`

	// AspectRatio is the aspect ratio of the video, if known. Automatically calculated
	// from width and height (e.g. 1.78, which would be 16:9).
	AspectRatio *float64 `json:"aspect_ratio,omitempty"`

	// Resolution is the textual description of width and height. Automatically
	// calculated from width and height.
	Resolution *string `json:"resolution,omitempty"`

	// TBR is the average bitrate of audio and video in KBit/s.
	TBR *float64 `json:"tbr,omitempty"`

	// ABR is the average audio bitrate in KBit/s.
	ABR *float64 `json:"abr,omitempty"`

	// ACodev is the name of the audio codec in use.
	ACodec *string `json:"acodec,omitempty"`

	// ASR is the audio sampling rate in Hertz.
	ASR *float64 `json:"asr,omitempty"`

	// AudioChannels contains the number of audio channels.
	AudioChannels *float64 `json:"audio_channels,omitempty"`

	// Average video bitrate in KBit/s.
	VBR *float64 `json:"vbr,omitempty"`

	// FPS is the framerate per second.
	FPS *float64 `json:"fps,omitempty"`

	// VCodev is the name of the video codec in use.
	VCodec *string `json:"vcodec,omitempty"`

	// Container is the name of the container format.
	Container *string `json:"container,omitempty"`

	// FileSize is the number of bytes, if known in advance.
	FileSize *int `json:"filesize,omitempty"`

	// FileSizeApprox is an estimate for the number of bytes.
	FileSizeApprox *int `json:"filesize_approx,omitempty"`

	// PlayerURL is the SWF Player URL (used for rtmpdump).
	PlayerURL *string `json:"player_url,omitempty"`

	// Protocol is the protocol that will be used for the actual download,
	// lower-case. One of "http", "https" or one of the protocols defined in
	// yt-dlp's downloader.PROTOCOL_MAP.
	Protocol *string `json:"protocol,omitempty"`

	// FragmentBaseURL is the base URL for fragments. Each fragment's path value
	// (if present) will be relative to this URL.
	FragmentBaseURL *string `json:"fragment_base_url,omitempty"`

	// Fragments is a list of fragments of a fragmented media. Each fragment entry
	// must contain either an url or a path. If an url is present it should be
	// considered by a client. Otherwise both path and [ExtractedFormat.FragmentBaseURL]
	// must be present.
	Fragments []*ExtractedFragment `json:"fragments,omitempty"`

	// IsFromStart is true if it's a live format that can be downloaded from the start.
	IsFromStart *bool `json:"is_from_start,omitempty"`

	// Preference is the order number of this format. If this field is present,
	// the formats get sorted by this field, regardless of all other values.
	//   - -1 for default (order by other properties).
	//   - -2 or smaller for less than default.
	//   - < -1000 to hide the format (if there is another one which is strictly better)
	Preference *int `json:"preference,omitempty"`

	// SourcePreference is the order number for this video source (quality takes
	// higher priority)
	//   - -1 for default (order by other properties).
	//   - -2 or smaller for less than default.
	SourcePreference *int `json:"source_preference,omitempty"`

	// Language is the language code, e.g. "de" or "en-US".
	Language *string `json:"language,omitempty"`

	// LanguagePreference is the order number of this language, based off a few factors.
	// Is this in the language mentioned in the URL?
	//   - 10 if it's what the URL is about.
	//   - -1 for default (don't know).
	//   - -10 otherwise, other values reserved for now.
	LanguagePreference *int `json:"language_preference,omitempty"`

	// Quality is the order number of the video quality of this format, irrespective
	// of the file format.
	//   - -1 for default (order by other properties).
	//   - -2 or smaller for less than default.
	Quality *float64 `json:"quality,omitempty"`

	// HTTPHeaders are additional HTTP headers to be sent with the request.
	HTTPHeaders map[string]string `json:"http_headers,omitempty"`

	// StretchRatio if given and not 1, indicates that the video's pixels are not
	// square. "width:height" ratio as float.
	StretchedRatio *float64 `json:"stretched_ratio,omitempty"`

	// NoResume is true if the download for this format cannot be resumed (HTTP or RTMP).
	NoResume *bool `json:"no_resume,omitempty"`

	// HasDRM is true if the format is DRM-protected and cannot be downloaded.
	// 'maybe' if the format may have DRM and has to be tested before download.
	HasDRM any `json:"has_drm,omitempty"`

	// ExtraParamToSegmentURL is a query string to append to each fragment's URL,
	// or to update each existing query string with. Only applied by the native
	// HLS/DASH downloaders.
	ExtraParamToSegmentURL *string `json:"extra_param_to_segment_url,omitempty"`

	// Rows is the number of rows in each storyboard fragment, as an integer.
	Rows *int `json:"rows,omitempty"`

	// Columns is the number of columns in each storyboard fragment, as an integer.
	Columns *int `json:"columns,omitempty"`

	// PageURL is the URL of the page containing the video.
	PageURL *string `json:"page_url,omitempty"`

	// App is the application to play this stream.
	App *string `json:"app,omitempty"`

	// PlayPath is the play path for this stream.
	PlayPath *string `json:"play_path,omitempty"`

	// TCURL is the TC URL for this stream.
	TCURL *string `json:"tc_url,omitempty"`

	// FlashVersion is the flash version for this stream.
	FlashVersion *string `json:"flash_version,omitempty"`

	// RTMPLive is true if this is a live stream.
	RTMPLive *bool `json:"rtmp_live,omitempty"`

	// RTMPConn is the RTMP connection for this stream.
	RTMPConn *string `json:"rtmp_conn,omitempty"`

	// RTMPProtocol is the RTMP protocol for this stream.
	RTMPProtocol *string `json:"rtmp_protocol,omitempty"`

	// RTMPRealTime is true if this is a real-time stream.
	RTMPRealTime *bool `json:"rtmp_real_time,omitempty"`
}

ExtractedFormat is format information returned by yt-dlp.

Some intentionally excluded fields:

  • request_data (think this is internal).
  • manifest_stream_number (internal use only).
  • hls_aes (no sample data to use to understand format).
  • downloader_options (internal use only).

type ExtractedFragment

type ExtractedFragment struct {
	// URL of the fragment.
	URL string `json:"url"`

	// Path of the fragment, relative to [ExtractedFormat.FragmentBaseURL].
	Path *string `json:"path,omitempty"`

	// Duration of the fragment in seconds.
	Duration float64 `json:"duration"`

	// Filesize of the fragment in bytes.
	FileSize *int `json:"filesize,omitempty"`
}

type ExtractedHeatmapData

type ExtractedHeatmapData struct {
	// StartTime of the data point in seconds.
	StartTime *float64 `json:"start_time,omitempty"`

	// EndTime of the data point in seconds.
	EndTime *float64 `json:"end_time,omitempty"`

	// Value is the normalized value of the data point (float between 0 and 1).
	Value *float64 `json:"value,omitempty"`
}

type ExtractedInfo

type ExtractedInfo struct {
	// ExtractedFormat fields which can also be returned for ExtractedInfo.
	*ExtractedFormat

	// Type is the type of the video or returned result.
	Type ExtractedType `json:"_type"`

	// Version information is sometimes returned in the result.
	Version *ExtractedVersion `json:"_version,omitempty"`

	// ID is the video identifier.
	ID string `json:"id"`

	// Title contains the video title, unescaped. Set to an empty string if video
	// has no title as opposed to nil which signifies that the extractor failed
	// to obtain a title.
	Title *string `json:"title"`

	// Formats contains a list of each format available, ordered from worst to best
	// quality.
	Formats          []*ExtractedFormat `json:"formats"`
	RequestedFormats []*ExtractedFormat `json:"requested_formats,omitempty"`

	// URL is the final video URL.
	URL *string `json:"url,omitempty"`

	// Filename is the video filename. This is not set when simulation is requested/
	// enabled.
	Filename *string `json:"filename,omitempty"`

	// AltFilename is an alternative filename for the video. This maps to "_filename".
	// See [ExtractedInfo.Filename] for more info.
	AltFilename *string `json:"_filename,omitempty"`

	// Extension is the video filename extension.
	Extension string `json:"ext"`

	// Format is the video format. Defaults to [ExtractorInfo.Extension] (used for get-format functionality).
	Format string `json:"format"`

	// PlayerURL is the SWF Player URL (used for rtmpdump).
	PlayerURL *string `json:"player_url,omitempty"`

	// Direct is true if a direct video file was given (must only be set by GenericIE).
	Direct *bool `json:"direct,omitempty"`

	// AltTitle is a secondary title of the video.
	AltTitle *string `json:"alt_title,omitempty"`

	// DisplayID is an alternative identifier for the video, not necessarily unique,
	// but available before title. Typically, id is something like "4234987",
	// title "Dancing naked mole rats", and display_id "dancing-naked-mole-rats".
	DisplayID *string `json:"display_id,omitempty"`

	// Thumbnails is a list of thumbnails for the video.
	Thumbnails []*ExtractedThumbnail `json:"thumbnails,omitempty"`

	// Thumbnail is a full URL to a video thumbnail image.
	Thumbnail *string `json:"thumbnail,omitempty"`

	// Description contains the full video description.
	Description *string `json:"description,omitempty"`

	// Uploader contains the full name of the video uploader.
	Uploader *string `json:"uploader,omitempty"`

	// License contains the license name the video is licensed under.
	License *string `json:"license,omitempty"`

	// Creator contains the creator of the video.
	Creator *string `json:"creator,omitempty"`

	// Timestamp contains the UNIX timestamp of the moment the video was uploaded.
	Timestamp *float64 `json:"timestamp,omitempty"`

	// UploadDate contains the video upload date in UTC (YYYYMMDD). If not explicitly
	// set, calculated from Timestamp.
	UploadDate *string `json:"upload_date,omitempty"`

	// ReleaseTimestamp contains the UNIX timestamp of the moment the video was
	// released. If it is not clear whether to use Timestamp or this, use the former.
	ReleaseTimestamp *float64 `json:"release_timestamp,omitempty"`

	// ReleaseDate contains the date (YYYYMMDD) when the video was released in UTC.
	// If not explicitly set, calculated from ReleaseTimestamp.
	ReleaseDate *string `json:"release_date,omitempty"`

	// ModifiedTimestamp contains the UNIX timestamp of the moment the video was
	// last modified.
	ModifiedTimestamp *float64 `json:"modified_timestamp,omitempty"`

	// ModifiedDate contains the date (YYYYMMDD) when the video was last modified
	// in UTC. If not explicitly set, calculated from ModifiedTimestamp.
	ModifiedDate *string `json:"modified_date,omitempty"`

	// UploaderID contains the nickname or id of the video uploader.
	UploaderID *string `json:"uploader_id,omitempty"`

	// UploaderURL contains the full URL to a personal webpage of the video uploader.
	UploaderURL *string `json:"uploader_url,omitempty"`

	// Channel contains the full name of the channel the video is uploaded on.
	// Note that channel fields may or may not repeat uploader fields. This depends
	// on a particular extractor.
	Channel *string `json:"channel,omitempty"`

	// ChannelID contains the id of the channel.
	ChannelID *string `json:"channel_id,omitempty"`

	// ChannelURL contains the full URL to a channel webpage.
	ChannelURL *string `json:"channel_url,omitempty"`

	// ChannelFollowerCount contains the number of followers of the channel.
	ChannelFollowerCount *float64 `json:"channel_follower_count,omitempty"`

	// ChannelIsVerified is true if the channel is verified on the platform.
	ChannelIsVerified *bool `json:"channel_is_verified,omitempty"`

	// Location contains the physical location where the video was filmed.
	Location *string `json:"location,omitempty"`

	// Subtitles contains the available subtitles, where the key is the language
	// code, and the value is a list of subtitle formats.
	Subtitles          map[string][]*ExtractedSubtitle `json:"subtitles,omitempty"`
	RequestedSubtitles map[string][]*ExtractedSubtitle `json:"requested_subtitles,omitempty"`

	// AutomaticCaptions contains the automatically generated captions instead of
	// normal subtitles.
	AutomaticCaptions map[string][]*ExtractedSubtitle `json:"automatic_captions,omitempty"`

	// Duration contains the length of the video in seconds.
	Duration *float64 `json:"duration,omitempty"`

	// ViewCount contains how many users have watched the video on the platform.
	ViewCount *float64 `json:"view_count,omitempty"`

	// ConcurrentViewCount contains how many users are currently watching the video
	// on the platform.
	ConcurrentViewCount *float64 `json:"concurrent_view_count,omitempty"`

	// LikeCount contains the number of positive ratings of the video.
	LikeCount *float64 `json:"like_count,omitempty"`

	// DislikeCount contains the number of negative ratings of the video.
	DislikeCount *float64 `json:"dislike_count,omitempty"`

	// RepostCount contains the number of reposts of the video.
	RepostCount *float64 `json:"repost_count,omitempty"`

	// AverageRating contains the average rating give by users, the scale used
	// depends on the webpage.
	AverageRating *float64 `json:"average_rating,omitempty"`

	// CommentCount contains the number of comments on the video.
	CommentCount *float64 `json:"comment_count,omitempty"`

	// Comments contains a list of comments.
	Comments []*ExtractedVideoComment `json:"comments,omitempty"`

	// AgeLimit contains the age restriction for the video (years).
	AgeLimit *float64 `json:"age_limit,omitempty"`

	// WebpageURL contains the URL to the video webpage, if given to yt-dlp it
	// should allow to get the same result again. (It will be set by YoutubeDL if
	// it's missing)
	WebpageURL *string `json:"webpage_url,omitempty"`

	// Categories contains a list of categories that the video falls in, for example
	// ["Sports", "Berlin"].
	Categories []string `json:"categories,omitempty"`

	// Tags contains a list of tags assigned to the video, e.g. ["sweden", "pop music"].
	Tags []string `json:"tags,omitempty"`

	// Cast contains a list of the video cast.
	Cast []string `json:"cast,omitempty"`

	// IsLive is true, false, or nil (=unknown). Whether this video is a live stream
	// that goes on instead of a fixed-length video.
	IsLive *bool `json:"is_live,omitempty"`

	// WasLive is true, false, or nil (=unknown). Whether this video was originally
	// a live stream.
	WasLive *bool `json:"was_live,omitempty"`

	// LiveStatus is nil (=unknown), 'is_live', 'is_upcoming', 'was_live', 'not_live',
	// or 'post_live' (was live, but VOD is not yet processed). If absent, automatically
	// set from IsLive, WasLive.
	LiveStatus *ExtractedLiveStatus `json:"live_status,omitempty"`

	// StartTime is the time in seconds where the reproduction should start, as
	// specified in the URL.
	StartTime *float64 `json:"start_time,omitempty"`

	// EndTime is the time in seconds where the reproduction should end, as
	// specified in the URL.
	EndTime *float64 `json:"end_time,omitempty"`

	// Chapters is a list of chapters.
	Chapters []*ExtractedChapterData `json:"chapters,omitempty"`

	// Heatmap is a list of heatmap data points.
	Heatmap []*ExtractedHeatmapData `json:"heatmap,omitempty"`

	// PlayableInEmbed is whether this video is allowed to play in embedded players
	// on other sites. Can be true (=always allowed), false (=never allowed), nil
	// (=unknown), or a string specifying the criteria for embedability; e.g.
	// 'whitelist'.
	PlayableInEmbed any `json:"playable_in_embed,omitempty"`

	// Availability is under what condition the video is available.
	Availability *ExtractedAvailability `json:"availability,omitempty"`

	// Chapter is the name or title of the chapter the video belongs to.
	Chapter *string `json:"chapter,omitempty"`

	// ChapterNumber is the number of the chapter the video belongs to.
	ChapterNumber *float64 `json:"chapter_number,omitempty"`

	// ChapterID is the ID of the chapter the video belongs to.
	ChapterID *string `json:"chapter_id,omitempty"`

	// Playlist is the name or id of the playlist that contains the video.
	Playlist *string `json:"playlist,omitempty"`

	// PlaylistIndex is the index of the video in the playlist.
	PlaylistIndex *int `json:"playlist_index,omitempty"`

	// PlaylistID is the playlist identifier.
	PlaylistID *string `json:"playlist_id,omitempty"`

	// PlaylistTitle is the playlist title.
	PlaylistTitle *string `json:"playlist_title,omitempty"`

	// PlaylistUploader is the full name of the playlist uploader.
	PlaylistUploader *string `json:"playlist_uploader,omitempty"`

	// PlaylistUploaderID is the nickname or id of the playlist uploader.
	PlaylistUploaderID *string `json:"playlist_uploader_id,omitempty"`

	// PlaylistCount is auto-generated by yt-dlp. It is the total number of videos
	// in the playlist.
	PlaylistCount *int `json:"playlist_count,omitempty"`

	// Series is the title of the series or programme the video episode belongs to.
	Series *string `json:"series,omitempty"`

	// SeriesID is the ID of the series or programme the video episode belongs to.
	SeriesID *string `json:"series_id,omitempty"`

	// Season is the title of the season the video episode belongs to.
	Season *string `json:"season,omitempty"`

	// SeasonNumber is the number of the season the video episode belongs to.
	SeasonNumber *float64 `json:"season_number,omitempty"`

	// SeasonID is the ID of the season the video episode belongs to.
	SeasonID *string `json:"season_id,omitempty"`

	// Episode is the title of the video episode. Unlike mandatory video title field,
	// this field should denote the exact title of the video episode without any
	// kind of decoration.
	Episode *string `json:"episode,omitempty"`

	// EpisodeNumber is the number of the video episode within a season.
	EpisodeNumber *float64 `json:"episode_number,omitempty"`

	// EpisodeID is the ID of the video episode.
	EpisodeID *string `json:"episode_id,omitempty"`

	// Track is the title of the track.
	Track *string `json:"track,omitempty"`

	// TrackNumber is the number of the track within an album or a disc.
	TrackNumber *float64 `json:"track_number,omitempty"`

	// TrackID is the ID of the track (useful in case of custom indexing, e.g. 6.iii).
	TrackID *string `json:"track_id,omitempty"`

	// Artist is the artist(s) of the track.
	Artist *string `json:"artist,omitempty"`

	// Genre is the genre(s) of the track.
	Genre *string `json:"genre,omitempty"`

	// Album is the title of the album the track belongs to.
	Album *string `json:"album,omitempty"`

	// AlbumType is the type of the album (e.g. "Demo", "Full-length", "Split", "Compilation", etc).
	AlbumType *string `json:"album_type,omitempty"`

	// AlbumArtist is the list of all artists appeared on the album (e.g.
	// "Ash Borer / Fell Voices" or "Various Artists", useful for splits
	// and compilations).
	AlbumArtist *string `json:"album_artist,omitempty"`

	// DiscNumber is the number of the disc or other physical medium the track belongs to.
	DiscNumber *float64 `json:"disc_number,omitempty"`

	// ReleaseYear is the year (YYYY) when the album was released.
	ReleaseYear *int `json:"release_year,omitempty"`

	// Composer is the composer of the piece.
	Composer *string `json:"composer,omitempty"`

	// SectionStart is the start time of the section in seconds.
	SectionStart *float64 `json:"section_start,omitempty"`

	// SectionEnd is the end time of the section in seconds.
	SectionEnd *float64 `json:"section_end,omitempty"`

	// Rows is the number of rows in each storyboard fragment, as an integer.
	Rows *int `json:"rows,omitempty"`

	// Columns is the number of columns in each storyboard fragment, as an integer.
	Columns *int `json:"columns,omitempty"`

	// Extractor is the name of the extractor.
	Extractor *string `json:"extractor,omitempty"`

	// ExtractorKey is the key name of the extractor.
	ExtractorKey *string `json:"extractor_key,omitempty"`

	// WebpageURLBasename is the basename of [ExtractedInfo.WebpageURL].
	WebpageURLBasename *string `json:"webpage_url_basename,omitempty"`

	// WebpageURLDomain is the domain name of [ExtractedInfo.WebpageURL].
	WebpageURLDomain *string `json:"webpage_url_domain,omitempty"`

	// Autonumber is a five-digit number that will be increased with each download,
	// starting at zero.
	Autonumber float64 `json:"autonumber"`

	// Epoch is the unix epoch when creating the file.
	Epoch *float64 `json:"epoch,omitempty"`

	// Playlist entries if _type is playlist
	Entries []*ExtractedInfo `json:"entries"`
	// contains filtered or unexported fields
}

func ParseExtractedInfo

func ParseExtractedInfo(msg *json.RawMessage) (info *ExtractedInfo, err error)

ParseExtractedInfo parses the extracted info from msg. ParseExtractedInfo will also clean the returned results to remove some ytdlp-isims, such as "none" for some string fields.

type ExtractedLiveStatus

type ExtractedLiveStatus string
const (
	ExtractedLiveStatusIsLive     ExtractedLiveStatus = "is_live"
	ExtractedLiveStatusIsUpcoming ExtractedLiveStatus = "is_upcoming"
	ExtractedLiveStatusWasLive    ExtractedLiveStatus = "was_live"
	ExtractedLiveStatusNotLive    ExtractedLiveStatus = "not_live"
	ExtractedLiveStatusPostLive   ExtractedLiveStatus = "post_live" // Was live, but VOD is not yet processed.
)

type ExtractedSubtitle

type ExtractedSubtitle struct {
	// URL of the subtitle file.
	URL string `json:"url"`

	// Data contains the subtitle file contents.
	Data *string `json:"data,omitempty"`

	// Name or description of the subtitle.
	Name *string `json:"name,omitempty"`

	// HTTPHeaders are additional HTTP headers to be sent with the request.
	HTTPHeaders map[string]string `json:"http_headers,omitempty"`
}

type ExtractedThumbnail

type ExtractedThumbnail struct {
	// ID is the thumbnail format ID
	ID *string `json:"id,omitempty"`

	// URL of the thumbnail.
	URL string `json:"url"`

	// Preference is the quality ordering of the image.
	Preference *int `json:"preference,omitempty"`

	// Width of the thumbnail.
	Width *int `json:"width,omitempty"`

	// Height of the thumbnail.
	Height *int `json:"height,omitempty"`

	// Deprecated: Resolution is the textual description of width and height as "WIDTHxHEIGHT".
	Resolution *string `json:"resolution,omitempty"`

	// FileSize is the number of bytes, if known in advance.
	FileSize *int `json:"filesize,omitempty"`

	// HTTPHeaders are additional HTTP headers to be sent with the request.
	HTTPHeaders map[string]string `json:"http_headers,omitempty"`
}

type ExtractedType

type ExtractedType string
const (
	ExtractedTypeAny            ExtractedType = "any"
	ExtractedTypeSingle         ExtractedType = "single"
	ExtractedTypePlaylist       ExtractedType = "playlist"
	ExtractedTypeMultiVideo     ExtractedType = "multi_video"
	ExtractedTypeURL            ExtractedType = "url"
	ExtractedTypeURLTransparent ExtractedType = "url_transparent"
)

type ExtractedVersion

type ExtractedVersion struct {
	// CurrentGitHead is the git commit hash of the yt-dlp install that returned
	// this data.
	CurrentGitHead *string `json:"current_git_head,omitempty"`

	// ReleaseGitHead is the git commit hash of the currently available yt-dlp
	// release.
	ReleaseGitHead *string `json:"release_git_head,omitempty"`

	// Repository is the name of the repository where yt-dlp is hosted.
	Repository *string `json:"repository,omitempty"`

	// Version is the version number of the yt-dlp install that returned this data.
	Version *string `json:"version,omitempty"`
}

type ExtractedVideoComment

type ExtractedVideoComment struct {
	// Author is the human-readable name of the comment author.
	Author *string `json:"author,omitempty"`

	// AuthorID is the user ID of the comment author.
	AuthorID *string `json:"author_id,omitempty"`

	// AuthorThumbnail is the thumbnail of the comment author.
	AuthorThumbnail *string `json:"author_thumbnail,omitempty"`

	// AuthorURL is the URL to the comment author's page.
	AuthorURL *string `json:"author_url,omitempty"`

	// AuthorIsVerified is true if the author is verified on the platform.
	AuthorIsVerified *bool `json:"author_is_verified,omitempty"`

	// AuthorIsUploader is true if the comment is made by the video uploader.
	AuthorIsUploader *bool `json:"author_is_uploader,omitempty"`

	// ID is the comment ID.
	ID *string `json:"id,omitempty"`

	// HTML is the comment as HTML.
	HTML *string `json:"html,omitempty"`

	// Text is the plain text of the comment.
	Text *string `json:"text,omitempty"`

	// Timestamp is the UNIX timestamp of comment.
	Timestamp *float64 `json:"timestamp,omitempty"`

	// Parent is the ID of the comment this one is replying to. Set to "root" to
	// indicate that this is a comment to the original video.
	Parent *string `json:"parent,omitempty"`

	// LikeCount is the number of positive ratings of the comment.
	LikeCount *float64 `json:"like_count,omitempty"`

	// DislikeCount is the number of negative ratings of the comment.
	DislikeCount *float64 `json:"dislike_count,omitempty"`

	// IsFavorited is true if the comment is marked as favorite by the video uploader.
	IsFavorited *bool `json:"is_favorited,omitempty"`

	// IsPinned is true if the comment is pinned to the top of the comments.
	IsPinned *bool `json:"is_pinned,omitempty"`
}

type Extractor

type Extractor struct {
	// Name of the extractor.
	Name string `json:"name"`

	// Description of the extractor.
	Description string `json:"description,omitempty"`

	// AgeLimit of the extractor.
	AgeLimit int `json:"age_limit,omitempty"`
}

Extractor contains information about a specific yt-dlp extractor. Extractors are used to extract information from a specific URL, and subsequently download the video/audio.

type FixupOption

type FixupOption string

FixupOption are parameter types for [Fixup].

var (
	FixupNever        FixupOption = "never"
	FixupIgnore       FixupOption = "ignore"
	FixupWarn         FixupOption = "warn"
	FixupDetectOrWarn FixupOption = "detect_or_warn"
	FixupForce        FixupOption = "force"
)

type Flag

type Flag struct {
	ID             string `json:"id"`              // Unique ID to ensure boolean flags are not duplicated.
	Flag           string `json:"flag"`            // Actual flag, e.g. "--version".
	AllowsMultiple bool   `json:"allows_multiple"` // If the flag allows multiple values.
	Args           []any  `json:"args"`            // Optional args. If nil, it's a boolean flag.
}

func (*Flag) Raw

func (f *Flag) Raw() (args []string)

type FlagConfig

type FlagConfig struct {
	General             FlagsGeneral             `json:"general,omitempty,omitzero" jsonschema:"title=Group General"`
	Network             FlagsNetwork             `json:"network,omitempty,omitzero" jsonschema:"title=Group Network"`
	GeoRestriction      FlagsGeoRestriction      `json:"geo_restriction,omitempty,omitzero" jsonschema:"title=Group GeoRestriction"`
	VideoSelection      FlagsVideoSelection      `json:"video_selection,omitempty,omitzero" jsonschema:"title=Group VideoSelection"`
	Download            FlagsDownload            `json:"download,omitempty,omitzero" jsonschema:"title=Group Download"`
	Filesystem          FlagsFilesystem          `json:"filesystem,omitempty,omitzero" jsonschema:"title=Group Filesystem"`
	Thumbnail           FlagsThumbnail           `json:"thumbnail,omitempty,omitzero" jsonschema:"title=Group Thumbnail"`
	InternetShortcut    FlagsInternetShortcut    `json:"internet_shortcut,omitempty,omitzero" jsonschema:"title=Group InternetShortcut"`
	VerbositySimulation FlagsVerbositySimulation `json:"verbosity_simulation,omitempty,omitzero" jsonschema:"title=Group VerbositySimulation"`
	Workarounds         FlagsWorkarounds         `json:"workarounds,omitempty,omitzero" jsonschema:"title=Group Workarounds"`
	VideoFormat         FlagsVideoFormat         `json:"video_format,omitempty,omitzero" jsonschema:"title=Group VideoFormat"`
	Subtitle            FlagsSubtitle            `json:"subtitle,omitempty,omitzero" jsonschema:"title=Group Subtitle"`
	Authentication      FlagsAuthentication      `json:"authentication,omitempty,omitzero" jsonschema:"title=Group Authentication"`
	PostProcessing      FlagsPostProcessing      `json:"post_processing,omitempty,omitzero" jsonschema:"title=Group PostProcessing"`
	SponsorBlock        FlagsSponsorBlock        `json:"sponsor_block,omitempty,omitzero" jsonschema:"title=Group SponsorBlock"`
	Extractor           FlagsExtractor           `json:"extractor,omitempty,omitzero" jsonschema:"title=Group Extractor"`
}

FlagConfig holds all information for the flags in which to use for yt-dlp. Note that you can technically set multiple conflicting flags through this type, however, when the FlagConfig.Validate method is called, it will return a ErrMultipleJSONParsingFlags error if there are any conflicts.

func (*FlagConfig) Clone

func (f *FlagConfig) Clone() *FlagConfig

Clone returns a copy of the flag config.

func (*FlagConfig) ToFlags

func (f *FlagConfig) ToFlags() (flags Flags)

func (*FlagConfig) Validate

func (f *FlagConfig) Validate() error

Validate runs validation across all flag groups. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error. Otherwise, any other errors will be returned as a regular wrapped errors.

type FlagPrintToFile

type FlagPrintToFile struct {
	Template string `` /* 308-byte string literal not displayed */
	File     string `` /* 304-byte string literal not displayed */
}

type FlagReplaceInMetadata

type FlagReplaceInMetadata struct {
	Fields  string `` /* 316-byte string literal not displayed */
	Regex   string `` /* 315-byte string literal not displayed */
	Replace string `` /* 317-byte string literal not displayed */
}

type Flags

type Flags []*Flag

func (Flags) Duplicates

func (f Flags) Duplicates() (duplicates Flags)

func (Flags) FindByID

func (f Flags) FindByID(id string) (flags Flags)

type FlagsAuthentication

type FlagsAuthentication struct {
	// Login with this account ID
	Username *string `` /* 152-byte string literal not displayed */
	// Account password. If this option is left out, yt-dlp will ask interactively
	Password *string `` /* 201-byte string literal not displayed */
	// Two-factor authentication code
	TwoFactor *string `` /* 160-byte string literal not displayed */
	// Use .netrc authentication data
	Netrc *bool `` /* 150-byte string literal not displayed */
	// Location of .netrc authentication data; either the path or its containing directory.
	// Defaults to ~/.netrc
	NetrcLocation *string `` /* 254-byte string literal not displayed */
	// Command to execute to get the credentials for an extractor.
	NetrcCmd *string `` /* 188-byte string literal not displayed */
	// Video-specific password
	VideoPassword *string `` /* 170-byte string literal not displayed */
	// Adobe Pass multiple-system operator (TV provider) identifier, use --ap-list-mso for a list
	// of available MSOs
	ApMSO *string `` /* 225-byte string literal not displayed */
	// Multiple-system operator account login
	ApUsername *string `` /* 175-byte string literal not displayed */
	// Multiple-system operator account password. If this option is left out, yt-dlp will ask
	// interactively
	ApPassword *string `` /* 237-byte string literal not displayed */
	// List all supported multiple-system operators
	ApListMSO *bool `` /* 180-byte string literal not displayed */
	// Path to client certificate file in PEM format. May include the private key
	ClientCertificate *string `` /* 239-byte string literal not displayed */
	// Path to private key file for client certificate
	ClientCertificateKey *string `` /* 227-byte string literal not displayed */
	// Password for client certificate private key, if encrypted. If not provided, and the key is
	// encrypted, yt-dlp will ask interactively
	ClientCertificatePassword *string `` /* 331-byte string literal not displayed */
}

func (*FlagsAuthentication) ToFlags

func (g *FlagsAuthentication) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsAuthentication.Validate should be called first.

func (*FlagsAuthentication) Validate

func (g *FlagsAuthentication) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsDownload

type FlagsDownload struct {
	// Number of fragments of a dash/hlsnative video that should be downloaded concurrently
	// (default is 1)
	ConcurrentFragments *int `` /* 290-byte string literal not displayed */
	// Maximum download rate in bytes per second, e.g. 50K or 4.2M
	LimitRate *string `` /* 190-byte string literal not displayed */
	// Minimum download rate in bytes per second below which throttling is assumed and the video
	// data is re-extracted, e.g. 100K
	ThrottledRate *string `` /* 278-byte string literal not displayed */
	// Number of retries (default is 10), or "infinite"
	Retries *string `` /* 172-byte string literal not displayed */
	// Number of times to retry on file access error (default is 3), or "infinite"
	FileAccessRetries *string `` /* 245-byte string literal not displayed */
	// Number of retries for a fragment (default is 10), or "infinite" (DASH, hlsnative and ISM)
	FragmentRetries *string `` /* 248-byte string literal not displayed */
	// Time to sleep between retries in seconds (optionally) prefixed by the type of retry (http
	// (default), fragment, file_access, extractor) to apply the sleep to. EXPR can be a number,
	// linear=START[:END[:STEP=1]] or exp=START[:END[:BASE=2]]. This option can be used multiple
	// times to set the sleep for the different retry types, e.g. --retry-sleep linear=1::2
	// --retry-sleep fragment:exp=1:20
	RetrySleep []string `` /* 523-byte string literal not displayed */
	// Skip unavailable fragments for DASH, hlsnative and ISM downloads (default)
	SkipUnavailableFragments *bool `` /* 270-byte string literal not displayed */
	// Abort download if a fragment is unavailable
	AbortOnUnavailableFragments *bool `` /* 246-byte string literal not displayed */
	// Keep downloaded fragments on disk after downloading is finished
	KeepFragments *bool `` /* 212-byte string literal not displayed */
	// Delete downloaded fragments after downloading is finished (default)
	NoKeepFragments *bool `` /* 221-byte string literal not displayed */
	// Size of download buffer, e.g. 1024 or 16K (default is 1024)
	BufferSize *string `` /* 194-byte string literal not displayed */
	// The buffer size is automatically resized from an initial value of --buffer-size (default)
	ResizeBuffer *bool `` /* 236-byte string literal not displayed */
	// Do not automatically adjust the buffer size
	NoResizeBuffer *bool `` /* 195-byte string literal not displayed */
	// Size of a chunk for chunk-based HTTP downloading, e.g. 10485760 or 10M (default is
	// disabled). May be useful for bypassing bandwidth throttling imposed by a webserver
	// (experimental)
	HTTPChunkSize     *string `` /* 332-byte string literal not displayed */
	PlaylistReverse   *bool   `` /* 157-byte string literal not displayed */
	NoPlaylistReverse *bool   `` /* 162-byte string literal not displayed */
	// Download playlist videos in random order
	PlaylistRandom *bool `` /* 193-byte string literal not displayed */
	// Process entries in the playlist as they are received. This disables n_entries,
	// --playlist-random and --playlist-reverse
	LazyPlaylist *bool `` /* 264-byte string literal not displayed */
	// Process videos in the playlist only after the entire playlist is parsed (default)
	NoLazyPlaylist  *bool `` /* 231-byte string literal not displayed */
	HLSPreferNative *bool `` /* 160-byte string literal not displayed */
	HLSPreferFFmpeg *bool `` /* 160-byte string literal not displayed */
	// Use the mpegts container for HLS videos; allowing some players to play the video while
	// downloading, and reducing the chance of file corruption if download is interrupted. This
	// is enabled by default for live streams
	HLSUseMPEGTS *bool `` /* 362-byte string literal not displayed */
	// Do not use the mpegts container for HLS videos. This is default when not downloading live
	// streams
	NoHLSUseMPEGTS *bool `` /* 250-byte string literal not displayed */
	// Download only chapters that match the regular expression. A "*" prefix denotes time-range
	// instead of chapter. Negative timestamps are calculated from the end. "*from-url" can be
	// used to download between the "start_time" and "end_time" extracted from the URL. Needs
	// ffmpeg. This option can be used multiple times to download multiple sections, e.g.
	// --download-sections "*10:15-inf" --download-sections "intro"
	DownloadSections []string `` /* 577-byte string literal not displayed */
	// Name or path of the external downloader to use (optionally) prefixed by the protocols
	// (http, ftp, m3u8, dash, rstp, rtmp, mms) to use it for. Currently supports native, aria2c,
	// axel, curl, ffmpeg, httpie, wget. You can use this option multiple times to set different
	// downloaders for different protocols. E.g. --downloader aria2c --downloader
	// "dash,m3u8:native" will use aria2c for http/ftp downloads, and the native downloader for
	// dash/m3u8 downloads
	Downloader []string `` /* 604-byte string literal not displayed */
	// Give these arguments to the external downloader. Specify the downloader name and the
	// arguments separated by a colon ":". For ffmpeg, arguments can be passed to different
	// positions using the same syntax as --postprocessor-args. You can use this option multiple
	// times to give different arguments to different downloaders
	DownloaderArgs []string `` /* 491-byte string literal not displayed */
}

func (*FlagsDownload) ToFlags

func (g *FlagsDownload) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsDownload.Validate should be called first.

func (*FlagsDownload) Validate

func (g *FlagsDownload) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsExtractor

type FlagsExtractor struct {
	// Number of retries for known extractor errors (default is 3), or "infinite"
	ExtractorRetries *string `` /* 237-byte string literal not displayed */
	// Process dynamic DASH manifests (default)
	AllowDynamicMPD *bool `` /* 188-byte string literal not displayed */
	// Do not process dynamic DASH manifests
	IgnoreDynamicMPD *bool `` /* 187-byte string literal not displayed */
	// Split HLS playlists to different formats at discontinuities such as ad breaks
	HLSSplitDiscontinuity *bool `` /* 261-byte string literal not displayed */
	// Do not split HLS playlists into different formats at discontinuities such as ad breaks
	// (default)
	NoHLSSplitDiscontinuity *bool `` /* 285-byte string literal not displayed */
	// Pass ARGS arguments to the IE_KEY extractor. See "EXTRACTOR ARGUMENTS" for details. You
	// can use this option multiple times to give arguments for different extractors
	ExtractorArgs []string `` /* 316-byte string literal not displayed */
}

func (*FlagsExtractor) ToFlags

func (g *FlagsExtractor) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsExtractor.Validate should be called first.

func (*FlagsExtractor) Validate

func (g *FlagsExtractor) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsFilesystem

type FlagsFilesystem struct {
	// File containing URLs to download ("-" for stdin), one URL per line. Lines starting with
	// "#", ";" or "]" are considered as comments and ignored
	BatchFile *string `` /* 281-byte string literal not displayed */
	// Do not read URLs from batch file (default)
	NoBatchFile *bool `` /* 178-byte string literal not displayed */
	ID          *bool `json:"id,omitempty" id:"useid" jsonschema:"title=ID" jsonschema_extras:"uid=useid" jsonschema_description:""`
	// The paths where the files should be downloaded. Specify the type of file and the path
	// separated by a colon ":". All the same TYPES as --output are supported. Additionally, you
	// can also provide "home" (default) and "temp" paths. All intermediary files are first
	// downloaded to the temp path and then the final files are moved over to the home path after
	// download is finished. This option is ignored if --output is an absolute path
	Paths *string `` /* 548-byte string literal not displayed */
	// Output filename template; see "OUTPUT TEMPLATE" for details
	Output *string `` /* 181-byte string literal not displayed */
	// Placeholder for unavailable fields in --output (default: "NA")
	OutputNaPlaceholder *string `` /* 242-byte string literal not displayed */
	AutoNumberSize      *int    `` /* 153-byte string literal not displayed */
	AutoNumberStart     *int    `` /* 157-byte string literal not displayed */
	// Restrict filenames to only ASCII characters, and avoid "&" and spaces in filenames
	RestrictFilenames *bool `` /* 247-byte string literal not displayed */
	// Allow Unicode characters, "&" and spaces in filenames (default)
	NoRestrictFilenames *bool `` /* 233-byte string literal not displayed */
	// Force filenames to be Windows-compatible
	WindowsFilenames *bool `` /* 199-byte string literal not displayed */
	// Sanitize filenames only minimally
	NoWindowsFilenames *bool `` /* 197-byte string literal not displayed */
	// Limit the filename length (excluding extension) to the specified number of characters
	TrimFilenames *int `` /* 234-byte string literal not displayed */
	// Do not overwrite any files
	NoOverwrites *bool `` /* 165-byte string literal not displayed */
	// Overwrite all video and metadata files. This option includes --no-continue
	ForceOverwrites *bool `` /* 219-byte string literal not displayed */
	// Do not overwrite the video, but overwrite related files (default)
	NoForceOverwrites *bool `` /* 215-byte string literal not displayed */
	// Resume partially downloaded files/fragments (default)
	Continue *bool `` /* 185-byte string literal not displayed */
	// Do not resume partially downloaded fragments. If the file is not fragmented, restart
	// download of the entire file
	NoContinue *bool `` /* 249-byte string literal not displayed */
	// Use .part files instead of writing directly into output file (default)
	Part *bool `` /* 184-byte string literal not displayed */
	// Do not use .part files - write directly into output file
	NoPart *bool `` /* 175-byte string literal not displayed */
	// Use the Last-modified header to set the file modification time
	Mtime *bool `` /* 186-byte string literal not displayed */
	// Do not use the Last-modified header to set the file modification time (default)
	NoMtime *bool `` /* 208-byte string literal not displayed */
	// Write video description to a .description file
	WriteDescription *bool `` /* 205-byte string literal not displayed */
	// Do not write video description (default)
	NoWriteDescription *bool `` /* 204-byte string literal not displayed */
	// Write video metadata to a .info.json file (this may contain personal information)
	WriteInfoJSON *bool `` /* 229-byte string literal not displayed */
	// Do not write video metadata (default)
	NoWriteInfoJSON *bool `` /* 190-byte string literal not displayed */
	// Write playlist metadata in addition to the video metadata when using --write-info-json,
	// --write-description etc. (default)
	WritePlaylistMetafiles *bool `` /* 302-byte string literal not displayed */
	// Do not write playlist metadata when using --write-info-json, --write-description etc.
	NoWritePlaylistMetafiles *bool `` /* 270-byte string literal not displayed */
	// Remove some internal metadata such as filenames from the infojson (default)
	CleanInfoJSON *bool `` /* 225-byte string literal not displayed */
	// Write all fields to the infojson
	NoCleanInfoJSON *bool `` /* 187-byte string literal not displayed */
	// Retrieve video comments to be placed in the infojson. The comments are fetched even
	// without this option if the extraction is known to be quick
	WriteComments *bool `` /* 285-byte string literal not displayed */
	// Do not retrieve video comments unless the extraction is known to be quick
	NoWriteComments *bool `` /* 221-byte string literal not displayed */
	// JSON file containing the video information (created with the "--write-info-json" option)
	LoadInfoJSON *string `` /* 246-byte string literal not displayed */
	// Netscape formatted file to read cookies from and dump cookie jar in
	Cookies *string `` /* 195-byte string literal not displayed */
	// Do not read/dump cookies from/to file (default)
	NoCookies *bool `` /* 180-byte string literal not displayed */
	// The name of the browser to load cookies from. Currently supported browsers are: brave,
	// chrome, chromium, edge, firefox, opera, safari, vivaldi, whale. Optionally, the KEYRING
	// used for decrypting Chromium cookies on Linux, the name/path of the PROFILE to load
	// cookies from, and the CONTAINER name (if Firefox) ("none" for no container) can be given
	// with their respective separators. By default, all containers of the most recently accessed
	// profile are used. Currently supported keyrings are: basictext, gnomekeyring, kwallet,
	// kwallet5, kwallet6
	CookiesFromBrowser *string `` /* 713-byte string literal not displayed */
	// Do not load cookies from browser (default)
	NoCookiesFromBrowser *bool `` /* 215-byte string literal not displayed */
	// Location in the filesystem where yt-dlp can store some downloaded information (such as
	// client ids and signatures) permanently. By default ${XDG_CACHE_HOME}/yt-dlp
	CacheDir *string `` /* 289-byte string literal not displayed */
	// Disable filesystem caching
	NoCacheDir *bool `` /* 158-byte string literal not displayed */
	// Delete all filesystem cache files
	RmCacheDir *bool `` /* 171-byte string literal not displayed */
}

func (*FlagsFilesystem) ToFlags

func (g *FlagsFilesystem) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsFilesystem.Validate should be called first.

func (*FlagsFilesystem) Validate

func (g *FlagsFilesystem) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsGeneral

type FlagsGeneral struct {
	// Do not check for updates (default)
	NoUpdate *bool `` /* 167-byte string literal not displayed */
	// Ignore download and postprocessing errors. The download will be considered successful even
	// if the postprocessing fails
	IgnoreErrors *bool `` /* 261-byte string literal not displayed */
	// Continue with next video on download errors; e.g. to skip unavailable videos in a playlist
	// (default)
	NoAbortOnError *bool `` /* 249-byte string literal not displayed */
	// Abort downloading of further videos if an error occurs
	AbortOnError *bool `` /* 198-byte string literal not displayed */
	// Extractor names to use separated by commas. You can also use regexes, "all", "default" and
	// "end" (end URL matching); e.g. --ies "holodex.*,end,youtube". Prefix the name with a "-"
	// to exclude it, e.g. --ies default,-generic. Use --list-extractors for a list of extractor
	// names.
	UseExtractors         *string `` /* 443-byte string literal not displayed */
	ForceGenericExtractor *bool   `` /* 184-byte string literal not displayed */
	// Use this prefix for unqualified URLs. E.g. "gvsearch2:python" downloads two videos from
	// google videos for the search term "python". Use the value "auto" to let yt-dlp guess
	// ("auto_warning" to emit a warning when guessing). "error" just throws an error. The
	// default value "fixup_error" repairs broken URLs, but emits an error if this is not
	// possible instead of searching
	DefaultSearch *string `` /* 530-byte string literal not displayed */
	// Don't load any more configuration files except those given to --config-locations. For
	// backward compatibility, if this option is found inside the system configuration file, the
	// user configuration is not loaded.
	IgnoreConfig *bool `` /* 352-byte string literal not displayed */
	// Do not load any custom configuration files (default). When given inside a configuration
	// file, ignore all previous --config-locations defined in the current file
	NoConfigLocations *bool `` /* 322-byte string literal not displayed */
	// Location of the main configuration file; either the path to the config or its containing
	// directory ("-" for stdin). Can be used multiple times and inside other configuration files
	ConfigLocations []string `` /* 338-byte string literal not displayed */
	// Path to an additional directory to search for plugins. This option can be used multiple
	// times to add multiple directories. Use "default" to search the default plugin directories
	// (default)
	PluginDirs []string `` /* 326-byte string literal not displayed */
	// Clear plugin directories to search, including defaults and those provided by previous
	// --plugin-dirs
	NoPluginDirs *bool `` /* 241-byte string literal not displayed */
	// Additional JavaScript runtime to enable, with an optional location for the runtime (either
	// the path to the binary or its containing directory). This option can be used multiple
	// times to enable multiple runtimes. Supported runtimes are (in order of priority, from
	// highest to lowest): deno, node, quickjs, bun. Only "deno" is enabled by default. The
	// highest priority runtime that is both enabled and available will be used. In order to use
	// a lower priority runtime when "deno" is available, --no-js-runtimes needs to be passed
	// before enabling other runtimes
	JsRuntimes []string `` /* 696-byte string literal not displayed */
	// Clear JavaScript runtimes to enable, including defaults and those provided by previous
	// --js-runtimes
	NoJsRuntimes *bool `` /* 242-byte string literal not displayed */
	// Remote components to allow yt-dlp to fetch when required. This option is currently not
	// needed if you are using an official executable or have the requisite version of the
	// yt-dlp-ejs package installed. You can use this option multiple times to allow multiple
	// components. Supported values: ejs:npm (external JavaScript components from npm),
	// ejs:github (external JavaScript components from yt-dlp-ejs GitHub). By default, no remote
	// components are allowed
	RemoteComponents []string `` /* 612-byte string literal not displayed */
	// Disallow fetching of all remote components, including any previously allowed by
	// --remote-components or defaults.
	NoRemoteComponents *bool `` /* 278-byte string literal not displayed */
	// Do not extract a playlist's URL result entries; some entry metadata may be missing and
	// downloading may be bypassed
	FlatPlaylist *bool `` /* 257-byte string literal not displayed */
	// Fully extract the videos of a playlist (default)
	NoFlatPlaylist *bool `` /* 196-byte string literal not displayed */
	// Download livestreams from the start. Currently experimental and only supported for YouTube
	// and Twitch
	LiveFromStart *bool `` /* 253-byte string literal not displayed */
	// Download livestreams from the current time (default)
	NoLiveFromStart *bool `` /* 209-byte string literal not displayed */
	// Wait for scheduled streams to become available. Pass the minimum number of seconds (or
	// range) to wait between retries
	WaitForVideo *string `` /* 265-byte string literal not displayed */
	// Do not wait for scheduled streams (default)
	NoWaitForVideo *bool `` /* 196-byte string literal not displayed */
	// Mark videos watched (even with --simulate)
	MarkWatched *bool `` /* 183-byte string literal not displayed */
	// Do not mark videos watched (default)
	NoMarkWatched *bool `` /* 182-byte string literal not displayed */
	NoColors      *bool `json:"no_colors,omitempty" id:"color" jsonschema:"title=NoColors" jsonschema_extras:"uid=color" jsonschema_description:""`
	// Whether to emit color codes in output, optionally prefixed by the STREAM (stdout or
	// stderr) to apply the setting to. Can be one of "always", "auto" (default), "never", or
	// "no_color" (use non color terminal sequences). Use "auto-tty" or "no_color-tty" to decide
	// based on terminal support only. Can be used multiple times
	Color []string `` /* 445-byte string literal not displayed */
	// Options that can help keep compatibility with youtube-dl or youtube-dlc configurations by
	// reverting some of the changes made in yt-dlp. See "Differences in default behavior" for
	// details
	CompatOptions *string `` /* 330-byte string literal not displayed */
	// Applies a predefined set of options. e.g. --preset-alias mp3. The following presets are
	// available: mp3, aac, mp4, mkv, sleep. See the "Preset Aliases" section at the end for more
	// info. This option can be used multiple times
	PresetAlias []string `` /* 366-byte string literal not displayed */
}

func (*FlagsGeneral) ToFlags

func (g *FlagsGeneral) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsGeneral.Validate should be called first.

func (*FlagsGeneral) Validate

func (g *FlagsGeneral) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsGeoRestriction

type FlagsGeoRestriction struct {
	// Use this proxy to verify the IP address for some geo-restricted sites. The default proxy
	// specified by --proxy (or none, if the option is not present) is used for the actual
	// downloading
	GeoVerificationProxy *string `` /* 364-byte string literal not displayed */
	// How to fake X-Forwarded-For HTTP header to try bypassing geographic restriction. One of
	// "default" (only when known to be useful), "never", an IP block in CIDR notation, or a
	// two-letter ISO 3166-2 country code
	XFF              *string `` /* 332-byte string literal not displayed */
	GeoBypass        *bool   `` /* 133-byte string literal not displayed */
	NoGeoBypass      *bool   `` /* 138-byte string literal not displayed */
	GeoBypassCountry *string `` /* 148-byte string literal not displayed */
	GeoBypassIPBlock *string `` /* 149-byte string literal not displayed */
}

func (*FlagsGeoRestriction) ToFlags

func (g *FlagsGeoRestriction) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsGeoRestriction.Validate should be called first.

func (*FlagsGeoRestriction) Validate

func (g *FlagsGeoRestriction) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsInternetShortcut

type FlagsInternetShortcut struct {
	// Write an internet shortcut file, depending on the current platform (.url, .webloc or
	// .desktop). The URL may be cached by the OS
	WriteLink *bool `` /* 258-byte string literal not displayed */
	// Write a .url Windows internet shortcut. The OS caches the URL based on the file path
	WriteURLLink *bool `` /* 228-byte string literal not displayed */
	// Write a .webloc macOS internet shortcut
	WriteWeblocLink *bool `` /* 195-byte string literal not displayed */
	// Write a .desktop Linux internet shortcut
	WriteDesktopLink *bool `` /* 200-byte string literal not displayed */
}

func (*FlagsInternetShortcut) ToFlags

func (g *FlagsInternetShortcut) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsInternetShortcut.Validate should be called first.

func (*FlagsInternetShortcut) Validate

func (g *FlagsInternetShortcut) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsNetwork

type FlagsNetwork struct {
	// Use the specified HTTP/HTTPS/SOCKS proxy. To enable SOCKS proxy, specify a proper scheme,
	// e.g. socks5://user:pass@127.0.0.1:1080/. Pass in an empty string (--proxy "") for direct
	// connection
	Proxy *string `` /* 305-byte string literal not displayed */
	// Time to wait before giving up, in seconds
	SocketTimeout *float64 `` /* 190-byte string literal not displayed */
	// Client-side IP address to bind to
	SourceAddress *string `` /* 182-byte string literal not displayed */
	// Client to impersonate for requests. E.g. chrome, chrome-110, chrome:windows-10. Pass
	// --impersonate="" to impersonate any client. Note that forcing impersonation for all
	// requests may have a detrimental impact on download speed and stability
	Impersonate *string `` /* 379-byte string literal not displayed */
	// List available clients to impersonate.
	ListImpersonateTargets *bool `` /* 226-byte string literal not displayed */
	// Make all connections via IPv4
	ForceIPv4 *bool `` /* 171-byte string literal not displayed */
	// Make all connections via IPv6
	ForceIPv6 *bool `` /* 171-byte string literal not displayed */
	// Enable file:// URLs. This is disabled by default for security reasons.
	EnableFileURLs *bool `` /* 226-byte string literal not displayed */
}

func (*FlagsNetwork) ToFlags

func (g *FlagsNetwork) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsNetwork.Validate should be called first.

func (*FlagsNetwork) Validate

func (g *FlagsNetwork) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsPostProcessing

type FlagsPostProcessing struct {
	// Convert video files to audio-only files (requires ffmpeg and ffprobe)
	ExtractAudio *bool `` /* 212-byte string literal not displayed */
	// Format to convert the audio to when -x is used. (currently supported: best (default), aac,
	// alac, flac, m4a, mp3, opus, vorbis, wav). You can specify multiple rules using similar
	// syntax as --remux-video
	AudioFormat *string `` /* 340-byte string literal not displayed */
	// Specify ffmpeg audio quality to use when converting the audio with -x. Insert a value
	// between 0 (best) and 10 (worst) for VBR or a specific bitrate like 128K (default 5)
	AudioQuality *string `` /* 312-byte string literal not displayed */
	// Remux the video into another container if necessary (currently supported: avi, flv, gif,
	// mkv, mov, mp4, webm, aac, aiff, alac, flac, m4a, mka, mp3, ogg, opus, vorbis, wav). If the
	// target container does not support the video/audio codec, remuxing will fail. You can
	// specify multiple rules; e.g. "aac>m4a/mov>mp4/mkv" will remux aac to m4a, mov to mp4 and
	// anything else to mkv
	RemuxVideo *string `` /* 511-byte string literal not displayed */
	// Re-encode the video into another format if necessary. The syntax and supported formats are
	// the same as --remux-video
	RecodeVideo *string `` /* 255-byte string literal not displayed */
	// Give these arguments to the postprocessors. Specify the postprocessor/executable name and
	// the arguments separated by a colon ":" to give the argument to the specified
	// postprocessor/executable. Supported PP are: Merger, ModifyChapters, SplitChapters,
	// ExtractAudio, VideoRemuxer, VideoConvertor, Metadata, EmbedSubtitle, EmbedThumbnail,
	// SubtitlesConvertor, ThumbnailsConvertor, FixupStretched, FixupM4a, FixupM3u8,
	// FixupTimestamp and FixupDuration. The supported executables are: AtomicParsley, FFmpeg and
	// FFprobe. You can also specify "PP+EXE:ARGS" to give the arguments to the specified
	// executable only when being used by the specified postprocessor. Additionally, for
	// ffmpeg/ffprobe, "_i"/"_o" can be appended to the prefix optionally followed by a number to
	// pass the argument before the specified input/output file, e.g. --ppa "Merger+ffmpeg_i1:-v
	// quiet". You can use this option multiple times to give different arguments to different
	// postprocessors.
	PostProcessorArgs []string `` /* 1128-byte string literal not displayed */
	// Keep the intermediate video file on disk after post-processing
	KeepVideo *bool `` /* 193-byte string literal not displayed */
	// Delete the intermediate video file after post-processing (default)
	NoKeepVideo *bool `` /* 202-byte string literal not displayed */
	// Overwrite post-processed files (default)
	PostOverwrites *bool `` /* 195-byte string literal not displayed */
	// Do not overwrite post-processed files
	NoPostOverwrites *bool `` /* 197-byte string literal not displayed */
	// Embed subtitles in the video (only for mp4, webm and mkv videos)
	EmbedSubs *bool `` /* 205-byte string literal not displayed */
	// Do not embed subtitles (default)
	NoEmbedSubs *bool `` /* 178-byte string literal not displayed */
	// Embed thumbnail in the video as cover art
	EmbedThumbnail *bool `` /* 192-byte string literal not displayed */
	// Do not embed thumbnail (default)
	NoEmbedThumbnail *bool `` /* 188-byte string literal not displayed */
	// Embed metadata to the video file. Also embeds chapters/infojson if present unless
	// --no-embed-chapters/--no-embed-info-json are used
	EmbedMetadata *bool `` /* 274-byte string literal not displayed */
	// Do not add metadata to file (default)
	NoEmbedMetadata *bool `` /* 185-byte string literal not displayed */
	// Add chapter markers to the video file
	EmbedChapters *bool `` /* 180-byte string literal not displayed */
	// Do not add chapter markers (default)
	NoEmbedChapters *bool `` /* 184-byte string literal not displayed */
	// Embed the infojson as an attachment to mkv/mka video files
	EmbedInfoJSON *bool `` /* 208-byte string literal not displayed */
	// Do not embed the infojson as an attachment to the video file
	NoEmbedInfoJSON   *bool   `` /* 215-byte string literal not displayed */
	MetadataFromTitle *string `` /* 156-byte string literal not displayed */
	// Parse additional metadata like title/artist from other fields; see "MODIFYING METADATA"
	// for details. Supported values of "WHEN" are the same as that of --use-postprocessor
	// (default: pre_process)
	ParseMetadata *string `` /* 347-byte string literal not displayed */
	// Replace text in a metadata field using the given regex. This option can be used multiple
	// times. Supported values of "WHEN" are the same as that of --use-postprocessor (default:
	// pre_process)
	ReplaceInMetadata []*FlagReplaceInMetadata `` /* 349-byte string literal not displayed */
	// Write metadata to the video file's xattrs (using Dublin Core and XDG standards)
	Xattrs *bool `` /* 197-byte string literal not displayed */
	// Concatenate videos in a playlist. One of "never", "always", or "multi_video" (default;
	// only when the videos form a single show). All the video files must have the same codecs
	// and number of streams to be concatenable. The "pl_video:" prefix can be used with
	// "--paths" and "--output" to set the output filename for the concatenated files. See
	// "OUTPUT TEMPLATE" for details
	ConcatPlaylist *ConcatPlaylistOption `` /* 577-byte string literal not displayed */
	// Automatically correct known faults of the file. One of never (do nothing), warn (only emit
	// a warning), detect_or_warn (the default; fix the file if we can, warn otherwise), force
	// (try fixing even if the file already exists)
	Fixup *FixupOption `` /* 401-byte string literal not displayed */
	// Location of the ffmpeg binary; either the path to the binary or its containing directory
	FFmpegLocation *string `` /* 241-byte string literal not displayed */
	// Execute a command, optionally prefixed with when to execute it, separated by a ":".
	// Supported values of "WHEN" are the same as that of --use-postprocessor (default:
	// after_move). The same syntax as the output template can be used to pass any field as
	// arguments to the command. If no fields are passed, %(filepath,_filename|)q is appended to
	// the end of the command. This option can be used multiple times
	Exec []string `` /* 524-byte string literal not displayed */
	// Remove any previously defined --exec
	NoExec               *bool   `` /* 159-byte string literal not displayed */
	ExecBeforeDownload   *string `` /* 168-byte string literal not displayed */
	NoExecBeforeDownload *bool   `` /* 173-byte string literal not displayed */
	// Convert the subtitles to another format (currently supported: ass, lrc, srt, vtt). Use
	// "--convert-subs none" to disable conversion (default)
	ConvertSubs *string `` /* 291-byte string literal not displayed */
	// Convert the thumbnails to another format (currently supported: jpg, png, webp). You can
	// specify multiple rules using similar syntax as "--remux-video". Use "--convert-thumbnails
	// none" to disable conversion (default)
	ConvertThumbnails *string `` /* 382-byte string literal not displayed */
	// Split video into multiple files based on internal chapters. The "chapter:" prefix can be
	// used with "--paths" and "--output" to set the output filename for the split files. See
	// "OUTPUT TEMPLATE" for details
	SplitChapters *bool `` /* 362-byte string literal not displayed */
	// Do not split video based on chapters (default)
	NoSplitChapters *bool `` /* 200-byte string literal not displayed */
	// Remove chapters whose title matches the given regular expression. The syntax is the same
	// as --download-sections. This option can be used multiple times
	RemoveChapters []string `` /* 304-byte string literal not displayed */
	// Do not remove any chapters from the file (default)
	NoRemoveChapters *bool `` /* 208-byte string literal not displayed */
	// Force keyframes at cuts when downloading/splitting/removing sections. This is slow due to
	// needing a re-encode, but the resulting video may have fewer artifacts around the cuts
	ForceKeyframesAtCuts *bool `` /* 358-byte string literal not displayed */
	// Do not force keyframes around the chapters when cutting/splitting (default)
	NoForceKeyframesAtCuts *bool `` /* 263-byte string literal not displayed */
	// The (case-sensitive) name of plugin postprocessors to be enabled, and (optionally)
	// arguments to be passed to it, separated by a colon ":". ARGS are a semicolon ";" delimited
	// list of NAME=VALUE. The "when" argument determines when the postprocessor is invoked. It
	// can be one of "pre_process" (after video extraction), "after_filter" (after video passes
	// filter), "video" (after --format; before --print/--output), "before_dl" (before each video
	// download), "post_process" (after each video download; default), "after_move" (after moving
	// the video file to its final location), "after_video" (after downloading and processing all
	// formats of a video), or "playlist" (at end of playlist). This option can be used multiple
	// times to add different postprocessors
	UsePostProcessor []string `` /* 937-byte string literal not displayed */
}

func (*FlagsPostProcessing) ToFlags

func (g *FlagsPostProcessing) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsPostProcessing.Validate should be called first.

func (*FlagsPostProcessing) Validate

func (g *FlagsPostProcessing) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsSponsorBlock

type FlagsSponsorBlock struct {
	// SponsorBlock categories to create chapters for, separated by commas. Available categories
	// are sponsor, intro, outro, selfpromo, preview, filler, interaction, music_offtopic, hook,
	// poi_highlight, chapter, all and default (=all). You can prefix the category with a "-" to
	// exclude it. See [1] for descriptions of the categories. E.g. --sponsorblock-mark
	// all,-preview [1] https://wiki.sponsor.ajay.app/w/Segment_Categories
	SponsorblockMark *string `` /* 581-byte string literal not displayed */
	// SponsorBlock categories to be removed from the video file, separated by commas. If a
	// category is present in both mark and remove, remove takes precedence. The syntax and
	// available categories are the same as for --sponsorblock-mark except that "default" refers
	// to "all,-filler" and poi_highlight, chapter are not available
	SponsorblockRemove *string `` /* 494-byte string literal not displayed */
	// An output template for the title of the SponsorBlock chapters created by
	// --sponsorblock-mark. The only available fields are start_time, end_time, category,
	// categories, name, category_names. Defaults to "[SponsorBlock]: %(category_names)l"
	SponsorblockChapterTitle *string `` /* 436-byte string literal not displayed */
	// Disable both --sponsorblock-mark and --sponsorblock-remove
	NoSponsorblock *bool `` /* 211-byte string literal not displayed */
	// SponsorBlock API location, defaults to https://sponsor.ajay.app
	SponsorblockAPI *string `` /* 220-byte string literal not displayed */
}

func (*FlagsSponsorBlock) ToFlags

func (g *FlagsSponsorBlock) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsSponsorBlock.Validate should be called first.

func (*FlagsSponsorBlock) Validate

func (g *FlagsSponsorBlock) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsSubtitle

type FlagsSubtitle struct {
	// Write subtitle file
	WriteSubs *bool `` /* 160-byte string literal not displayed */
	// Do not write subtitle file (default)
	NoWriteSubs *bool `` /* 182-byte string literal not displayed */
	// Write automatically generated subtitle file
	WriteAutoSubs *bool `` /* 199-byte string literal not displayed */
	// Do not write auto-generated subtitles (default)
	NoWriteAutoSubs *bool `` /* 208-byte string literal not displayed */
	AllSubs         *bool `` /* 133-byte string literal not displayed */
	// List available subtitles of each video. Simulate unless --no-simulate is used
	ListSubs *bool `` /* 214-byte string literal not displayed */
	// Subtitle format; accepts formats preference separated by "/", e.g. "srt" or "ass/srt/best"
	SubFormat *string `` /* 239-byte string literal not displayed */
	// Languages of the subtitles to download (can be regex) or "all" separated by commas, e.g.
	// --sub-langs "en.*,ja" (where "en.*" is a regex pattern that matches "en" followed by 0 or
	// more of any character). You can prefix the language code with a "-" to exclude it from the
	// requested languages, e.g. --sub-langs all,-live_chat. Use --list-subs for a list of
	// available language tags
	SubLangs *string `` /* 526-byte string literal not displayed */
}

func (*FlagsSubtitle) ToFlags

func (g *FlagsSubtitle) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsSubtitle.Validate should be called first.

func (*FlagsSubtitle) Validate

func (g *FlagsSubtitle) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsThumbnail

type FlagsThumbnail struct {
	// Write thumbnail image to disk
	WriteThumbnail *bool `` /* 180-byte string literal not displayed */
	// Do not write thumbnail image to disk (default)
	NoWriteThumbnail *bool `` /* 202-byte string literal not displayed */
	// Write all thumbnail image formats to disk
	WriteAllThumbnails *bool `` /* 201-byte string literal not displayed */
	// List available thumbnails of each video. Simulate unless --no-simulate is used
	ListThumbnails *bool `` /* 231-byte string literal not displayed */
}

func (*FlagsThumbnail) ToFlags

func (g *FlagsThumbnail) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsThumbnail.Validate should be called first.

func (*FlagsThumbnail) Validate

func (g *FlagsThumbnail) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsVerbositySimulation

type FlagsVerbositySimulation struct {
	// Activate quiet mode. If used with --verbose, print the log to stderr
	Quiet *bool `` /* 182-byte string literal not displayed */
	// Deactivate quiet mode. (Default)
	NoQuiet *bool `` /* 151-byte string literal not displayed */
	// Ignore warnings
	NoWarnings *bool `` /* 152-byte string literal not displayed */
	// Do not download the video and do not write anything to disk
	Simulate *bool `` /* 185-byte string literal not displayed */
	// Download the video even if printing/listing options are used
	NoSimulate *bool `` /* 191-byte string literal not displayed */
	// Ignore "No video formats" error. Useful for extracting metadata even if the videos are not
	// actually available for download (experimental)
	IgnoreNoFormatsError *bool `` /* 322-byte string literal not displayed */
	// Throw error when no downloadable video formats are found (default)
	NoIgnoreNoFormatsError *bool `` /* 254-byte string literal not displayed */
	// Do not download the video but write all related files
	SkipDownload *bool `` /* 198-byte string literal not displayed */
	// Field name or output template to print to screen, optionally prefixed with when to print
	// it, separated by a ":". Supported values of "WHEN" are the same as that of
	// --use-postprocessor (default: video). Implies --quiet. Implies --simulate unless
	// --no-simulate or later stages of WHEN are used. This option can be used multiple times
	Print []string `` /* 459-byte string literal not displayed */
	// Append given template to the file. The values of WHEN and TEMPLATE are the same as that of
	// --print. FILE uses the same syntax as the output template. This option can be used
	// multiple times
	PrintToFile    []*FlagPrintToFile `` /* 332-byte string literal not displayed */
	GetURL         *bool              `json:"get_url,omitempty" id:"geturl" jsonschema:"title=GetURL" jsonschema_extras:"uid=geturl" jsonschema_description:""`
	GetTitle       *bool              `` /* 127-byte string literal not displayed */
	GetID          *bool              `json:"get_id,omitempty" id:"getid" jsonschema:"title=GetID" jsonschema_extras:"uid=getid" jsonschema_description:""`
	GetThumbnail   *bool              `` /* 143-byte string literal not displayed */
	GetDescription *bool              `` /* 151-byte string literal not displayed */
	GetDuration    *bool              `` /* 139-byte string literal not displayed */
	GetFilename    *bool              `` /* 139-byte string literal not displayed */
	GetFormat      *bool              `` /* 131-byte string literal not displayed */
	// Quiet, but print JSON information for each video. Simulate unless --no-simulate is used.
	// See "OUTPUT TEMPLATE" for a description of available keys
	DumpJSON *bool `` /* 275-byte string literal not displayed */
	// Quiet, but print JSON information for each URL or infojson passed. Simulate unless
	// --no-simulate is used. If the URL refers to a playlist, the whole playlist information is
	// dumped in a single line
	DumpSingleJSON *bool `` /* 352-byte string literal not displayed */
	PrintJSON      *bool `` /* 133-byte string literal not displayed */
	// Force download archive entries to be written as far as no errors occur, even if -s or
	// another simulation option is used
	ForceWriteArchive *bool `` /* 305-byte string literal not displayed */
	// Output progress bar as new lines
	Newline *bool `` /* 182-byte string literal not displayed */
	// Do not print progress bar
	NoProgress *bool `` /* 160-byte string literal not displayed */
	// Show progress bar, even if in quiet mode
	Progress *bool `` /* 170-byte string literal not displayed */
	// Display progress in console titlebar
	ConsoleTitle *bool `` /* 179-byte string literal not displayed */
	// Template for progress outputs, optionally prefixed with one of "download:" (default),
	// "download-title:" (the console title), "postprocess:",  or "postprocess-title:". The
	// video's fields are accessible under the "info" key and the progress attributes are
	// accessible under "progress" key. E.g. --console-title --progress-template
	// "download-title:%(info.id)s-%(progress.eta)s"
	ProgressTemplate *string `` /* 548-byte string literal not displayed */
	// Time between progress output (default: 0)
	ProgressDelta *float64 `` /* 190-byte string literal not displayed */
	// Print various debugging information
	Verbose *bool `` /* 157-byte string literal not displayed */
	// Print downloaded pages encoded using base64 to debug problems (very verbose)
	DumpPages *bool `` /* 235-byte string literal not displayed */
	// Write downloaded intermediary pages to files in the current directory to debug problems
	WritePages *bool `` /* 224-byte string literal not displayed */
	// Display sent and read HTTP traffic
	PrintTraffic *bool `` /* 189-byte string literal not displayed */
}

func (*FlagsVerbositySimulation) ToFlags

func (g *FlagsVerbositySimulation) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsVerbositySimulation.Validate should be called first.

func (*FlagsVerbositySimulation) Validate

func (g *FlagsVerbositySimulation) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsVideoFormat

type FlagsVideoFormat struct {
	// Video format code, see "FORMAT SELECTION" for more details
	Format *string `` /* 178-byte string literal not displayed */
	// Sort the formats by the fields given, see "Sorting Formats" for more details
	FormatSort *string `` /* 215-byte string literal not displayed */
	// Force user specified sort order to have precedence over all fields, see "Sorting Formats"
	// for more details
	FormatSortForce *bool `` /* 268-byte string literal not displayed */
	// Some fields have precedence over the user specified sort order (default)
	NoFormatSortForce *bool `` /* 237-byte string literal not displayed */
	// Allow multiple video streams to be merged into a single file
	VideoMultistreams *bool `` /* 245-byte string literal not displayed */
	// Only one video stream is downloaded for each output file (default)
	NoVideoMultistreams *bool `` /* 256-byte string literal not displayed */
	// Allow multiple audio streams to be merged into a single file
	AudioMultistreams *bool `` /* 245-byte string literal not displayed */
	// Only one audio stream is downloaded for each output file (default)
	NoAudioMultistreams *bool `` /* 256-byte string literal not displayed */
	AllFormats          *bool `` /* 127-byte string literal not displayed */
	// Prefer video formats with free containers over non-free ones of the same quality. Use with
	// "-S ext" to strictly prefer free containers irrespective of quality
	PreferFreeFormats *bool `` /* 328-byte string literal not displayed */
	// Don't give any special preference to free containers (default)
	NoPreferFreeFormats *bool `` /* 235-byte string literal not displayed */
	// Make sure formats are selected only from those that are actually downloadable
	CheckFormats *bool `` /* 222-byte string literal not displayed */
	// Check all formats for whether they are actually downloadable
	CheckAllFormats *bool `` /* 212-byte string literal not displayed */
	// Do not check that the formats are actually downloadable
	NoCheckFormats *bool `` /* 205-byte string literal not displayed */
	// List available formats of each video. Simulate unless --no-simulate is used
	ListFormats        *bool `` /* 214-byte string literal not displayed */
	ListFormatsAsTable *bool `` /* 167-byte string literal not displayed */
	ListFormatsOld     *bool `` /* 158-byte string literal not displayed */
	// Containers that may be used when merging formats, separated by "/", e.g. "mp4/mkv".
	// Ignored if no merge is required. (currently supported: avi, flv, mkv, mov, mp4, webm)
	MergeOutputFormat *string `` /* 341-byte string literal not displayed */
}

func (*FlagsVideoFormat) ToFlags

func (g *FlagsVideoFormat) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsVideoFormat.Validate should be called first.

func (*FlagsVideoFormat) Validate

func (g *FlagsVideoFormat) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsVideoSelection

type FlagsVideoSelection struct {
	PlaylistStart *int `` /* 147-byte string literal not displayed */
	PlaylistEnd   *int `` /* 139-byte string literal not displayed */
	// Comma-separated playlist_index of the items to download. You can specify a range using
	// "[START]:[STOP][:STEP]". For backward compatibility, START-STOP is also supported. Use
	// negative indices to count from the right and negative STEP to download in reverse order.
	// E.g. "-I 1:3,7,-5::2" used on a playlist of size 15 will download the items at index
	// 1,2,3,7,11,13,15
	PlaylistItems *string `` /* 517-byte string literal not displayed */
	MatchTitle    *string `` /* 135-byte string literal not displayed */
	RejectTitle   *string `` /* 139-byte string literal not displayed */
	// Abort download if filesize is smaller than SIZE, e.g. 50k or 44.6M
	MinFileSize *string `` /* 207-byte string literal not displayed */
	// Abort download if filesize is larger than SIZE, e.g. 50k or 44.6M
	MaxFileSize *string `` /* 206-byte string literal not displayed */
	// Download only videos uploaded on this date. The date can be "YYYYMMDD" or in the format
	// [now|today|yesterday][-N[day|week|month|year]]. E.g. "--date today-2weeks" downloads only
	// videos uploaded on the same day two weeks ago
	Date *string `` /* 337-byte string literal not displayed */
	// Download only videos uploaded on or before this date. The date formats accepted are the
	// same as --date
	DateBefore *string `` /* 236-byte string literal not displayed */
	// Download only videos uploaded on or after this date. The date formats accepted are the
	// same as --date
	DateAfter *string `` /* 231-byte string literal not displayed */
	MinViews  *int    `` /* 129-byte string literal not displayed */
	MaxViews  *int    `` /* 129-byte string literal not displayed */
	// Generic video filter. Any "OUTPUT TEMPLATE" field can be compared with a number or a
	// string using the operators defined in "Filtering Formats". You can also simply specify a
	// field to match if the field is present, use "!field" to check if the field is not present,
	// and "&" to check multiple conditions. Use a "\" to escape "&" or quotes if needed. If used
	// multiple times, the filter matches if at least one of the conditions is met. E.g.
	// --match-filters !is_live --match-filters "like_count>?100 & description~='(?i)\bcats \&
	// dogs\b'" matches only videos that are not live OR those that have a like count more than
	// 100 (or the like field is not available) and also has a description that contains the
	// phrase "cats & dogs" (caseless). Use "--match-filters -" to interactively ask whether to
	// download each video
	MatchFilters []string `` /* 974-byte string literal not displayed */
	// Do not use any --match-filters (default)
	NoMatchFilters *bool `` /* 188-byte string literal not displayed */
	// Same as "--match-filters" but stops the download process when a video is rejected
	BreakMatchFilters *string `` /* 255-byte string literal not displayed */
	// Do not use any --break-match-filters (default)
	NoBreakMatchFilters *bool `` /* 223-byte string literal not displayed */
	// Download only the video, if the URL refers to a video and a playlist
	NoPlaylist *bool `` /* 203-byte string literal not displayed */
	// Download the playlist, if the URL refers to a video and a playlist
	YesPlaylist *bool `` /* 203-byte string literal not displayed */
	// Download only videos suitable for the given age
	AgeLimit *int `` /* 176-byte string literal not displayed */
	// Download only videos not listed in the archive file. Record the IDs of all downloaded
	// videos in it
	DownloadArchive *string `` /* 255-byte string literal not displayed */
	// Do not use archive file (default)
	NoDownloadArchive *bool `` /* 195-byte string literal not displayed */
	// Abort after downloading NUMBER files
	MaxDownloads *int `` /* 181-byte string literal not displayed */
	// Stop the download process when encountering a file that is in the archive supplied with
	// the --download-archive option
	BreakOnExisting *bool `` /* 277-byte string literal not displayed */
	// Do not stop the download process when encountering a file that is in the archive (default)
	NoBreakOnExisting *bool `` /* 255-byte string literal not displayed */
	BreakOnReject     *bool `` /* 152-byte string literal not displayed */
	// Alters --max-downloads, --break-on-existing, --break-match-filters, and autonumber to
	// reset per input URL
	BreakPerInput *bool `` /* 253-byte string literal not displayed */
	// --break-on-existing and similar options terminates the entire download queue
	NoBreakPerInput *bool `` /* 229-byte string literal not displayed */
	// Number of allowed failures until the rest of the playlist is skipped
	SkipPlaylistAfterErrors *int `` /* 263-byte string literal not displayed */
}

func (*FlagsVideoSelection) ToFlags

func (g *FlagsVideoSelection) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsVideoSelection.Validate should be called first.

func (*FlagsVideoSelection) Validate

func (g *FlagsVideoSelection) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type FlagsWorkarounds

type FlagsWorkarounds struct {
	// Force the specified encoding (experimental)
	Encoding *string `` /* 169-byte string literal not displayed */
	// Explicitly allow HTTPS connection to servers that do not support RFC 5746 secure
	// renegotiation
	LegacyServerConnect *bool `` /* 270-byte string literal not displayed */
	// Suppress HTTPS certificate validation
	NoCheckCertificates *bool `` /* 211-byte string literal not displayed */
	// Use an unencrypted connection to retrieve information about the video (Currently supported
	// only for YouTube)
	PreferInsecure *bool   `` /* 261-byte string literal not displayed */
	UserAgent      *string `` /* 133-byte string literal not displayed */
	Referer        *string `json:"referer,omitempty" id:"referer" jsonschema:"title=Referer" jsonschema_extras:"uid=referer" jsonschema_description:""`
	// Specify a custom HTTP header and its value, separated by a colon ":". You can use this
	// option multiple times
	AddHeaders []string `` /* 239-byte string literal not displayed */
	// Work around terminals that lack bidirectional text support. Requires bidiv or fribidi
	// executable in PATH
	BidiWorkaround *bool `` /* 257-byte string literal not displayed */
	// Number of seconds to sleep between requests during data extraction
	SleepRequests *float64 `` /* 233-byte string literal not displayed */
	// Number of seconds to sleep before each download. This is the minimum time to sleep when
	// used along with --max-sleep-interval
	SleepInterval *float64 `` /* 273-byte string literal not displayed */
	// Maximum number of seconds to sleep. Can only be used along with --min-sleep-interval
	MaxSleepInterval *float64 `` /* 248-byte string literal not displayed */
	// Number of seconds to sleep before each subtitle download
	SleepSubtitles *int `` /* 227-byte string literal not displayed */
}

func (*FlagsWorkarounds) ToFlags

func (g *FlagsWorkarounds) ToFlags() (flags Flags)

ToFlags returns the generated flags based off the provided configuration. FlagsWorkarounds.Validate should be called first.

func (*FlagsWorkarounds) Validate

func (g *FlagsWorkarounds) Validate() error

Validate ensures all flags have appropriate values. If there are validation-specific errors, they will be returned as a ErrMultipleJSONParsingFlags error.

type InstallBunOptions

type InstallBunOptions struct {
	// DisableDownload is a simple toggle to never allow downloading, which would
	// be the same as never calling [InstallBun] or [MustInstallBun] in the first place.
	DisableDownload bool

	// DisableSystem is a simple toggle to never allow resolving from the system PATH.
	DisableSystem bool

	// DownloadURL is the exact url to the binary location to download (and store).
	// Leave empty to use GitHub (windows, linux) and evermeet.cx (macos) +
	// auto-detected os/arch.
	DownloadURL string
}

type InstallFFmpegOptions

type InstallFFmpegOptions struct {
	// DisableDownload is a simple toggle to never allow downloading, which would
	// be the same as never calling [InstallFFmpeg] or [MustInstallFFmpeg] in the first place.
	DisableDownload bool

	// DisableSystem is a simple toggle to never allow resolving from the system PATH.
	DisableSystem bool

	// DownloadURL is the exact url to the binary location to download (and store).
	// Leave empty to use GitHub (windows, linux) and evermeet.cx (macos) +
	// auto-detected os/arch.
	DownloadURL string
}

type InstallOptions

type InstallOptions struct {
	// DisableDownload is a simple toggle to never allow downloading, which would
	// be the same as never calling [Install] or [MustInstall] in the first place.
	DisableDownload bool

	// DisableChecksum disables checksum verification when downloading.
	DisableChecksum bool

	// DisableSystem is a simple toggle to never allow resolving from the system PATH.
	DisableSystem bool

	// AllowVersionMismatch allows mismatched versions to be used and installed.
	// This will only be used when the yt-dlp executable is resolved outside of
	// go-ytdlp's cache.
	//
	// AllowVersionMismatch is ignored if DisableDownload is true.
	AllowVersionMismatch bool

	// DownloadURL is the exact url to the binary location to download (and store).
	// Leave empty to use GitHub + auto-detected os/arch.
	DownloadURL string
}

InstallOptions are configuration options for installing yt-dlp dynamically (when it's not already installed).

type ProgressCallbackFunc

type ProgressCallbackFunc func(update ProgressUpdate)

ProgressCallbackFunc is a callback function that is called when (if) we receive progress updates from yt-dlp.

type ProgressStatus

type ProgressStatus string

ProgressStatus is the status of the download progress.

const (
	ProgressStatusStarting       ProgressStatus = "starting"
	ProgressStatusDownloading    ProgressStatus = "downloading"
	ProgressStatusPostProcessing ProgressStatus = "post_processing"
	ProgressStatusError          ProgressStatus = "error"
	ProgressStatusFinished       ProgressStatus = "finished"
)

func (ProgressStatus) IsCompletedType

func (s ProgressStatus) IsCompletedType() bool

type ProgressUpdate

type ProgressUpdate struct {
	Info *ExtractedInfo `json:"info"`

	// Status is the current status of the download.
	Status ProgressStatus `json:"status"`
	// TotalBytes is the total number of bytes in the download. If yt-dlp is unable
	// to determine the total bytes, this will be 0.
	TotalBytes int `json:"total_bytes"`
	// DownloadedBytes is the number of bytes that have been downloaded so far.
	DownloadedBytes int `json:"downloaded_bytes"`
	// FragmentIndex is the index of the current fragment being downloaded.
	FragmentIndex int `json:"fragment_index,omitempty"`
	// FragmentCount is the total number of fragments in the download.
	FragmentCount int `json:"fragment_count,omitempty"`

	// Filename is the filename of the video being downloaded, if available. Note that
	// this is not necessarily the same as the destination file, as post-processing
	// may merge multiple files into one.
	Filename string `json:"filename"`

	// Started is the time the download started.
	Started time.Time `json:"started"`
	// Finished is the time the download finished. If the download is still in progress,
	// this will be zero. You can validate with IsZero().
	Finished time.Time `json:"finished,omitempty"`
}

ProgressUpdate is a point-in-time snapshot of the download progress.

func (*ProgressUpdate) Duration

func (p *ProgressUpdate) Duration() time.Duration

Duration returns the duration of the download. If the download is still in progress, it will return the time since the download started.

func (*ProgressUpdate) ETA

func (p *ProgressUpdate) ETA() time.Duration

ETA returns the estimated time until the download is complete. If the download is complete, or hasn't started yet, it will return 0.

func (*ProgressUpdate) Percent

func (p *ProgressUpdate) Percent() float64

Percent returns the percentage of the download that has been completed. If yt-dlp is unable to determine the total bytes, it will return 0.

func (*ProgressUpdate) PercentString

func (p *ProgressUpdate) PercentString() string

PercentString is like Percent, but returns a string representation of the percentage.

type ResolvedInstall

type ResolvedInstall struct {
	Executable string // Path to the executable.
	Version    string // Version that was resolved. If [InstallOptions.AllowVersionMismatch] is specified, this will be empty.
	FromCache  bool   // Whether the executable was resolved from the cache.
	Downloaded bool   // Whether the executable was downloaded during this invocation.
}

ResolvedInstall is the found executable.

func Install

func Install(ctx context.Context, opts *InstallOptions) (*ResolvedInstall, error)

Install will check to see if yt-dlp is installed (if it's the right version), and if not, will download it from GitHub. If yt-dlp is already installed, it will check to see if the version matches (unless disabled with [AllowVersionMismatch]), and if not, will download the same version that go-ytdlp (the version you are using) was built with.

Note: If Install is not called, go-ytdlp WILL NOT DOWNLOAD yt-dlp. Only use this function if you want to ensure yt-dlp is installed, and are ok with it being downloaded.

func InstallAll

func InstallAll(ctx context.Context) ([]*ResolvedInstall, error)

InstallAll installs all dependencies for go-ytdlp concurrently, using default options. Note that this will not work on all platforms, as some dependencies are only supported on certain platforms.

func InstallBun

func InstallBun(ctx context.Context, opts *InstallBunOptions) (*ResolvedInstall, error)

InstallBun will attempt to download and install bun for the current platform. If the binary is already installed or found in the PATH, it will return the resolved binary unless InstallBunOptions.DisableSystem is set to true. Note that downloading of bun is only supported on a handful of platforms, and so it is still recommended to install bun via other means.

func InstallFFmpeg

func InstallFFmpeg(ctx context.Context, opts *InstallFFmpegOptions) (*ResolvedInstall, error)

InstallFFmpeg will attempt to download and install FFmpeg for the current platform. If the binary is already installed or found in the PATH, it will return the resolved binary unless InstallFFmpegOptions.DisableSystem is set to true. Note that downloading of ffmpeg and ffprobe is only supported on a handful of platforms, and so it is still recommended to install ffmpeg/ffprobe via other means.

func InstallFFprobe

func InstallFFprobe(ctx context.Context, opts *InstallFFmpegOptions) (*ResolvedInstall, error)

InstallFFprobe will attempt to download and install FFprobe for the current platform. If the binary is already installed or found in the PATH, it will return the resolved binary unless InstallFFmpegOptions.DisableSystem is set to true. Note that downloading of ffmpeg and ffprobe is only supported on a handful of platforms, and so it is still recommended to install ffmpeg/ffprobe via other means.

func MustInstallAll

func MustInstallAll(ctx context.Context) []*ResolvedInstall

MustInstallAll is similar to InstallAll, but panics if there is an error.

type Result

type Result struct {
	// Executable is the path to the yt-dlp executable that was invoked.
	Executable string `json:"executable"`

	// Args are the arguments that were passed to yt-dlp, excluding the executable.
	Args []string `json:"args"`

	// ExitCode is the exit code of the yt-dlp process.
	ExitCode int `json:"exit_code"`

	// Stdout is the stdout of the yt-dlp process, with trailing newlines removed.
	Stdout string `json:"stdout"`

	// Stderr is the stderr of the yt-dlp process, with trailing newlines removed.
	Stderr string `json:"stderr"`

	// OutputLogs are the stdout/stderr logs, sorted by timestamp, and any JSON
	// parsed (if configured with [Command.PrintJson]).
	OutputLogs []*ResultLog `json:"output_logs"`
}

Result contains the yt-dlp execution results, including stdout/stderr, exit code, and any output logs. Note that output logs should already be pre-processed via Result.OutputLogs, which will be sorted by timestamp, and any JSON parsed (if configured with [Command.PrintJson] or similar).

func (*Result) GetExtractedInfo

func (r *Result) GetExtractedInfo() (info []*ExtractedInfo, err error)

GetExtractedInfo returns the extracted info from the yt-dlp output logs. Note that this will only return info if yt-dlp was invoked with [Command.PrintJson] or similar.

func (*Result) String

func (r *Result) String() string

type ResultLog

type ResultLog struct {
	Timestamp time.Time        `json:"timestamp"`
	Line      string           `json:"line"`
	JSON      *json.RawMessage `json:"json,omitempty"` // May be nil if the log line wasn't valid JSON.
	Pipe      string           `json:"pipe"`           // stdout or stderr.
}

func (*ResultLog) String

func (r *ResultLog) String() string

Directories

Path Synopsis
Package optiondata contains the raw option data for go-ytdlp.
Package optiondata contains the raw option data for go-ytdlp.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL