Install YouTube DL.py to Download YouTube Videos to Your PC
Youtube-dl is a small command-line program to download videos from YouTube.com and a few more sites. It requires the Python interpreter, version 2.x (x being at least 5), and it is not platform specific. It should work on your Linux, Windows and Mac OS X system. It is released to the public domain, which means you can modify it, redistribute it or use it however you like. This article will cover the installation of the Python program script, youtube-dl in order to download YouTube videos directly to your PC.
- Note: This article will cover the installation of the youtube-dl python script on Microsoft Windows and Ubuntu operating system.
Steps
- Download python and python script. This is necessary in downloading YouTube to your PC device.
- Make sure you select the correct version of Python for your system architecture either 32-bit or 64-bit. If your PC has 4GB of memory or more it is most likely a 64-bit computer running a 64-bit operating system.
- You can download Python from here Download Python.
- Change into the Downloads directory on your Windows PC.
- Click on the Python executable in order to install Python to your system. Once Python is installed onto your computer, you also have the option of installing python for use at the command line prompt in Windows by adding the location of Python installed on your system. For example, the PATH may or may not be.
- ;C:\Python27;
- You will need to obtain the youtube-dl python script called youtube-dl.py. You can obtain the youtube-dl script from here: youtube-dl.
- Make sure you download and save the youtube-dl python script as youtube-dl.py
- Once the Python script is downloaded you will need to configure your Windows system to run the youtube-dl.py Python script from the Windows command line.
- First, change into your C: drive in Windows and create a directory
- Open a command line prompt in Windows
- Type/Copy/Paste: cd /
- This should change you into the C: drive, if not make sure you are in the C: drive
- Type/Copy/Paste: mkdir youtube-dl\bin
- Create a directory to hold your youtube-dl Python script
- Type/Copy/Paste: cd Users\"your_user_name"\Downloads
- To change into your Downloads directory
- Type/Copy/Paste: copy youtube-dl.py to C:\youtube-dl\bin
- You may need to be Administrator on your system in order to create directories and copy files to system folders.
- In order to use the youtube-dl python script from the Windows command line you will have to edit and add the following line to your system PATH environment variables ;C:\youtube-dl\bin;
- This will inform the Windows system to the location of the youtube-dl.py Python script. To edit your Windows system PATH environment variables you will have to perform the following steps.
- Click on the Start Button.
- Click on Control Panel.
- Click on System and Maintenance.
- Click on System.
- Click on Advanced System Setting.
- Click on Environmental Variables.
- Click on PATH to edit system wide variables.
- Click OK when finished.
- Type/Copy/Paste: ;C:\youtube-dl\bin;
- Make sure you carefully edit your Windows System PATH and include the semi-colon ; before the letter C
- Once this task is complete you should be able to run the youtube-dl.py python script from the Windows command line prompt in any location.
- For example, to download a YouTube video you would highlight/copy/paste the YouTube URL in the Windows terminal. It would look like this,
- Type/Copy/Paste: youtube-dl.py https://www.youtube.com/watch?v=giNdyLY46Mo&feature=related
- It will download the YouTube FLV or MP4 video to your PC. A correctly downloaded YouTube video file will have the following file format
- giNdyLY46Mo.flv or giNdyLY46Mo.mp4, look for those file extensions which end in *.flv and *.mp4 and use the VLC multimedia player to play them.
- So in order to download a YouTube video to you PC you would:
- Type/Copy/Paste: cd Videos
- Change into you Videos directory or wherever you store videos or multimedia on your PC and perform the following tasks.
- Type/Copy/Paste: youtube-dl.py “Paste the URL of the YouTube video here”
- The YouTube video should download into your videos directory or whatever directory you are in when you issue the youtube-dl.py command.
- Type/Copy/Paste: cd Videos
- Youtube videos are usually stored in the FLV or MP4 formats and you can use a media player such as VLC player to view your videos. You can install the VLC multimedia player by going to the following link Download the VLC Player.
Ubuntu Linux Instructions:
- To install Python on your Ubuntu Linux, issue the following command:
- Type/Copy/Paste: sudo apt-get update
- Type/Copy/Paste: sudo -s apt-get install python
- This will install Python to your Ubuntu Linux system
- Type/Copy/Paste: sudo -s apt-get install youtube-dl
- This will install the youtube-dl script to your system
- So in order to use youtube-dl on Ubuntu Linux, issue the following command, and highlight/copy/paste the URL of the YouTube video:
- Type/Copy/Paste: youtube-dl “Paste the URL of the YouTube video here”
- For example, the usage of the youtube-dl python script on Ubuntu Linux would be used as the following example to download a YouTube video.
- Type/Copy/Paste: youtube-dl https://www.youtube.com/watch?v=giNdyLY46Mo&feature=related
- It will download the YouTube video to which ever directory you are currently in when you run the youtube-dl command.
- A correctly downloaded YouTube video file will have the following file format
- giNdyLY46Mo.flv or giNdyLY46Mo.mp4 look for those file extensions which end in *.flv and *.mp4 and use the VLC multimedia player to play them.
- YouTube videos are usually stored in the FLV or MP4 formats and you can use a media player such as VLC player to view your videos. You can install the VLC multimedia player by going to the following link Download VLC multimedia player or using the following commands on Ubuntu Linux.
- Type/Copy/Paste: sudo apt-get update
- Type/Copy/Paste: sudo -s apt-get install vlc
- This will install the VLC multimedia player to your Ubuntu Linux system.
Tips
Updating
- From time to time, you may need to upgrade the youtube-dl python script by issuing the following commands below. For example, if you find that youtube-dl is installed correctly and when you run the command you are not able to download the YouTube video. This means you need to upgrade youtube-dl on your PC by issuing the following command:
- Type/Copy/Paste: youtube-dl -U
- For Windows issue the above command to update the youtube-dl python script on Windows you have to be Administrator
- Type/Copy/Paste: sudo apt-get update
- Type/Copy/Paste: sudo -s youtube-dl -U
- For Linux issue the above command to update the youtube-dl python script on Ubuntu Linux you have to be root
- Type/Copy/Paste: youtube-dl -U
Warnings
- May affect computer
- Downloading monetized videos (videos with ads at the start) will mean that when you watch the video offline, the channel that posted the video will not receive any money. Take this into consideration when downloading videos.