I would like to find the streams associated with a broadcast with 'ready' status. I've been looking at the broadcasts using this call, and don't see either the streams or a key I can use to correlate them:
curl -H "Authorization: Bearer XXX_AUTH_TOKEN_XXX" "https://www.googleapis.com/youtube/v3/liveBroadcasts?part=status&broadcastStatus=all&maxResults=100"
This produces:
{
"kind": "youtube#liveBroadcastListResponse",
"etag": "LgRz6pjADsE_wIIphSY6n_M3LDE",
"pageInfo": {
"totalResults": 39,
"resultsPerPage": 50
},
"items": [
{
"kind": "youtube#liveBroadcast",
"etag": "DC7GxUyFsLEyJorVsv7gl7yBxYY",
"id": "BRsOTPMIb_s",
"status": {
"lifeCycleStatus": "ready",
"privacyStatus": "public",
"recordingStatus": "notRecording",
"madeForKids": false,
"selfDeclaredMadeForKids": false
}
},
...
]
}
Similarly, I would like to know if a stream in the 'inactive' state is associated with an existing broadcast, so I can add it to a new one if needed.
curl -H "Authorization: Bearer XXX_AUTH_TOKEN_XXX" "https://www.googleapis.com/youtube/v3/liveStreams?part=snippet,cdn,contentDetails,status&mine=true&maxResults=100"
This produces:
{
"kind": "youtube#liveStream",
"etag": "i3qny6yeyCwtlZkNHB5lgMLGF1I",
"id": "EFWoMyGEmXWkp7dWPLYdWA1615776388366728",
"snippet": {
"publishedAt": "2021-03-15T02:46:29Z",
"channelId": "XXXXXXXXXXXXXXXXXXXXXXXX",
"title": "Default stream key",
"description": "Description for default stream key",
"isDefaultStream": false
},
"cdn": {
"ingestionType": "rtmp",
"ingestionInfo": {
"streamName": "XXXX-XXXX-XXXX-XXXX-XXXX",
"ingestionAddress": "rtmp://a.rtmp.youtube.com/live2",
"backupIngestionAddress": "rtmp://b.rtmp.youtube.com/live2?backup=1",
"rtmpsIngestionAddress": "rtmps://a.rtmps.youtube.com/live2",
"rtmpsBackupIngestionAddress": "rtmps://b.rtmps.youtube.com/live2?backup=1"
},
"resolution": "variable",
"frameRate": "variable"
},
"status": {
"streamStatus": "inactive",
"healthStatus": {
"status": "noData"
}
},
"contentDetails": {
"closedCaptionsIngestionUrl": "http://upload.youtube.com/closedcaption?cid=sdgs-zk2j-grt3-x9jj-d7ks",
"isReusable": true
}
}
For example, the broadcast above apparently is related to the stream above since they were created by YouTube Studio, as the default ones when manually starting a stream. However, it is unclear from the two JSON snippets what connects them.
Any ideas on how to relate them is greatly appreciated!