Creating Video Downloader for MacOS
This is how I created a video downloader on macOS based on a shell script featuring a Graphical User Interface (GUI) for user convenience. The downloader can be launched from Finder in any window & supports URLs from all mainstream sites like Youtube, Twitter, Vimeo, Instagram & 300+ other platforms.
So let’s get started, shall we!
Make sure you have homebrew installed on your Mac. If you haven’t run the following command in your terminal to install it.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Now install a shell script compiler shc with the following command
brew install shc
The core utilities which actually take care of the downloading is the youtube-dl & its fork yt-dlp. Run the following commands to install ‘em both.
brew install youtube-dl yt-dlp
And install the ffmpeg by running
brew install ffmpeg
We also need another utility to display the dialogues, Zenity.
brew install zenity
That makes our environment ready for the next phase.
- Download this gist and save as video-download.sh
- Next run this command to compile the script into binary
shc -f video-download.sh -o YTDL
You will see a binary created in your working directory namely YTDL. Double click on the binary and it will launch the terminal and a dialogue box. Select the desired option & hit okay. Select ‘YTDLP Best Quality’ if you ain’t sure. The new dialogue box will appear to accept the URL. Paste the video URL & hit okay.
Immediately the operation will start and you will see the real time progress in terminal. After the operation ends the destination directory will open and show you the downloaded media.
Let’s prettify the binary & make the setup more convenient.
First of all, we will change the icon of the binary. Right click on it >> Get Info >> A dialogue will show up. At the top left corner you will notice the default icon resembling with a terminal icon.
Download this icon and save it on desktop. Now, drag it over existing icon in the Get Info dialogue to change the default icon. Close the dialogue.
Now open the finder, Hold Cmd key and drag the binary on the Finder toolbar at the top as shown below.
Now you can launch the YTDL on the go inside any folder you are in at any given moment. This is totally optional but can be extremely useful if you dump the video from internet quite often.
That is all for today. If you found this useful consider sharing it with friends. If you land into any issues feel free to reach out.
Reply via mail