Download YouTube Videos or Extract MP3s on IPhone Using A-Shell and Yt-dlp

by andreimagic in Living > Life Hacks

27 Views, 0 Favorites, 0 Comments

Download YouTube Videos or Extract MP3s on IPhone Using A-Shell and Yt-dlp

30 April 2025

If you want to download YouTube videos or extract MP3 audio directly to your iPhone, you can do so using the free a-Shell app and the open-source yt-dlp tool. This method works without jailbreaking and provides flexibility similar to a desktop terminal.

Tips

  1. Use only for personal, fair-use downloads.
  2. Some videos may be restricted due to region or age limitations.
  3. Keep yt-dlp updated by re-downloading it from GitHub occasionally.


Supplies

IMG_8201.png

Sources:

  1. a-Shell: https://apps.apple.com/app/id1473805438
  2. yt-dlp: https://github.com/yt-dlp/yt-dlp
  3. iPhone or iPad: Requires iOS 14.0 or later

Installing Yt-dlp in A-Shell

IMG_8202.png
IMG_8203.png
IMG_8204.png
  1. Install the a-Shell app
  2. Open the App Store and install a-Shell, a local terminal emulator for iOS.
  3. Launch a-Shell and set up the directory
  4. Open the app and run the following commands one by one:
mkdir ~/Documents/bin
cd ~/Documents/bin
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O
chmod +x yt-dlp
cd ~/Documents
  1. Test yt-dlp functionality
  2. Try downloading a video:
yt-dlp "https://www.youtube.com/watch?v=G1oxqQj8tuI"
  1. Try extracting MP3:
yt-dlp -x --audio-format mp3 --audio-quality 0 -P ~/Documents/ "https://www.youtube.com/watch?v=G1oxqQj8tuI"
  1. Your files will appear in the a-Shell directory under Files > On My iPhone > a-Shell. If playback fails in the default player, try using VLC or IINA.


Creating an IOS Shortcut to Automate Downloads

IMG_8200.png
IMG_8196.png
IMG_8195.png
IMG_8197.png
IMG_8198.png
IMG_8199.png

Open the Shortcuts app and create a new shortcut

Add an input step

  1. Add "Ask for Input", set the prompt to YouTube URL.

Add a menu to choose download type

  1. Add "Choose from Menu" with two options:
  2. Extract MP3
  3. Download Video

For "Extract MP3" option

  1. Use the "Execute Command" action (becomes available with the installation of a-Shell):
yt-dlp -x --audio-format mp3 --audio-quality 0 -P ~/Documents/ "Ask for Input"

For "Download Video" option

  1. Similarly (note that "Ask for Input" is a Selectable Variable):
yt-dlp -P ~/Documents/ "Ask for Input"

Finish the menu and save your shortcut

  1. Label it something like "YT-DLP"

Optionally add Home Screen widget "Shortcuts" to have a quick way of accessing your latest shortcuts!