shk3/edx-downloader — pull request #67 by iemejia (2014-01-02 16:58:13+00:00)
Title: Fixes #66 defaults preference to the best mp4 available when the format … isn't available

I think this is probably the easiest approach to this problem, notice that I changed format to be a string since youtube supports '-f mp4' or '-f flv' as options. Also you can put different preferences and it will download the best available e.g. '135/15/mp4'.
The alternative would be to check the output code of youtube-dl and then re-execute the command which I think would add innecesary complexity to the script.