This can be done by hand, but via scrip also. Displayr flickering when the script is running. If you do not have yt-dlp/config, you need to make it first.
mkdir -p $HOME/.config/yt-dlp && touch $HOME/.config/yt-dlp/config
The script:
#!/bin/bash
yad --center --width=500 --height=50 --text-align=center --text="This script install config file for YouTube videos for avoinding webm videos"
if [ $? = 0 ];
then
x-terminal-emulator -e mv $HOME/.config/yt-dlp/config $HOME/.config/yt-dlp/config.orig && \
x-terminal-emulator -e mkdir -p $HOME/.config/yt-dlp && \
x-terminal-emulator -e touch $HOME/.config/yt-dlp/config &&
{
echo '--ignore-errors '
echo '# --no-playlist '
echo '# Save in $HOME '
echo '-o ~/%(title)s.%(ext)s '
echo '# Prefer 1080p or lower resolutions '
echo '-f bestvideo[ext=mp4][width<1280][height<=720]+bestaudio[ext=m4a]/bestvideo[width<1280][height<=720]+bestaudio/best[width<1280][height<=720]/best '
} > $HOME/.config/yt-dlp/config
yad --center --width=900 --height=30 --text-align=center --text="This script installed config file to $HOME/.config/yt-dlp/config file. \
Downloaded videos are coming into your home directory \
You can find backup from $HOME/.config/yt-dlp/config.orig ... if there was file before"
else exit 0
fi
Read also: https://puolanka.org/goto/to-disable-webm-video-download-in-yt-dlp/