I discovered a method for downloading YouTube videos that is based on the 4k Video Downloader method at Robservatory.com, but works faster and better for me. The software needed is called yt-dlp, and you can install it using Homebrew. Here’s one recommended Terminal command line for installing the most recently released yt-dlp:
brew install yt-dlp/taps/yt-dlp
To update the installation of yt-dlp performed this way, use the following command.
brew upgrade yt-dlp/taps/yt-dlp
After you’ve built this Automator Quick Action as described below, you’ll be able to select the URL of the video you’d like to download in the URL field of the web browser (Safari), then right-click and choose Services to select the action.
You’ll need to be able to set up a Quick Action (Monterey) or a Service (if you have a version of macOS older than Monterey, as shown in Rob’s article mentioned above, or as explained by Ben Waldie) in Automator. The Quick Action will be saved as a Contextual Menu Item and will be available from the Services menu when you right-click text (in our case, a URL link in Safari’s URL field).
Use one of the two paths to the yt-dlp executable, not both.
In the script included below, I used the first of the two because my Silicon Mac uses the M1 native version of HomeBrew to install yt-dlp:
So, if you have installed Homebrew natively on your Silicon (M1, M2, etc.) Mac, use the following line
set ExecLoc to "/opt/homebrew/bin"
If you have an Intel Mac or you have upgraded to Silicon, but haven’t migrated your Homebrew installation, use the following line instead:
ExecLoc to "/usr/local/bin"
You can normally determine the location of the executable by running the Terminal command:
which yt-dlp
It is possible to include that command in the script, but that would make the script more complex than it really needs to be, so I suggest performing that step yourself and using the result to decide which line of the included script to use. (Both lines specifying the typical locations for the yt-dlp executable are included in the code below, but I’ve started the unneeded line with “#” to include it only as a comment, nullifying its ability to affect the AppleScript. If you like, you may leave both lines, and simply “comment” the line that isn’t appropriate for your configuration. I’ve used two “#”‘s, just to make them easier to see. One is enough to “comment” the line. In AppleScript, 2 hyphens can be used at the beginning of a line as an alternative method of transforming it into a comment.)
The first step in making the contextual menu item that will download videos is to create a new document in the Automator app on your Mac. If you open Automator and it presents an Open dialog window, just close it and select New from the File menu. Here’s where you specify the Quick Action workflow type.

You’ll need a Run AppleScript action in your Quick Action or Service workflow. The AppleScript I’ve composed contains the command line that will be sent to the yt-dlp executable. I’ve tried several forms of the command and the one I’ve provided is my favorite. It combines high quality audio and video with available English subtitles, including the automatically generated subtitle track (combining these files requires that ffmpeg also be installed using, for example, the Homebrew installation instructions for ffmpeg provided elsewhere on this blog). I’ve found that the action built using this command line, depending on the content and duration of the video, downloads the video very quickly, often before the ad timer expires. There are many, many combinations of command options that may be substituted, of course, if you have familiarized yourself with the capabilities of yt-dlp.
Replace the default contents of the Run AppleScript action with the following text, specifying the correct value for the ExecLoc variable as explained above:
on run {input, parameters} (* Your script goes here *) set ExecLoc to "/opt/homebrew/bin" ##set ExecLoc to "/usr/local/bin" set startyt to ExecLoc & "/yt-dlp" & space & "-f" & space & "\"" & "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4] / bv*+mergeall[vcodec=none]" & "\"" & space & "-o ~/Downloads/'%(title)s.%(ext)s'" & space & "--ffmpeg-location" & space & ExecLoc & space & "--embed-subs --write-auto-subs --restrict-filenames" set entireCommand to startyt & space & input do shell script entireCommand end run
At the top of the Quick Action window in Automator, set Workflow receives current to URLs. You can limit the Quick Action‘s availability to Safari or make it available in any application. You can use the screen window snapshot below as a guide for determining what to use for the remaining settings, or try your own.

Automator Quick Action to download a video from its URL
Save the workflow (I’ve put an underscore at the beginning of its name so that in will be listed at or near the top of Quick Action or Services list when the URL of the displayed video is selected in Safari’s URL field and the contextual click is performed on that link.) When you perform the action, an indeterminate progress indicator (it looks like a spinning gear cog) should appear in your menu bar. When it disappears, you should find the downloaded video in your Downloads folder.