YouTube Downloads Failing on Your Server? 403, 429 and IP Bans Explained

7 min read Summarize with Claude ChatGPT Gemini Perplexity
YouTube Downloads Failing on Your Server? 403, 429 and IP Bans Explained

Why it works on your laptop and fails on your server

At home, your requests come from a residential IP address with a normal history. On a cloud server, they come from a data-centre IP range that thousands of scrapers and bots have used before you. YouTube treats that traffic with suspicion from the first request, and it gets stricter as volume grows.

That's why the same yt-dlp command that worked all week starts failing the day you deploy it, or the day your traffic picks up.

A laptop on a home connection gets through; a server on a data-centre IP gets blocked
Same command, different IP address. Home connections are trusted more than data-centre ranges.

What each error means

ErrorLikely causeFirst fix
HTTP Error 429: Too Many RequestsYour IP is being rate-limitedSlow down and back off
HTTP Error 403: ForbiddenExpired stream URL, outdated yt-dlp, or a flagged IPUpdate yt-dlp; don't reuse stream URLs
Sign in to confirm you're not a botYour IP has been flaggedFull fix guide
Video unavailable (but it plays in a browser)Throttling or region limitsFull fix guide
Requested format is not availableOutdated yt-dlp or a too-strict format choiceUpdate; use a fallback like bv*+ba/b

Fixes, in order of cost

Fixes in order of cost: update yt-dlp, slow down, back off, residential proxies, managed API
Start at the bottom: each step up costs more, in money or in risk.

1. Keep yt-dlp up to date

YouTube changes often, and yt-dlp releases fixes quickly. A surprising share of 403 errors simply come from an old version. Update before trying anything else, and update on every deploy:

bash
python -m pip install -U yt-dlp

2. Slow down

Bursts are what trigger rate limits. Add random sleeps and cut parallel downloads per IP:

bash
yt-dlp --sleep-requests 1 --sleep-interval 5 --max-sleep-interval 15 \
  -f "bv*+ba/b" -a urls.txt

Adding more workers on the same IP makes things worse, not faster.

3. Back off properly when you're limited

Retrying instantly after a 429 tells YouTube you're a bot. Wait longer after each failure, with some randomness so your workers don't retry in sync:

Python
import random, subprocess, time

def download_with_backoff(url, attempts=5):
    for attempt in range(attempts):
        result = subprocess.run(["yt-dlp", "-f", "bv*+ba/b", url],
                                capture_output=True, text=True)
        if result.returncode == 0:
            return True
        if "429" not in result.stderr and "403" not in result.stderr:
            raise RuntimeError(result.stderr.strip().splitlines()[-1])
        time.sleep(min(600, 30 * 2 ** attempt) + random.uniform(0, 15))
    return False

4. Don't fetch stream URLs ahead of time

The direct video URLs yt-dlp extracts are short-lived and tied to the IP that requested them. Extracting on one machine and downloading on another, or saving URLs for later, produces 403 errors. Extract and download in the same step, on the same machine.

5. Residential proxies

Residential IPs look like home connections, so they get far fewer blocks. They work, but they're billed per GB, and video is heavy: every byte of every video and every retry goes through the proxy. Read what that costs at scale before committing.

6. Cookies, with care

Passing browser cookies can get past some sign-in checks, but the account behind them can be flagged or banned, and cookies expire. Never use a personal or business account you can't afford to lose.

What not to do

  • Don't add workers on the same IP. More parallel requests mean faster bans.
  • Don't rotate between data-centre IPs from one provider. They usually share the same reputation, so you'll be blocked just as fast.
  • Don't retry in a tight loop. It turns a temporary limit into a longer block.

The managed option

A managed download API runs all of the above for you. Temporary failures, including 403s and broken fragments, are retried automatically before anything is reported. When a download can't happen, you get a code that explains why:

Python
RETRY_LATER = {"ERR_NO_WORKERS", "ERR_RATE_LIMITED", "ERR_DOWNLOAD_FAILED"}

def handle_error(data):
    label = data["error_label"]
    if label in RETRY_LATER:
        return "retry"
    return f"skip: {data['error']}"

Only the codes in RETRY_LATER are worth retrying. The others describe the video itself, such as VIDEO_PRIVATE or VIDEO_LIVE, so retrying won't help. The full list is in the API docs.

FAQ

Why does yt-dlp work on my laptop but not on my server?

Your laptop uses a home internet connection, which YouTube trusts more. Cloud servers use data-centre IP addresses shared with many other automated users, so they get rate-limited and bot-checked much sooner.

What does HTTP Error 429: Too Many Requests mean?

YouTube is rate-limiting your IP address. Slow down, add random delays between downloads, reduce parallel downloads, and back off before retrying.

What does HTTP Error 403: Forbidden mean in yt-dlp?

Usually that the stream URL expired or was fetched from a different IP, that your yt-dlp is out of date, or that your IP has been flagged. Update yt-dlp first, and never reuse stream URLs across machines.

Should I use cookies to get around bot checks?

It can work, but the account whose cookies you use can be flagged or banned, and cookies expire. Never use a personal or business account you can't afford to lose.

Do residential proxies fix YouTube IP bans?

Usually, yes, because their IPs look like home connections. The catch is cost: they're billed per GB, and video uses a lot of bandwidth.

Stop fighting IP bans

Rate limits, bot checks and retries handled for you. Send a URL, get the video, captions and metadata. First 100 free.