Skip to content

Instantly share code, notes, and snippets.

@hernantz
Created April 8, 2016 23:04
Show Gist options
  • Save hernantz/41112519c4db8525479f480db8f7b947 to your computer and use it in GitHub Desktop.
Save hernantz/41112519c4db8525479f480db8f7b947 to your computer and use it in GitHub Desktop.
play any song from youtube
# play <some song name>
function play {
youtube-dl --default-search=ytsearch: \
--youtube-skip-dash-manifest \
--output="${TMPDIR:-/tmp/}%(title)-s%(id)s.%(ext)s" \
--restrict-filenames \
--format="bestaudio[ext!=webm]" \
--exec=mplayer -vvv "$*"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment