YouTube is full of useful and interesting videos. If you need to have one of those videos on your iPad for some reason, such as to view it when you don't have Internet access or to use it as a part of a presentation, it used to be that there was no easy way to do so. But now, you can do so using the free app called a-Shell and two other free programs. This post gives you all of the steps for doing so. I realize that this post may look complicated at first, but I promise you that these steps are simple to follow.
But first, some kudos and a caveat. I first learned about this tip from a post by Federico Viticci on MacStories. He linked to a post by Greg Godwin on his website NonProfit Workflows, a website with advice for working in a non-profit organization. Although Greg's post provides instructions, I modified his instructions for this post in a way that I think makes them easier to understand and follow. And finally, please note that you should only download a video from YouTube if you have an appropriate reason and permission to do so.
With that behind us, here are the step-by-step instructions. These instructions assume that you are doing this on an iPad, which has a larger screen and thus is better for viewing and working with a video, but I suppose these steps would also work on an iPhone.
The a-Shell app
The first thing that you need to do is download the a-Shell app from the App Store. This free app provides a text-based terminal window on your iPad — essentially taking your modern iPad and giving it the capabilities of a computer from the 1970s. Here are the first few steps to get this app and get it configured correctly.
1. Click here to download a-Shell app by Nicolas Holzschuch.
2. Open the Settings app on your iPad and scroll down on the left until you see the a-Shell app listed; tap on that. On the right, in the section called ALLOW A-SHELL TO ACCESS, make sure that Document Storage is set to On My iPad.
Download youtube-dl and FFmpeg
Next, we are going to download two free, command line, cross-platform, open-source software programs that can be used to work with video, audio, and other multimedia files and streams. With a terminal like a-Shell on your iPad, you can use this software on your iPad instead of a computer.
1. Open the a-Shell app. The first time you do so, the app will ask if you want notifications. You don't need to allow notifications for this project.
2. Type the following exactly as it appears and tap return:
pip install youtube-dl
"pip" is a package manager for the programming language Python. By typing that command, you are telling a-Shell to install the youtube-dl program. After you tap return, a-Shell will install the software and then tell you that it is successful.
3. In Safari on your iPad, click on this link to download FFmpeg from the GitHub page: https://github.com/holzschu/a-Shell-commands/releases/download/0.1/ffmpeg.wasm
[That link works great right now, but if for some reason it stops working in the future, go to this page to find the download link.]
Your iPad will ask "Do you want to download "ffmpeg.wasm"? and you should tap Download to do so. The download icon at the top of the Safari app will show you that the file is being downloaded to whatever the default download location is on your iPad.
Use the Files app
Next, you want to open up the Files app on your iPad. The left side of the app will list all of your locations — things like iCloud Drive, On My iPad, Dropbox, etc. Tap on On My iPad and you will see a list of folders on the right, folders that correspond to apps installed on your iPad. Near the top, you will see a folder for a-Shell. Tap that folder to open it.
Once that folder is open, tap the folder+ icon at the top right to create a new folder within the a-Shell folder. The Files app will do so and will give you the opportunity to name the folder. Call it: bin
Next, you want to move the FFmpeg app into that folder called "bin" that you just created. If you tap the Downloads tab on the left of the Files app, you will see the file called ffmpeg.wasm. Hold your finger down on that file for a second and a pop-up window will appear. Select "Move" — the third option. That will open up a window for you to select the destination. Tap On My iPad, then tap a-Shell, then tap bin, then tap Copy.
Note that you won't need to directly use the FFmpeg app for the rest of this project. You simply need to have it saved in the "bin" folder because the youtube-dl app is going to take advantage of it from within the a-Shell app.
Now, you are ready to go. You won't have to follow any of the above steps again. The next time that you are ready to download a video, just go to the next set of steps:
Use youtube-dl to download a video
Open the a-Shell app and type in a command to download a video from YouTube. The basic structure of the command that you will use is very simple, just the command "youtube-dl" followed by the URL of the YouTube video that you want to download. Note, however, that using this command will download a video in the .mkv video file format, which the iPad doesn't know how to play unless you install an app that can do so.
A better approach is to tell youtube-dl to download the video in the .mp4 format, which the iPad can handle with no problems. And to do that, you add the following just before the URL: -f '(mp4)'
So to give you a specific example, let's say that you want to download the video that I shared last year when I reviewed the Catalyst Waterproof Case for iPhone Xs. My review included a video that I posted to YouTube that I took using this waterproof case while I was in Hawaii. The short video includes some fun footage of turtles and tropical fish underwater. The YouTube link for that video is https://www.youtube.com/watch?v=aCqAKXpDIbA
So to download this video and convert it to .mp4 format, you would type the following in the a-Shell app:
youtube-dl -f '(mp4)' https://www.youtube.com/watch?v=aCqAKXpDIbA
If you want, you can copy the above text, open the a-Shell app, hold down on the flashing cursor for a second, and then select the paste function to save you the trouble of typing it.
The youtube-dl program will download the video and alert you to the progress while it is doing so. This one is a short video, so the process will be very quick.
Use your downloaded video
The video downloaded from within the a-Shell app is located in the a-Shell folder on your iPad. So open the Files app, tap On My iPad on the left, tap the a-Shell folder, and there is your video. You can tap it if you just want to play it — and since it is downloaded, you can play it even if you are in Airplane mode. Or, you can hold down your finger on the filename for a second and tap Share on the pop-up menu. From there, you can send the file to another app, or just tap Save Video to download it to your Photos app. Once it is in your Photos library, just about any other app will be able to access it. For example, you can put it in a Keynote video. Or you can use the iMovie app to take a clip from this video and add it to some other video.
Conclusion
Using a terminal window on an iPad may seem like the most un-iPad thing that you can do with an iPad. However, it gives you the ability to take advantage of free, open-source software like youtube-dl. After following all of the above steps, it will be quick and easy for you to download a YouTube video in the future. Just open the a-Shell app, and type in the command with the link to the video. That's it.
Thanks again to Greg Godwin and Federico Viticci for making me aware of this great tip. And thanks to Nicolas Holzschuch for the powerful a-Shell app.