How to download video and audio streams from virtually any website with youtube-dl

It is possible to download video and audio streams from streaming platforms, using third-party tools. You need these tools if the streaming site does not officially support downloading. This article focuses on the powerful tool named youtube-dl. It explains the compatible graphical user interfaces Downline and YDL-UI. They make it easy to download videos (or audio) from sites like YouTube, Facebook or Vimeo. One important step is to regularly update youtube-dl, which is also discussed.

Introduction

In some scenarios, streaming a video or a song is not feasible or practical. Examples are long train rides, boat trips or flights. But even at home you may want to watch a video with a large file size, in places your WiFi simply won’t reach, e.g. far out in your garden, or in the basement. There are also cases where you may need the video as a file to open and process it. For instance, a musician who uses a file-based tool to transcribe audio tracks to get a music sheet.

Most streaming provider websites don’t want you to download resources. They prefer to keep you on their sites, for tracking purposes, and to feed you more content. While doing so, you’re supposed to click on ads. Consequently, there are no official “Download” buttons to be found anywhere. There are of course many third-party solutions, such as the Video DownloadHelper browser add-on, or converter websites (like Y2mate) which convert videos for you. Unfortunately, these solutions are often either shady, or produce poor results (e.g. video where audio is missing), or don’t work at all.

youtube-dl to the rescue

youtube-dl is a command-line based tool that downloads video and audio from YouTube, but it also supports many many many more sites, like Dailymotion or Vimeo. By itself, it is not so easy to use, especially for “laymen”. Being a command-line based tool, you need to be familiar with typing commands manually. youtube-dl also needs other dependencies to work, like FFmpeg.

Fortunately, there are graphical user interfaces, which ship with youtube-dl included. These graphical tools not only make using youtube-dl much easier, but they also come with an auto-update functionality which updates youtube-dl and its dependencies with the click of a button. This is handy, because youtube-dl is updated frequently. I’ll focus on macOS and Windows, but parts of the macOS instructions should also transfer to Linux.

Getting set up on macOS

On macOS we can use Downline, which also works on Windows and Linux. You set it up as follows:

  1. Download the “macOS Portable” package from the website.
  2. Click on the downloaded file (7z archive), which causes macOS to extract it.
  3. In your Download folder, you now see the “Downline” app. The attempt to open it using a double click won’t work, because the app is not signed by the developer. This makes it (unwarrantedly) appear as “not trustworthy” by macOS. To open it anyway, Command-Click it and select Open. You still have to confirm that you want to open it. From now on, you can launch the app by a simple double-click, though.
  4. Once the app is open, go to the settings (cog wheel in the top left corner) and click on Browse to set up the download location. When the permission prompt asks you (“Downline” would like to access files …), click on OK to confirm.
  5. In that same settings dialog, you may want to change the Video Format to mp4, which is the most widely supported container format.
  6. Go to the About tab of the settings dialog and click Update Youtube-dl to update the youtube-dl version shipped with Downline to the latest version.
Downline graphical user interface for youtube-dl

Getting set up on Windows

On Windows you can use Downline (as presented above in the macOS section), or YDL-UI.

If you use Downline, just download the Windows setup (or portable) from the website, start it, and follow steps 4-6 from the macOS instructions above.

Another great alternative is YDL-UI, which only works on Windows, though. Set it up as follows:

  1. Download the latest release from here (click on the “YDL_UI_v…_Portable.zip” link).
  2. Open the program (YDL-UI.exe), click Settings, go to Download and set up the Default Download Directory.
  3. Go to Binaries and click the Update button to update youtube-dl.
YDL-UI, a graphical user interface for youtube-dl on Windows

Download videos

How to download a video or audio file depends on the website that hosts them.

Website supported by youtube-dl

If the name of the website is listed here, you can simply copy the URL from your browser’s address bar, and then paste it into Downline or Y-DL. Alternatively, you can right-click into the video canvas, which typically opens a pop-up menu with an entry like “Copy video URL”. The steps while pasting depend on your used tool:

