Skip to content

Instantly share code, notes, and snippets.

@sheedy
Created April 26, 2014 05:03
Show Gist options
  • Save sheedy/11312158 to your computer and use it in GitHub Desktop.
Save sheedy/11312158 to your computer and use it in GitHub Desktop.
### 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.
#!/bin/bash
QUEUE_DIR=~/Desktop/Dropbox/IFTTT/youtube-dl/*.txt
VIDEO_DIR=~/Desktop/Dropbox/youtube/
shopt -s nullglob
for queue_file in $QUEUE_DIR
do
video_url=`cat "$queue_file"`;
echo "$queue_file : $video_url";
mv "$queue_file" "${queue_file}.part";
youtube-dl -q -o "$VIDEO_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