Skip to content

Instantly share code, notes, and snippets.

@twocity
Created December 12, 2014 10:28
Show Gist options
  • Save twocity/5692e69c2a935de21cc1 to your computer and use it in GitHub Desktop.
Save twocity/5692e69c2a935de21cc1 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 --write-sub "$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