Last active
August 29, 2015 14:06
-
-
Save Diederikjh/d35610a3d126b23d5013 to your computer and use it in GitHub Desktop.
Bash script for downloading files off video sharing site YouTube
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
#!/bin/bash | |
if /home/drbergie/scripts/isAfterHoursDownloadTime.py; then | |
echo "starting download" | |
DOWNLOAD_PROGRESS_FILE=/tmp/downloadInProgress | |
LINKS_FILE=/home/drbergie/youtubelinks.txt | |
if [ ! -f $DOWNLOAD_PROGRESS_FILE ] ; then | |
echo "1" > $DOWNLOAD_PROGRESS_FILE | |
cd /tmp/ | |
if [ ! -d yt ] ; then | |
mkdir yt | |
fi | |
cd yt | |
/usr/local/bin/youtube-dl --all-formats -a $LINKS_FILE | |
rm * | |
cd .. | |
rm $DOWNLOAD_PROGRESS_FILE | |
else | |
echo "Skipping download, already in progress" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment