tags:

views:

102

answers:

3

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?

A: 

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.

Geoff
Unfortunately no, the totem plugin is a little tricky, but can I use some library to make javascript calls within the code itself ?
Wiflye81
A: 

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.

Wiflye81
A: 

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).

Wiflye81