Skip to content

Instantly share code, notes, and snippets.

@roblight
Last active August 29, 2015 14:12
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save roblight/d4ca522a660de3a7d1a4 to your computer and use it in GitHub Desktop.
#!/bin/sh
### Run this script via a cronjob every (every minute or so) on a server that has access to your dropbox.
### You must install youtube-dl (http://rg3.github.com/youtube-dl/) for this to work.
queue_files_dir=~/Dropbox/IFTTT/youtube-dl
queue_files="$queue_files_dir"/*.txt
output_dir=/Volumes/Internal\ HD/Files/Videos/YouTube
shopt -s nullglob
for queue_file in $queue_files; do
video_url=`cat "$queue_file"`
echo "processing $queue_file: $video_url"
mv "$queue_file" "$queue_files_dir/processed"
youtube-dl -f 18 -o "$output_dir/%(title)s-%(id)s.%(ext)s" "$video_url"
# youtube-dl -q -o "$output_dir%(stitle)s.%(ext)s" "$video_url"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment