This is a known issue, fixed in Master. For a temporary fix,
python3 -m pip install --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz
This installs tha master version. Run it through the command-line
yt-dlp URL
where URL is the URL of the video you want. See yt-dlp --help
for all options. It should just work without errors.
If you’re using it as a module,
import yt_dlp as youtube_dl
might fix your problems (though there could be API changes that break your code; I don’t know which version of yt_dlp
you were using etc).