Skip to main content

Proxy Configuration

--proxy
string
Use the specified HTTP/HTTPS/SOCKS proxyTo 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 connectionExample:
yt-dlp --proxy "socks5://127.0.0.1:1080" URL
yt-dlp --proxy "http://proxy.example.com:8080" URL

Connection Settings

--socket-timeout
number
Time to wait before giving up, in secondsExample:
yt-dlp --socket-timeout 30 URL
--source-address
string
Client-side IP address to bind toExample:
yt-dlp --source-address 192.168.1.100 URL

Impersonation

--impersonate
string
Client to impersonate for requestsFormat: CLIENT[:OS]Pass --impersonate="" to impersonate any client.Note: Forcing impersonation for all requests may have a detrimental impact on download speed and stabilityExample:
yt-dlp --impersonate chrome URL
yt-dlp --impersonate chrome-110 URL
yt-dlp --impersonate chrome:windows-10 URL
--list-impersonate-targets
flag
List available clients to impersonate

IP Version

-4, --force-ipv4
flag
Make all connections via IPv4
-6, --force-ipv6
flag
Make all connections via IPv6

File URLs

--enable-file-urls
flag
Enable file:// URLsThis is disabled by default for security reasons

Geo-restriction

--geo-verification-proxy
string
Use this proxy to verify the IP address for some geo-restricted sitesThe default proxy specified by --proxy (or none, if the option is not present) is used for the actual downloadingExample:
yt-dlp --geo-verification-proxy "socks5://127.0.0.1:1080" URL
--xff
string
How to fake X-Forwarded-For HTTP header to try bypassing geographic restrictionValues:
  • default - Only when known to be useful
  • never - Never fake the header
  • IP block in CIDR notation (e.g., 1.2.3.4/24)
  • Two-letter ISO 3166-2 country code (e.g., US)
Example:
yt-dlp --xff "US" URL
yt-dlp --xff "1.2.3.4/24" URL