I kept hitting this and it drove me a little crazy, so here's the short version in case it saves someone an afternoon.

Same command. Same yt-dlp version. Same URL. On my laptop it downloads fine. On my EC2 box it throws ERROR: ... Sign in to confirm you're not a bot, or a 403, or just "no formats found". Nothing in the command changed, so for a while I assumed the server was missing something - a dependency, a JS runtime, cookies, whatever.

It wasn't any of that. It's the IP.

The actual diagnosis

YouTube scores the IP the request comes from. Residential and mobile IPs (your home, your phone) are trusted. Datacenter IPs - AWS, GCP, most VPS providers, Hetzner, DigitalOcean - are not, and a lot of those ranges are already burned because everyone and their scraper runs from them. So the same request that sails through from your couch gets a bot check from your server.

Quick way to confirm it's the IP and not your setup: run the exact same thing on both machines.

yt-dlp --version # make sure these match yt-dlp --simulate -F "https://www.youtube.com/watch?v=jNQXAC9IVRw" 

If your laptop lists formats and the server throws a bot check with the same version, you're not debugging yt-dlp anymore. You're debugging IP reputation. Updating yt-dlp again won't change that (worth doing once to rule out a stale build, but that's it).

What actually helps (honest order)

  1. Run it from a residential connection. If you can run the download on your own machine, a home server, or anything on a residential/mobile IP, do that. It's free and it just works. For a lot of hobby setups this is the whole answer.
  2. Route through a residential proxy. --proxy "http://user:pass@host:port" through a residential proxy makes the request look like a person again. This works, but residential proxies cost real money per GB, and a datacenter proxy won't help - it's the same category of IP as your server.
  3. Pass cookies from a logged-in account. --cookies cookies.txt sometimes gets you through, but it ties the download to a real account (which YouTube can rate-limit or flag), and on a bad IP it often still fails. Treat it as a maybe, not a fix.

What doesn't help: a datacenter VPN (same burned IP category), and updating for the fifth time.

I wrote up the longer version with the full diagnosis and the stuff that does and doesn't work here: https://ytdlp.org/guides/yt-dlp-blocked-on-server

If you just don't want to deal with the IP problem

Honestly, for a weekend project, run it locally and move on. The IP thing only really becomes a tax when you're running this server-side or inside some agent sandbox you don't control and can't put on a residential IP.

That second case is the one I got stuck on, so I ended up building importly.io for it - a hosted API (and MCP server) that takes a video or audio URL and gives you back the download, transcript, or metadata, running on residential proxies on its end so the IP reputation isn't your problem. Full disclosure, it's my thing. There's a free tier if you want to see whether it gets past what your server can't. If you're happy self-hosting on a residential box, you genuinely don't need it.

Anyway - if yt-dlp "suddenly broke in production" and works everywhere else, check the IP before you rewrite anything.