I'm currently trying to patch the Totem Youtube plug-in and I'd like to determine the best quality available for the current played video (&fmt parameter). It's possible in JavaScript but the plug-in is developped in C.
Is that possible?
I'm currently trying to patch the Totem Youtube plug-in and I'd like to determine the best quality available for the current played video (&fmt parameter). It's possible in JavaScript but the plug-in is developped in C.
Is that possible?
Are you playing the videos in the YouTube video player?
If so, you can query the quality levels through the ActionScript or JavaScript API, see http://code.google.com/apis/youtube/js_api_reference.html#Playback_quality.
Currently, the only solution I found is to fetch the YouTube video page and parse it to find wanted information but that's not very exciting.
I found the solution thanks to youtube-dl python script. The test is to form the final url and try to open it (with curl for example), if the format is available it will return HTTP code 303 (See other location) with the real url into the headers. If it's not available, it will return 404 (Not found).