开发者

GData Youtube : obtaining thumbnails

开发者 https://www.devze.com 2023-03-22 00:37 出处:网络
I have a bunch of youtube VideoIDs (开发者_如何学Gothe alfanumeric string in the param watch/v=? of the youtube.com url) and I have to obtain the thumbnails for each video;

I have a bunch of youtube VideoIDs (开发者_如何学Gothe alfanumeric string in the param watch/v=? of the youtube.com url) and I have to obtain the thumbnails for each video;

Now, for each videoid I make up an HTTP GET request like the following:

http://gdata.youtube.com/feeds/api/videos/VIDEOID?v=2&alt=json (s/VIDEOID/actualVideoID/)

And I parse/play around with the json returned; But this approach is quite expensive in terms of performance (everything would be running on a mobile device): is there a way to make a single HTTP connection (maybe POSTing the VideoIDs, instead of GETting them)...

Thanks Giupo


Apparently the "q" parameter can work for multiple video id's. For example:

https://gdata.youtube.com/feeds/api/videos?q="7mSE-Iy_tFY"|"qybUFnY7Y8w"|"svC2XlPFW1g"&alt=json&fields=entry/id,entry/media:group/media:thumbnail

However note that the result can give extra videos because one of you're requested id's could be in another video's metadata. So you need to filter the results down to just those with the your original id list.

Alternatively it looks like you might be able to use a "batch request".

0

精彩评论

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

关注公众号