Click the top-right + button, which displays the URL currently in your clipboard. Press the + button again. Shortly after, an entry should be shown, which allows you to configure the desired resolution (where 1080 refers to the number of pixels on the vertical axis, i.e. 1080 means 1920×1080 pixels). You can also limit the download to audio-only, by clicking on the music notes icon. To start the download, click on the play icon that appears when you hover over the entry with your mouse pointer.

Click Download -> Add URL, paste the URL into the URL field. Click the Audio only checkbox if you only need audio, then click the Add button for the download to start.

Website not directly supported by ydl

Even if the website is not officially supported by youtube-dl, it is often possible to extract streaming playlist files (m3u8 files) or streaming URLs which youtube-dl does support. I recommend this Firefox stream detector add-on. I was unable to find an equivalent for Chrome or Chromium-based browsers. Although there are Chrome add-ons with names like “Stream Video downloader” or “HLS Downloader”, these often only download the video component, and the audio track is missing. If you don’t have Firefox and you don’t want to install it either, you can use a portable Firefox installation, like this one, with the stream detector add-on.

If the Stream Detector add-on does not find any stream URLs on the site, you can try the Video Downloadhelper add-on instead.

Keep youtube-dl updated

It is common that downloading video or audio files will stop functioning a few weeks or months after you set up your download tool, be it YDL-UI or Downline. This is because the services hosting the videos continuously change their technological protocols. The developers of youtube-dl usually fix new incompatibilities quickly. However, you’ll have to update youtube-dl explicitly. Whenever your downloads fail, update the youtube-dl tool within YDL-GUI or Downline, which often fixes the problem. See above, look at the last step of the respective setup instructions I provided for YDL-UI or Downliner.

For those who prefer the command line

If you’re comfortable using the command line, then this is my suggestion for getting your system set up quickly:

On Windows, simply download YDL-UI as described above. You’ll find the youtube-dl.exe tool in the “bin” sub-directory of the YDL-UI folder.

On macOS, I suggest that you install Homebrew, and then install youtube-dl using the brew install youtube-dl command. If you don’t have FFmpeg installed yet, you can also get it via brew, using brew install ffmpeg. The advantage is that this gets the latest FFmpeg version and you can update it easily (brew update ffmpeg). The disadvantage is that brew’s FFmpeg installation takes a long time, because it installs a lot of other dependencies, see here. Alternatively, you can just download a static build of FFmpeg for macOS from the official homepage. To force youtube-dl to use that static FFmpeg binary, you need to move it to /usr/local/bin. In one command, getting and installing the static FFmpeg build can be done like this:

curl -o ffmpeg.zip https://evermeet.cx/ffmpeg/ffmpeg-4.2.2.zip && unzip ffmpeg.zip && mv ffmpeg /usr/local/bin/Code language: Bash (bash)

To use youtube-dl, the most simple command is youtube-dl URL, which will attempt to download the video to the current directory in the highest-possible quality. If you want to only download specific video/audio streams in particular quality, use youtube-dl -F URL to get a list of formats, followed by youtube-dl -f x+y URL. Argument x is the video format code and y the audio format code. Note the difference between -F and -f, because youtube-dl’s parameters are case sensitive! You can learn more about the command line arguments here.

Conclusion

With the tools I mentioned in this article, it becomes easy to download content – assuming that you are legally allowed to do so. The presented tools are more reliable than many other methods, such as converter websites, due to the auto-update functionality. You should also expect updates for graphical tools themselves (not just the included youtube-dl binaries) from time to time. I recommend that you also apply those updates. You will get new features, and this may also update the other dependencies of youtube-dl, such as FFmpeg, which is typically not updated when updating just youtube-dl.

2 thoughts on “How to download video and audio streams from virtually any website with youtube-dl”

Leave a Comment