Last active
February 10, 2018 09:23
-
-
Save wanglf/50ae9a7d5b4f4f7eaf518060c3e00a6a to your computer and use it in GitHub Desktop.
youtube downloader wrapper
This file contains 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
#!/usr/local/bin/bash | |
download_video() | |
{ | |
options="-f best --proxy http://192.168.1.51:8123" | |
url=$1 | |
RESULT=1 | |
echo "options: $options" | |
echo "url: $url" | |
count=0 | |
until [ ${RESULT} -eq 0 -o $count -gt 10 ] | |
do | |
/usr/local/bin/youtube-dl $options ${url} | |
RESULT=$? | |
((count++)) | |
done | |
} | |
echo "start downloading video $url ..." | |
download_video $1 | |
echo "finish downloading video $url ..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment