How to download videos from websites in IOS devices using ish

This post shares a small tip for those who would like to download videos from websites like *Youtube* on their *IOS devices*, using a Linux shell emulator *ish*.
How to download videos from websites in IOS devices using ish

1. What’s this about?

The default browser Safari in IOS devices (iPhones, iPads) does not allow you to download videos from websites like Youtube.

IOS devices also have restrictions such that browser apps do not have the full set of functionality that is available to their desktop counterparts. For instance, you don’t get access to plugins/extensions in the IOS version of Firefox.

There might be 3rd-party apps that provide video-downloading functions. I didn’t test out such apps myself. If you find one that works well please let me know in the comment down below.

This post will share one method that is a bit convoluted: the 3rd party app that we are going to use – ish – is not a dedicated video downloader, but a Linux shell emulator. In a nutshell, ish emulates a Linux shell environment in iPhone/iPad, in which we can run a command-line toolyoutube-dl – to download the videos from websites. The downloaded videos can be optionally converted to mp4 format, and can be accessed from the Files app in IOS.

2. How to do?

2.1. Install the ish app

Search for ish in app store (see Figure 1 below), and install it. At the time of writing, it is on version 1.2.3, and requires IOS 11.0 or later for iPhone and iPad.

ish_app_store2.png

Figure 1: Ish app in App Store.

2.2. Install packages in ish

Once ish is installed, launch it, and you would be greeted with the following message:

Welcome to Alpine!

You can install packages with: apk add <package>

You may change this message by editing /etc/motd.

Alpine is a light-weight Linux distribution on which ish is based. Therefore, it also uses Alpine’s package manager – apk.

The Github page of ish recommends running apk update to fetch the Alpine repository before attempting to install packages, much like the apt get update command in Ubuntu.

So we run apk update, followed by:

  • apk add ffmpeg: to install the ffmpeg package, for video/audio format conversions.
  • apk add youtube-dl: to install the youtube-dl package, for downloading videos.

See Figure 2 for a screenshot of the process.

ish_install_youtube_dl.png

Figure 2: Updating package list and installing ffmpeg and youtube-dl using apk.

2.3. Open a video in the browser and copy the URL

Now navigate in the browser app to a video page (for example Figure 3), and copy the page URL to clipboard.

ish_get_video_url.png

Figure 3: Open a Youtube video and copy the URL.

2.4. Download the video in ish

Now switch back to ish. Run the following command to download the video:

youtube-dl <URL>

where <URL> is the URL you just pasted from the browser. Tip: click the Paste button above the keyboard to paste texts into the shell.

This will start downloading in a little while (it is a known issue that youtube-dl has a long start-up time inside ish).

ish_downloading.png

Figure 4: Downloading in progress.

2.5. Get to the downloaded video in the Files app

Once the video downloading is finished, switch to Files in your IOS device, navigate to the ish folder, and then the root folder, you should be able to see the newly downloaded video. From there, you could move that to the camera roll, or do other actions on it.

ish_download_in_files.jpg

Figure 5: Downloaded video in Files.

2.6. More youtube-dl options

Youtube-dl is a very versatile tool with a whole set of custom options available.

The above run command doesn’t have any options, so by default youtube-dl will try to fetch the best quality video for you.

This may not be necessary, if you intend to watch it on a small iPhone screen. So you could specify what format you would like to download. The option I tend to use is

youtube-dl -f worst <URL>

so it downloads the worst video and audio quality version. There are a number of options, which you see by running the man youtube in ish’s shell.

3. Summary

This post shares a small tip for those who would like to download videos from websites like Youtube on their IOS devices.

This is achieved by running the youtube-dl tool in a Linux shell emulator, ish.

Advantages of this approach include:

  • The ish app is free and very light-weight (only 5.8 M).
  • The youtube-dl tool is very powerful and supports many video platforms, including Youtube, bilibili. For a complete list, see here.
  • The downloading process can run in the background while you switch away from the ish app.

Downsides of this approach include:

  • One needs to type of a bit of commands in a Linux shell, which might be a bit of challenging for those not comfortable with the command line.
  • The ish version of youtube-dl is a bit slow.

Lastly, ish is a very interesting app that provides quite some Linux tools to an IOS user. But, it comes with its limitations in that many things that work in a normal Linux environment won’t work in ish, and many things that are supposed to work can be very slow. I’m still messing around with ish to see what other interesting/useful things it can do. If you have any interesting ideas please share in the comment section below.

Author: guangzhi

Created: 2022-09-26 Mon 17:59

Validate

Leave a Reply