开发者

Retrieve YouTube video format available

开发者 https://www.devze.com 2022-12-15 17:28 出处:网络
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 p

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.

开发者_如何学JAVAIs 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消