gdata api v3 youtube, can not retrieve contentDetails
Asked Answered
M

1

2

I am trying to get the duration of a youtube video via search

var request = gapi.client.youtube.search.list({
    q: q,
    type : "video",
    maxResults : 10,
    part: 'snippet,contentDetails'
});

as an additional part parameter I added contentDetails in order to get the duration as you can see in their doc. https://developers.google.com/youtube/v3/getting-started

Now comes the silly part. The response I get is the following:

[
{
"error": {
   "code": -32602,
   "message": "contentDetails",
   "data": [
     {
     "domain": "youtube.part",
     "reason": "unknownPart",
     "message": "contentDetails",
     "locationType": "parameter",
     "location": "part"
    }
   ]
  },
  "id": "gapiRpc"
 }
]

"As such, the part parameter requires you to select the resource components that your application actually uses" Thats what I did and now they dont know their own parameter anylonger?

So I was wondering how can I retrieve the duration order contentDetails in general? best phil

Mongolia answered 8/8, 2013 at 22:25 Comment(0)
R
7

As written in the document, for search->list call, part can only take value "snippet".

Depending on the kind of the response, as a secondary call, you can do one of videos->list, playlists->list, channels->list with the id and part=snippet,contentDetails to get more details of each result item.

Renewal answered 9/8, 2013 at 1:29 Comment(2)
since you seem to be on the Google team - that's really crap. You let me have details for an individual video, but I need to make a series of calls to grab the same info when I'm getting back a list? You need to look into changing thatFirecrest
Yeah, the inconvenience suck, for the likes of me that needs to add all uploads from a channel with 100+ entries. Why do we need such authorization if the video and channel are marked public anyway >.<Happily

© 2022 - 2024 — McMap. All rights reserved.