Last active
January 27, 2025 04:59
-
-
Save iamsilvio/0c39949c3bdb0105d6a9 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