|Batch Processing and yt:statistics||James Alday||2/27/12 2:33 PM|
I'm building an app that basically replicates the functionality of Youtube Direct within a custom hosted CMS. Users will upload or select videos they've posted to youtube and we track them for moderation and playing in custom playlists on app pages. My client is requesting a few custom playlists, including the "most viewed" videos that have been approved in the CMS. To do this, I need to keep track of the view counts on those videos. I've created a script that is using batch processing to get info on videos that I select from the DB, but it appears that there is no statistical data in the return from a batch query.
Am I missing something or is this the case? Is there any way to create a batch query to get statistical data (primarily view counts) or is this something I will have to make individual requests for? I was hoping to make a single request for up to 50 videos rather than having to do 50 individual requests to get this data. Is there a best practice for this type of thing as far as quotas? Thanks!
|Re: Batch Processing and yt:statistics||Jeffrey Posnick||2/28/12 12:50 PM|
There's no difference from a quota perspective between making a batch
request that contains 50 subentries or making 50 individual requests.
There's obviously less HTTP overhead involved with making a single
batch request and therefore it's a little faster—that's the main
I'm not very familiar with the results of a video entry batch
requests. I'm somewhat surprised that we don't return the full video
entry, including the yt:statistics element, for batch requests, but if
you tried it and that information's not there, I'll take your word for
it. Given the relatively small number of batch requests that we see,
it's unlikely that we'll be able to persuade the engineering team to
devote the work needed to expand on the information returned.
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
|Re: Batch Processing and yt:statistics||David López||8/21/12 3:07 AM|
El martes, 28 de febrero de 2012 21:50:33 UTC+1, Jeffrey Posnick escribió:
I am having exactly the same problem, i am doing individual requests for retrieving data of users and videos, but it is getting slower and slower while my needs are getting higher, so i decided to give a try to the batch method, and yep, for me the the yt:statistics node is also empty so i definitevely cannot use this method, i think it should be fixed. Maybe i am doing something wrong? some xmlns missing in my XML request or something like that.
Thanks in advance,
P.D. I attach an example of one of my dinamically generated XML's
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:yt="http://gdata.youtube.com/schemas/2007">