Skip to content

Instantly share code, notes, and snippets.

@jonath92
Last active December 3, 2023 20:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonath92/039e998b3d3f6ba4afd5d5c671eaedf1 to your computer and use it in GitHub Desktop.
Save jonath92/039e998b3d3f6ba4afd5d5c671eaedf1 to your computer and use it in GitHub Desktop.
install-update-yt-dlp
# This is a simple script to install yt-dlp and create a cron job to automatically update yt-dlp on a daily basis.
# can be executed with:
# sudo su -c "bash <(wget -qO- https://gist.githubusercontent.com/jonath92/039e998b3d3f6ba4afd5d5c671eaedf1/raw/23542a3aadadf5ba181fb8aff723c27610551abd/install-update-yt-dlp.sh)" root
# install yt-dlp (see https://github.com/yt-dlp/yt-dlp#installation)
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp
# ytdlp requires ffmpeg
sudo apt install ffmpeg -y
# create script for daily update
UPDATE_PATH="/etc/cron.daily/update_yt_dlp"
touch ${UPDATE_PATH}
echo "#! /bin/sh" > ${UPDATE_PATH}
echo "yt-dlp -U" >> ${UPDATE_PATH}
chmod +x ${UPDATE_PATH}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment