ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.42k stars 10.04k forks source link

skip already downloaded files - any solution? #1010

Closed tottitu closed 8 years ago

tottitu commented 11 years ago

hi, first of all sorry for my english but i'm italian and u know..we are not the best with foreign languages. my problem: i have to extract the audio from every video in a youtube channel and i want to delete the video files. i will run a cron job every week with this script:

$ youtube-dl -o '/MY/FOLDER/%(uploader)s/%(upload_date)s - %(title)s.%(ext)s' ytuser:YOUTUBECHANEL --dateafter "date +"%Y%m%d" -d "8 day ago"" -i -c -x --audio-format best --audio-quality 0

but when i run this script it appears that phyton have problems with the date. so, what should i do? tnx

phihag commented 11 years ago

Sorry, I'm not sure what you do expect and what is wrong - by default, youtube-dl deletes the video when you specify --extract-audio/-x. Notably, your dateafter specifcation is literally a string. Most likely, you want

youtube-dl ... --dateafter $(date +"%Y%m%d" -d "8 day ago")