How to download YouTube videos with youtube-dl on iPad and iPhone

August 2, 2021 | Reading time 3 minutes

Youtube-dl is one of my favorite utilities on Mac and Windows and I missed this on the iPad for downloading YouTube videos. But, not anymore. Recently I discovered how to install Youtube-dl on the iPad for downloading videos and audio files. The set-up requires a few steps, but once done, it works better than it does on a PC or Mac.

To make this work, you need the Shortcuts app and a-Shell or a-Shell mini.

Step 1: download the Shortcuts app and a Shell

Go to the App Store and download [Shortcuts] and [a-Shell mini]. The latter will probably do for most people. If you need to compile C, a TeX engine or numpy and matplotlib, than you download [a-Shell]. In this blog, I just use the name a-Shell and add the Shortcut for both apps. The full version of a-Shell takes up to 700 MB more storage on your iPhone and iPad.

Step 2: set-up a-Shell for youtube-dl

Setting up a-Shell consists of two steps. The first is installing youtube-dl on the iPad or iPhone through a-Shell:

  1. Open a-Shell.
  2. Install youtube-dl package by entering the command pip install youtube-dl and hit Enter/Return.

The script runs just like it does on a regular PC or Mac and youtube-dl is now installed on your iPad or iPhone.

Next, we need to add the ffmpeg command:

  1. First we download it from Github:
    1. Use this link for a direct download of ffmpeg: https://github.com/holzschu/a-Shell-commands/releases/download/0.1/ffmpeg.wasm.
    2. This link brings you to the Github page with more commands: https://github.com/holzschu/a-Shell-commands.
  2. Open the Files app and go to the a-Shell folder. This can be iCloud or local. In this folder, create a new folder and name it “bin”.
  3. In the Files app go to the folder where the file is downloaded. Select the file and move it to the bin folder we created in the previous step.
The youtube-dl with shortcuts steps in the Shortcuts app.

You can now use youtube-dl or create an app Shortcut. The latter is step 3 and makes using youtube-dl on the iPhone and iPad a breeze.

Step 3: add the youtube-dl app Shortcut

The Download Media Shortcut has three main steps:

  1. Select what the type of content. Audio or Video. For this a List is added and the Choose from option.
  2. An If statement. Based on the chosen file type it decides whether it puts the downloaded file in the Audio folder or Videos folder. It also creates these folders in the a-Shell folder if they don’t exist.
  3. Executing the shell command (a-Shell).

You run the Shortcut from the share menu, e.g. on YouTube, like you’re used to.

Use the Download media shortcut from the Share sheet in YouTube.

Downloads

  1. Download Shortcut for a-Shell mini.
  2. Download Shortcut for a-Shell.
  3. Download Shortcuts app
  4. Download a-Shel mini
  5. Download a-Shell