문제

If I get all Playlist Items with the Youtube Data API v3, I am getting this format for all videos:

   "contentDetails": {
    "videoId": "KUL_AHeC4zw",
    "startAt": "PT0S",
    "endAt": "PT21M12.667S"
   }

Whats that thingie next to endAt? Why is there a point in the middle? I expect some kind of PT21M54S. I just want the duration as I would get it when I am fetching a single video. Is that a bug or am I just not able to understand that ISO Date Format?

도움이 되었습니까?

해결책

This field "endAt" is not the same as the "duration" of the video, but where the playlist owner wants it to stop playing. The video duration is located in the video resource and not in the playlistItem. And it requieres another lookup request.

You can find the definitions of the fields in the YouTube documentation. See for those resource definitions: https://developers.google.com/youtube/v3/docs/playlistItems#resource and https://developers.google.com/youtube/v3/docs/videos#resource

다른 팁

"startAt": "PT0S", "endAt": "PT21M12.667S"

This property has been deprecated and, if set, its value is ignored.

For More Info Check at https://developers.google.com/youtube/v3/docs/playlistItems#resource

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top