crawlfetch

pytube “HTTP Error 400: Bad Request”

pytube talks to YouTube's internal endpoints directly. When YouTube changes what those endpoints expect, pytube's requests get rejected with HTTP 400 until the library is updated.

Quick checks

  1. Upgrade: pip install -U pytube — then check whether a fix has been released.
  2. Try the community fork pytubefix, which has shipped fixes for several of these breakages.
  3. Test with a different, public, non-age-restricted video to rule out a video-specific issue.

The stable fix

If downloads are part of a product, move away from client-side extraction. A hosted API like CrawlFetch returns the same information as JSON from a stable endpoint. See the Python guide and pytube alternatives.

FAQ

Is HTTP 400 my fault?

Usually not — it typically starts for all users at once after a YouTube change.

Related

Last updated 2026-10-25

Add video downloads to your product today.

1,000 credits on signup plus 500 every month. That is roughly 180 YouTube clips to start, with no card.

Create free account