Not the OP, but I have a Postfix mail server running on my home media box that receives YouTube URLs sent to its special email address. Postfix passes the message to a Python script that parses out the URL and places it into a Redis queue. A second Python program, running as a daemon, watches the queue and then downloads the video using yt-dlp. I can also enqueue video URLs from the command line.
This is the command that the daemon runs to request 720p, for example:
This is the command that the daemon runs to request 720p, for example: