Answer the question
In order to leave comments, you need to log in
How to get parameter value from response?
request = youtube.liveBroadcasts().list(
part="snippet",
broadcastStatus="active",
broadcastType="all"
)
response = request.execute()
{
"kind": "...",
"etag": "...",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#liveBroadcast",
"etag": "...",
"id": "...",
"snippet": {
"publishedAt": "2021-06-13T05:08:05Z",
"channelId": "...",
"title": "Прямая трансляция пользователя Ориварива Пэйн",
"description": "",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/g37TQVf7Uv4/default_live.jpg",
"width": 120,
"height": 90
},
"medium": {
"url": "https://i.ytimg.com/vi/g37TQVf7Uv4/mqdefault_live.jpg",
"width": 320,
"height": 180
},
"high": {
"url": "https://i.ytimg.com/vi/g37TQVf7Uv4/hqdefault_live.jpg",
"width": 480,
"height": 360
},
"standard": {
"url": "https://i.ytimg.com/vi/g37TQVf7Uv4/sddefault_live.jpg",
"width": 640,
"height": 480
},
"maxres": {
"url": "https://i.ytimg.com/vi/g37TQVf7Uv4/maxresdefault_live.jpg",
"width": 1280,
"height": 720
}
},
"actualStartTime": "2021-06-13T05:08:36Z",
"isDefaultBroadcast": false,
"liveChatId": "..."
}
}
]
}
Answer the question
In order to leave comments, you need to log in
The response was of the json type, all that was needed was to get each array separately
lb_request = youtube.liveBroadcasts().list( #LiveBroadcast request. Get LiveChatID
part="snippet",
broadcastStatus="active",
broadcastType="all"
)
lb_response = lb_request.execute()
lci = lb_response["items"][0]["snippet"]["liveChatId"] #LiveChatID
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question