Skip to content

Instantly share code, notes, and snippets.

@hub23
Last active September 29, 2018 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hub23/d2224c2b4176dfb1a5bf28a6257f8a53 to your computer and use it in GitHub Desktop.
Save hub23/d2224c2b4176dfb1a5bf28a6257f8a53 to your computer and use it in GitHub Desktop.
youtube-dl wrapper for mp3 downloads
#!/bin/bash
ydlBaseString='youtube-dl --no-call-home --min-sleep-interval 0.5 --max-sleep-interval 2 --prefer-ffmpeg --extract-audio --ignore-errors --audio-format mp3 -o "%(title)s.%(ext)s"'
ydlURL="$ydlBaseString $1"
ydlList="$ydlBaseString --batch-file=$1"
if [[ $1 =~ ^http.* ]] ;then
eval $ydlURL
elif [[ $1 ]] ;then
eval $ydlList
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment