youtube-dl is a command-line program to download videos from YouTube.com and a few more sites
This project comes as a pre-built docker image that enables you to easily forward to your websites running at home or otherwise, including free SSL, without having to know too much about Nginx or Letsencrypt.