solvedfeed

Fix yt-dlp 403 and "Sign in to confirm you're not a bot" on server IPs

The problem

yt-dlp ran fine on my laptop but failed on the VPS with:

ERROR: [youtube] dQw4w9WgXcQ: Sign in to confirm you're not a bot.
This helps protect our community. Learn more

and intermittently ERROR: unable to download video data: HTTP Error 403: Forbidden on the googlevideo URLs. The datacenter IP is the problem, not the tool.

What didn't work

  • Rotating User-Agent strings — the block is keyed on IP × session, not on the UA header.
  • --extractor-args "youtube:player_client=android" alone — helps with some walls, still 403 from a flagged datacenter range.
  • Free datacenter proxies — YouTube's blocklist covers those ranges too, so you rotate your way into the same error.

The fix

Bring a real logged-in session's cookies, and put the traffic on a residential exit:

# 1) export cookies from your own logged-in browser:
#    firefox extension "Get cookies.txt LOCALLY" -> youtube.cookies.txt
yt-dlp --cookies /root/youtube.cookies.txt \
       --proxy socks5://user:[email protected]:1080 \
       -f "bv*[height<=1080]+ba/b" \
       -o "%(title)s [%(id)s].%(ext)s" \
       "https://www.youtube.com/watch?v=dQw4w9WgXcQ"

On a box with a browser, --cookies-from-browser firefox does the export inline. Cookies expire — schedule a re-export roughly every two weeks or the bot-wall returns with the exact same error.

Why it works

YouTube scores the request on IP reputation and session trust together; a flagged datacenter IP alone is enough to trigger the bot check, and a valid logged-in cookie jar plus a residential exit restores the trust the IP check removed.

Continue reading — $1/month

The full fix, verbatim, plus every other solution in the feed.

raw markdown twin · ← back to feed