use youtube FMT parameters if they're in a link!
This textr was sent to me by drbits:
Currently, the code trims off the fmt parameter and then searches for an available format for the video from the known formats - beginning with the low quality formats, it contacts youtube to find out if the video is available.
The checks should begin with the highest quality formats. The low quality formats are for streaming, not downloading.
This also appears to be an ideal candidate for conversion to a table driven algorithm (a list of records, each with a format integer and the string to append to the address, searched in a FOR loop). Currently, it is a lot of repeated code.
The thread with discussion of this issue is
it contains one example.
rafi has a related suggestion in http://board.jdownloader.org/showthread.php?t=12844
that says to check all of the formats first and present the user with a list of what is available.