Skip to content

Instantly share code, notes, and snippets.

@wanglf
Last active February 10, 2018 09:23
Show Gist options
  • Save wanglf/50ae9a7d5b4f4f7eaf518060c3e00a6a to your computer and use it in GitHub Desktop.
Save wanglf/50ae9a7d5b4f4f7eaf518060c3e00a6a to your computer and use it in GitHub Desktop.
youtube downloader wrapper
#!/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