Created
December 12, 2014 10:28
-
-
Save twocity/5692e69c2a935de21cc1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
### 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