When I was setting up iPad and Raspberry Pi setup, I ran into an issue where yt-dlp, installed by sudo apt-get install yt-dlp was giving me 403 Forbidden errors.

From [Solved] yt-dlp HTTP Error 403: Forbidden - Debian User Forums, I discovered how to install a working version:

su -
nvim /etc/apt/sources.list

add

deb http://deb.debian.org/debian bookworm-backports main contrib non-free-firmware

run

sudo apt-get update
sudo apt-get install -t bookworm-backports yt-dlp

and it started working!