Skip to content

Instantly share code, notes, and snippets.

@jhall39
Forked from iamsilvio/youtube-dl-cron.sh
Created June 5, 2019 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhall39/d0cea53b4d6c243642409d8e30e317ab to your computer and use it in GitHub Desktop.
Save jhall39/d0cea53b4d6c243642409d8e30e317ab to your computer and use it in GitHub Desktop.
script to download all videos of a youtube channel (cron)
#!bin/bash
timeLogFile='/opt/youtube-dl/time.log'
downloadDirectory='/media/cs-video/Youtube-ch/'
read -r lastTime<$timeLogFile
declare -a arr=("" "")
for playlist in "${arr[@]}"
do
mkdir -p $downloadDirectory$playlist
cd $downloadDirectory$playlist
youtube-dl -ciw ytuser:$playlist -o "%(upload_date)s__%(title)s.%(ext)s" --restrict-filenames --dateafter $lastTime --max-quality FORMAT --write-info-json --write-description --write-thumbnail
done
echo $(date +%Y%m%d) > $timeLogFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment