Downloading YouTube Videos
This guide explains how to download educational videos from YouTube for offline use in the classroom. There are 2 methods available: using a recommended command-line tool or a simple browser add-on.
Before You Begin
Section titled “Before You Begin”Downloading videos can significantly impact your school’s network and computer storage. Follow these guidelines:
- Copyright Guidance: Only download videos that are explicitly permitted for educational use or fall under “Fair Use” policies. Avoid downloading commercial movies or copyrighted music without permission.
- Storage Caution: High-quality videos (1080p and above) use a lot of disk space. Regularly delete old videos from your public folders to ensure there is enough room for new content.
Method 1: Using the Command Line (Recommended)
Section titled “Method 1: Using the Command Line (Recommended)”This method is recommended for its power and reliability. It uses a
command-line tool called yt-dlp.
-
Install
yt-dlpFirst, you need to add the
asdfplugin foryt-dlpand install it. This only needs to be done once. -
Navigate to Download Directory
Change to the directory where you want to save the videos. By default, downloads are saved to the current folder you are in.
-
Download the Video(s)
You can now download a video using its URL. The
-f bestflag tells the tool to download the best available merged video and audio quality.Single Video:
Batch Download (Multiple URLs): You can download multiple videos at once by listing the URLs separated by spaces, or by pointing to a text file containing one URL per line.
-
Restart the Firewall
Important: Once you have finished downloading your videos, you MUST restart the firewall to ensure the computer remains protected.
Method 2: Using a Firefox Add-on (Alternative)
Section titled “Method 2: Using a Firefox Add-on (Alternative)”This is an alternative method for users who prefer a graphical interface. It involves temporarily adding a video downloader tool to the Firefox web browser.
Firefox add-on steps
-
Open Firefox Add-ons
- Open the Firefox browser.
- Click the menu button (☰) in the top-right corner and select Add-ons and themes.
- Alternatively, you can press Ctrl + Shift + A.
-
Find a Downloader Add-on
- In the “Find more add-ons” search box, type
youtube downloaderand press Enter. - Browse the search results and choose an add-on that looks suitable. Read the descriptions and reviews to help you decide.
- In the “Find more add-ons” search box, type
-
Add the Add-on to Firefox
- Once you’ve chosen an add-on, click on it, and then click the Add to Firefox button.
- A permission pop-up will appear. Click Add to confirm.
-
Download the Video
- Navigate to the YouTube video you want to download.
- The add-on will typically add a “Download” button near the video player. Click it and follow the on-screen instructions to save the video file to the computer.
Troubleshooting
Section titled “Troubleshooting”If your download fails, check the following:
- Firewall: Did you run
rsv stop nftablesas theadminuser?yt-dlpcannot connect to YouTube if the firewall is active. - Disk Space: Check if the computer has enough space. You can run
df -h /srv/publicto see available space in the public folder. - Private/Deleted Videos: Ensure the video is public and hasn’t been removed by YouTube.
- Update the Tool: YouTube often changes how they deliver videos. If
downloads consistently fail, you may need to update
yt-dlpby runningasdf install yt-dlp latestagain.