lilfaf/YTVimeoExtractor — pull request #6 by runmad (2013-11-07 21:52:23+00:00)
Title: Return lower quality instead of error if desired quality doesn't exist

I ran into this a couple of times. Setting the quality limits the behaviour of this library to *only* return a video with that quality, but this quality video won't always be available.

This adds functionality that makes it fallback to the next best quality resulting in a URL always being returned.

I realize this means the error for `YTVimeoExtractorErrorUnavailableQuality` would then never be returned and that the developer could have used this to make another request in a lower quality, but to me this seems like a wrong implementation. Perhaps we can extend this so the callback will return the quality and the developer can then choose to use or disregard the returned URL by comparing with the quality originally requested and hereby decide whether to discard the URL and throw an error of their choice, which means he/she won't have to do another request possible three separate times until a video URL is returned.