I have two 5th gen nanos, each with several music videos I got from various sources, including YouTube.
I'm not going to tell you step-by-step how to get the video file that YouTube shows, as that's frowned upon by this forum.
However, I will tell you about the tool I use to convert that file to iPod-friendly format: HandBrake. Search for that in these forums, and you'll come up with a lot of hints for using it. The current version's iPhone/iPod Touch preset works wonderfully for the 5th gen nano, and makes somewhat acceptable output for iPad and Apple TV, with quite compact file size.