How can I get the actual video URL of a YouTube live stream?

You need to get the HLS m3u8 playlist files from the video’s manifest. There are ways to do this by hand, but for simplicity I’ll be using the youtube-dl tool to get this information. I’ll be using this live stream as an example: https://www.youtube.com/watch?v=_Gtc-GtLlTk First, get the formats of the video: ➜ ~ youtube-dl –list-formats … Read more

How to obtain a feed of comments entered through the ‘chat’ box during a YouTube live broadcast?

It is now possible to return chat messages for your own broadcasts using the LiveChatMessages endpoint as part of the YouTube Live Streaming API. When creating a new liveBroadcast object, a liveChatId String will be returned as part of that liveBroadcast‘s snippet. Pass your broadcast’s chat ID to LiveChatMessages/list endpoint’s liveChatId parameter, and id, snippet, … Read more

How to check if YouTube channel is streaming live

You can do this by using search.list and specifying the channel ID, setting the type to video, and setting eventType to live. For example, when I searched for: https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCXswCcAMb5bvEUIDEzXFGYg&type=video&eventType=live&key=[API_KEY] I got the following: { “kind”: “youtube#searchListResponse”, “etag”: “\”sGDdEsjSJ_SnACpEvVQ6MtTzkrI/gE5P_aKHWIIc6YSpRcOE57lf9oE\””, “pageInfo”: { “totalResults”: 1, “resultsPerPage”: 5 }, “items”: [ { “kind”: “youtube#searchResult”, “etag”: “\”sGDdEsjSJ_SnACpEvVQ6MtTzkrI/H-6Tm7-JewZC0-CW4ALwOiq9wjs\””, “id”: { “kind”: … Read more