-
-
Save jhall39/d0cea53b4d6c243642409d8e30e317ab to your computer and use it in GitHub Desktop.
script to download all videos of a youtube channel (cron)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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