Skip to content

Install yt‐dlp

Daniel Neto edited this page Sep 22, 2023 · 1 revision

youtube-dl Is Outdated

The youtube-dl tool, while once popular for downloading videos from YouTube and other platforms, has seen a slowdown in updates and may not work reliably with newer changes to these platforms. As an alternative, the community has developed a more up-to-date and feature-rich tool called yt-dlp, which is seen as an improved fork of youtube-dl.

If you've been using youtube-dl and have been facing issues, it's recommended to switch to yt-dlp for a better experience.

How to Install yt-dlp on Ubuntu:

  1. Update System Repositories: Before installing any new software, it's a good practice to update the system's repositories to ensure you're accessing the latest versions of packages.

    sudo apt update
  2. Install yt-dlp: yt-dlp can be installed using pip, Python's package installer. If you don't have pip installed, you can install it using the package manager:

    sudo apt install python3-pip

    Once pip is installed, you can install yt-dlp:

    sudo pip3 install -U yt-dlp
  3. Updating yt-dlp: Since yt-dlp is installed via pip, you can easily update it using the following command:

    sudo pip3 install -U yt-dlp

Setting up Daily Auto-Update for yt-dlp:

  1. Open Crontab: To edit the crontab for the current user, use the following command:

    crontab -e
  2. Add Daily Update Command: At the end of the file, add the following line to ensure yt-dlp updates every day at a specific time (e.g., 2:30 AM):

    30 2 * * * /usr/local/bin/pip3 install -U yt-dlp
    
  3. Save and Exit:

    • If you're using the nano editor (the default for many systems): Press CTRL + X to close, then press Y to confirm the changes, and finally press Enter to save.
    • If you're using the vim editor: Press Esc, then type :wq and press Enter.
  4. Verify the Cron Job: To make sure your new cron job has been added, you can list the crontab entries with:

    crontab -l

You should see your new command in the list. This will ensure that yt-dlp is updated daily at the specified time.

Note: The exact path to pip3 might differ based on how it was installed and your system setup. The provided path (/usr/local/bin/pip3) is a common one. If pip3 is located elsewhere, you might need to adjust the path in the cron job accordingly. You can find the path using which pip3.

Clone this wiki locally