Sorry for the delay in response...been busy with family for the holidays and such.
Actually I just made up the .flv extension as an example for what I was looking for.
As far as retrieving the youtube video id, I've been parsing an xml file of a youtube video retrieved using a web API from the music information company "the EchoNest" (they provide nice information related to bands...music video links, etc). Here is the page where I used the API to retrieve the xml file (I modified the example a bit): http://developer.echonest.com/docs/v4/artist.html#video
Here is the modified example: http://developer.echonest.com/api/v4/artist/video?api_key=N6E4NIOVYMTHNDM8J&name=radiohead&format=xml&results=1
The xml file returns the standard youtube url of a radiohead concert (http://www.youtube.com/watch?v=h_eBqlFpnNY
) as well as the video id (81722f06b70922cb47fd424caae545a2).
Here are a couple of relatively recent stackoverflow links that might help to provide a solution...one uses curl, the other python. Youtube always seems to be one step ahead...http://stackoverflow.com/questions/3850934/downloading-flv-from-youtube-using-curlpp-on-top-of-curl-video-not-playinghttp://stackoverflow.com/questions/2678051/cant-download-youtube-video
Sorry I couldn't help much / for writing such a long post!
P.S. it would also be awesome to have a bash script for parsing Vimeo urls, as I've read that vimeo uses the .M4A format, and they are much more lenient than youtube...