我如何编写脚本来记录部分JSON响应?

时间:2015-09-16 08:34:08

标签: json youtube-api youtube-data-api

我的代码如下:

var caption = YouTube.Captions.list("snippet", "GHWjZqqeavI")
Logger.log(caption.items)

我得到的回应是:

[15-09-14 10:46:33:634 BST] {
kind=youtube#captionListResponse,
tag="jOXstHOM20qemPbHbyzf7ztZ7rI/pWn9PuYA4wHTOuk7gWrw_wkqaMg", 
items=[{snippet={lastUpdated=2015-04-22T15:19:44.401Z, 
        trackKind=ASR, isAutoSynced=false, 
        audioTrackType=unknown,
        isDraft=false, name=, 
        isEasyReader=false, 
        isLarge=false, 
        videoId=XPpsI8mWKmg, 
        language=en, isCC=false, 
        status=serving}, 

kind=youtube#caption,                              
etag="jOXstHOM20qemPbHbyzf7ztZ7rI/5QI7PZUUbbATmyKtvzGqv9-ylR0",          
id=5dp7OTjMUTyH2tf_kEhELNI2X9MpCov20brI5R-kAw4=}, 
    {snippet={
        lastUpdated=2015-04-22T15:12:54.185Z, 
        trackKind=standard, 
        isAutoSynced=false, 
        audioTrackType=unknown, 
        isDraft=false, 
        name=, 
        isEasyReader=false, 
        isLarge=false, 
        videoId=XPpsI8mWKmg, 
        language=en, 
        isCC=false, 
        status=serving}, 
kind=youtube#caption, 
etag="jOXstHOM20qemPbHbyzf7ztZ7rI/6A1s7QwGUJ_Jp39d-tidbyPR6t4", 
id=Q-Rh5crBiivJBgQyElc_gzhB8eK8y0V4}]}

我只想记录响应的一部分(例如isCC或trackKind)。我该怎么做?

0 个答案:

没有答案