Look at the dosens of extension for Firefox about downloading Flash video's.
Downloadhelper and Flash Video Helper. If you look in the source you will find how to download the video.
From what i remember is that it parses the HTML page for an id and session and use that in an url to download the video.
Similar question found only in C#. Watch the sources and you can recreate it in java
C#: Downloading video from YouTube