JSON响应中的索引项

时间:2017-03-29 09:39:27

标签: arrays json python-3.x

我对youtube视频评论的JSON响应如下:

{
    "kind": "youtube#commentThreadListResponse",
    "etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/1UiD49KgezuMT0HrymBD0OZ3E1U\"",
    "nextPageToken": "Q2cwUTQtSDM2YV83MGdJZ0FDZ0JFaUFJQUJEbXo4ZW9nUHZTQWhqOTM4aUExX25TQWlJSzRKWEgxZVNhdWF6REFSZ0NJR1Fva2U3WmpyTEpwTFV1",
    "pageInfo": {
        "totalResults": 5,
        "resultsPerPage": 100
    },
    "items": [
        {
            "kind": "youtube#commentThread",
            "etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/fn5L2DoQwjltiG5nM--naV6-M9A\"",
            "id": "z23wdvurtkvyclz1facdp435xiuzwmzae1psziuygkpw03c010c",
            "snippet": {
                "videoId": "vtTYHTLGtIw",
                "topLevelComment": {
                    "kind": "youtube#comment",
                    "etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/bguPozBJPRK4-_SbJIOInFOw1EI\"",
                    "id": "z23wdvurtkvyclz1facdp435xiuzwmzae1psziuygkpw03c010c",
                    "snippet": {
                        "authorDisplayName": "DOCTOR INFERNUS",
                        "authorProfileImageUrl": "https://yt3.ggpht.com/-G9yPDUHhOvs/AAAAAAAAAAI/AAAAAAAAAAA/4GNwXMq65c4/s28-c-k-no-mo-rj-c0xffffff/photo.jpg",
                        "authorChannelUrl": "http://www.youtube.com/channel/UCC93n8GZyOPm_h3CY3JFrHg",
                        "authorChannelId": {
                            "value": "UCC93n8GZyOPm_h3CY3JFrHg"
                        },
                        "videoId": "vtTYHTLGtIw",
                        "textDisplay": "GRANDE SUINO, GRAZIE PER AVER GIOCATO LA MIA PRIMA CATTURA!!!",
                        "textOriginal": "GRANDE SUINO, GRAZIE PER AVER GIOCATO LA MIA PRIMA CATTURA!!!",
                        "canRate": false,
                        "viewerRating": "none",
                        "likeCount": 62,
                        "publishedAt": "2017-03-28T16:17:09.000Z",
                        "updatedAt": "2017-03-28T16:17:43.000Z"
                    }
                },
                "canReply": false,
                "totalReplyCount": 6,
                "isPublic": true
            }
        },
        {
            "kind": "youtube#commentThread",
            "etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/rBvY-n1JBcQ4CEqT2LrY1uQdJEs\"",
            "id": "z22gfva4jsv1j5runacdp4321t42jsm403ezlrmcs2dw03c010c",
            "snippet": {
                "videoId": "vtTYHTLGtIw",
                "topLevelComment": {
                    "kind": "youtube#comment",
                    "etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/60hDs9OK0xCERDfuEfl8vNrFwF8\"",
                    "id": "z22gfva4jsv1j5runacdp4321t42jsm403ezlrmcs2dw03c010c",
                    "snippet": {
                        "authorDisplayName": "Suy Ruy",
                        "authorProfileImageUrl": "https://yt3.ggpht.com/-UtO29HGQE_M/AAAAAAAAAAI/AAAAAAAAAAA/VHSk5I5weq4/s28-c-k-no-mo-rj-c0xffffff/photo.jpg",
                        "authorChannelUrl": "http://www.youtube.com/channel/UC_sCoo4q_NsQtJzPODMyw0w",
                        "authorChannelId": {
                            "value": "UC_sCoo4q_NsQtJzPODMyw0w"
                        },
                        "videoId": "vtTYHTLGtIw",
                        "textDisplay": "perche non fai un video co pirata e giovi",
                        "textOriginal": "perche non fai un video co pirata e giovi",
                        "canRate": false,
                        "viewerRating": "none",
                        "likeCount": 0,
                        "publishedAt": "2017-03-29T05:40:53.000Z",
                        "updatedAt": "2017-03-29T05:40:53.000Z"
                    }
                },
                "canReply": false,
                "totalReplyCount": 0,
                "isPublic": true
            }
        },
        {
            "kind": "youtube#commentThread",
            "etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/ahRp-yBaUWeRtW-L4bxKgX1lVAw\"",
            "id": "z22qvn0piufhf3pmxacdp431byatqrqgct1mycrva31w03c010c",
            "snippet": {
                "videoId": "vtTYHTLGtIw",
                "topLevelComment": {
                    "kind": "youtube#comment",
                    "etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/R51E2qjTtDVPldD5sKE5DGqk-N4\"",
                    "id": "z22qvn0piufhf3pmxacdp431byatqrqgct1mycrva31w03c010c",
                    "snippet": {
                        "authorDisplayName": "graziano gramazio",
                        "authorProfileImageUrl": "https://yt3.ggpht.com/-Aod-DCzftiM/AAAAAAAAAAI/AAAAAAAAAAA/ENmn1HOClFE/s28-c-k-no-mo-rj-c0xffffff/photo.jpg",
                        "authorChannelUrl": "http://www.youtube.com/channel/UCSzxP9mNJzwUncpoXmTj4Kw",
                        "authorChannelId": {
                            "value": "UCSzxP9mNJzwUncpoXmTj4Kw"
                        },
                        "videoId": "vtTYHTLGtIw",
                        "textDisplay": "aveva abbandonato suino",
                        "textOriginal": "aveva abbandonato suino",
                        "canRate": false,
                        "viewerRating": "none",
                        "likeCount": 0,
                        "publishedAt": "2017-03-29T05:36:44.000Z",
                        "updatedAt": "2017-03-29T05:36:44.000Z"
                    }
                },
                "canReply": false,
                "totalReplyCount": 0,
                "isPublic": true
            }
        },
        {
            "kind": "youtube#commentThread",
            "etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/-kSmwdlw6IOoqU9C1v9DLUTFMwQ\"",
            "id": "z22vjzf5crrlidoqg04t1aokgvridnm5gy3cl2wz0asprk0h00410",
            "snippet": {
                "videoId": "vtTYHTLGtIw",
                "topLevelComment": {
                    "kind": "youtube#comment",
                    "etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/Mg8N25E0zNNLHoogsmmFfnYD8_0\"",
                    "id": "z22vjzf5crrlidoqg04t1aokgvridnm5gy3cl2wz0asprk0h00410",
                    "snippet": {
                        "authorDisplayName": "Mik 318",
                        "authorProfileImageUrl": "https://yt3.ggpht.com/--fqCVwPMM7k/AAAAAAAAAAI/AAAAAAAAAAA/JrMPbik_6SM/s28-c-k-no-mo-rj-c0xffffff/photo.jpg",
                        "authorChannelUrl": "http://www.youtube.com/channel/UCVfQXw4fPp1cSXxEy3YAviw",
                        "authorChannelId": {
                            "value": "UCVfQXw4fPp1cSXxEy3YAviw"
                        },
                        "videoId": "vtTYHTLGtIw",
                        "textDisplay": "R.I.P. suino disperso :(",
                        "textOriginal": "R.I.P. suino disperso :(",
                        "canRate": false,
                        "viewerRating": "none",
                        "likeCount": 1,
                        "publishedAt": "2017-03-28T22:38:11.000Z",
                        "updatedAt": "2017-03-28T22:38:11.000Z"
                    }
                },
                "canReply": false,
                "totalReplyCount": 0,
                "isPublic": true
            }
        },
        {
            "kind": "youtube#commentThread",
            "etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/kXSiKUHMbhtlHrYIkoGFBA8_Cxw\"",
            "id": "z23rhx1yzlnuz3ww404t1aokgoconzvynj5i25o1kz0qrk0h00410",
            "snippet": {
                "videoId": "vtTYHTLGtIw",
                "topLevelComment": {
                    "kind": "youtube#comment",
                    "etag": "\"uQc-MPTsstrHkQcRXL3IWLmeNsM/3zcsEZwae2Po5tsZs7zr1mjn064\"",
                    "id": "z23rhx1yzlnuz3ww404t1aokgoconzvynj5i25o1kz0qrk0h00410",
                    "snippet": {
                        "authorDisplayName": "lorenzo lori",
                        "authorProfileImageUrl": "https://yt3.ggpht.com/-OSw9TlwmfS8/AAAAAAAAAAI/AAAAAAAAAAA/i3uxrHV3UI0/s28-c-k-no-mo-rj-c0xffffff/photo.jpg",
                        "authorChannelUrl": "http://www.youtube.com/channel/UCmyNOm4JqtVuBvFFYcHRz3g",
                        "authorChannelId": {
                            "value": "UCmyNOm4JqtVuBvFFYcHRz3g"
                        },
                        "videoId": "vtTYHTLGtIw",
                        "textDisplay": "pork sei grande ti seguo tutti i giorni da quando avevi 30000 iscritti. continua cos\u00ec non fermarti",
                        "textOriginal": "pork sei grande ti seguo tutti i giorni da quando avevi 30000 iscritti. continua cos\u00ec non fermarti",
                        "canRate": false,
                        "viewerRating": "none",
                        "likeCount": 0,
                        "publishedAt": "2017-03-28T22:19:54.000Z",
                        "updatedAt": "2017-03-28T22:19:54.000Z"
                    }
                },
                "canReply": false,
                "totalReplyCount": 0,
                "isPublic": true
            }
        }
    ]
}

此回复存储在results[]中。我想获得第一个视频ID并获得对此评论的所有回复。 所以,我运行print(results["items"][0]["id"]),但我只能获得第五个视频ID。

我如何获得第一张身份证?怎么了?

0 个答案:

没有答案