Last Updated: March 23, 2023

Disclaimer

<aside> ⚠️ These instructions require orchestration between several different tools, including iOS apps (Shortcuts, a-Shell), a programming language (Python), a public code repository (yt-dlp), and a package manager (pip).

This combination results in a large attack surface that will require your vigilance in order to stay ahead of security issues that will invariably arise (for example, Python-based supply chain attacks).

It is recommended that you do not perform these steps unless you are also capable of maintaining the components involved via patching, upgrades, and regularly-monitoring all release notes (using the links above).

</aside>

Introduction

My daughter likes to make hand-drawn animations synchronized to popular music. Her computing device is an iPad Pro, so she is not familiar with personal computers, working with code repositories or the command line interface, etc.

To keep things as simple as possible for her, I previously setup youtube-dl for extracting audio via her iPad, following these instructions outlined on MacStories:

Downloading YouTube Videos on iPad with youtube-dl and a-Shell

Unfortunately, unexpected changes in the headers returned by YouTube have broken this process. Specifically, I was encountering the following error:

[youtube] K4KamfI6JCw: Downloading webpage
ERROR: Unable to extract uploader id; please report this issue on <https://yt-dl.org/bug> . Make sure you are using the latest version; seehttps://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

youtube-dl itself appears to be abandonware and won’t be patched anytime soon. A fork of youtube-dl named yt-dlp does address the above error, so I used the following steps to switch my daughter’s iPad to use the latter instead.

This guide will walk you through how I set this up to be fool-proof for my daughter. Initial setup is complicated, but ongoing use of it is as simple as performing two taps.

While these instructions are specific to downloading audio only, sophisticated users can modify these steps to download actual videos as well.

iPad Setup

Install a-Shell

These steps will install & configure the A-Shell iPadOS app on your iPad, which will later permit you to run yt-dlp from a CLI.

  1. Open the App Store app.
  2. Search for the application “A-Shell”.
  3. Install the A-Shell app.
  4. Reboot your iPad. This will make a necessary “bin” folder show up under “On My iPad” in your Files application (per this tweet).