yt-dlp

# single video:
yt-dlp -c -i --restrict-filenames --socket-timeout 120 --retries 9999 -S res,ext:mp4:m4a --recode mp4 --embed-metadata -r 2000k 'url'

# playlist
yt-dlp -c -i --restrict-filenames --socket-timeout 120 --retries 9999 -S res,ext:mp4:m4a --recode mp4 -o '%(playlist_uploader)s-%(playlist_title)s/%(playlist_index)s-%(title)s-%(id)s.%(ext)s' --embed-metadata -r 2000k --download-archive 'my-yt-dlp-archive.txt' 'url'


# without re-enconding into mp4:
# single
yt-dlp -c -i --restrict-filenames --socket-timeout 120 --retries 9999 -S res,ext:mp4:m4a --embed-metadata -r 2000k 'url'
# playlist
yt-dlp -c -i --restrict-filenames --socket-timeout 120 --retries 9999 -S res,ext:mp4:m4a -o '%(playlist_uploader)s-%(playlist_title)s/%(playlist_index)s-%(title)s-%(id)s.%(ext)s' --embed-metadata -r 2000k  'url'