Use youtube-dl: https://ytdl-org.github.io/youtube-dl/index.html . It's both free and the source is public domain: https://github.com/ytdl-org/youtube-dl/
app $ youtube-dl https://www.youtube.com/watch?v=12345678
[youtube] 12345678: Downloading webpage
ERROR: 12345678: YouTube said: This video has been removed for violating YouTube's Community Guidelines.
Sorry about that. app $ youtube-dl -u yyyyyyy@gmail.com -p zzzzzzzzz https://www.youtube.com/watch?v=1234343
[youtube] Downloading login page
[youtube] Looking up account info
[youtube] Logging in
WARNING: Unable to log in: HTTP Error 400: Bad Request
I disabled 2FA, and confirmed that my password is correct by logging out on the web, and back in again.