This is a small bash script that tries to determine the correct oEmbed provider depending on the given URL, and then makes a cURL request to their endpoint and returns the response.
git clone https://github.com/ArtBIT/bash-oembed.git
./oembed https://youtu.be/dQw4w9WgXcQ
NOTE: You can pipe the result to a JSON processor like jq:
./oembed https://youtu.be/dQw4w9WgXcQ | jq .title