Youtube Live-streaming API returns an empty list of streams - youtube-livestreaming-api

I'm trying to make an electron app that will work together with OBS. For this I need the Stream Name from youtube among other things.
But this stream name has proven hard to get from the API.
I'm currently testing it with the python examples on the documentation page.
This is the example that i use.
Before I started, I created a event with all the settings - and I'm able to see the Stream Name/Key on the website.
When I use the API, it just returns an empty list. I'm sure that I do have a stream, and that it's working as I created it myself, and I am streaming to the example view.
However I never get anything from that service. The other services work, like the list broadcasts one, it returns all planned events.
List Broadcasts:
$ python .\list_broadcasts.py
Broadcasts with status 'all':
Test Begivenhed (ib08ZcLQgZA)
List Streams:
$ python .\list_streams.py
Live streams:
The code for the examples can also be found here: https://github.com/youtube/api-samples/tree/master/python

Turns out that when you create a "Broadcast" a random stream is attached. It's impossible to get the key from this stream.
Instead you need to create a new "Stream/Customised Ingestion", this will make it all work, just make sure that your broadcast is attached with the steam.
You can reuse this stream, and that's a good thing for me, as I don't need to change the streaming key all the time.
You can create a new Stream/Customised Ingestion preset in the UI or via the API.

Related

Can not find live

I have a text to speech robot that I use for my livestreams on youtube. The robot has been functioning fine for months.
It is giving me the error "Can not find live" despite having a livestream running.
My stream did particularly well yesterday, which may be related to why the API is behaving differently for me today?
It looks like my channel has been shadowbanned from appearing in search results for live videos. The youtube-live-chat node api that I uses relies on a search to get the chat id. Since I am shadowbanned from search results I must use the livebroadcasts list command instead.

How to call Google NLP Api from a Google Chrome extension

My aim is to select some text from a web page, start a google chrome extension and give the text to a google cloud api (Natural Language API) in my case.
I want to do some sentimental analysis and then get back the result to mark/ highlight positive sentences in green and negative ones in red.
I am new to this and do not know how to start.
The extension consists of manifest, popup etc. How should I call an API from there that does Natural Language Processing?
Should I create a Google Cloud Application with an API_KEY to call? In that case I would have to upload my credentials right?
Sorry sounds a bit confusing I know but I just don't know how I can bring this 2 things together an would be more than happy about any help
The best way to authenticate your app will depend on the specific needs and use cases of your application. You can see an overview of all the different methods here.
If you are not planning on identifying users nor on using a back end server that handles authenticating (as I assume to be your case), the best option would indeed be to use API keys. They do not identify the user, but are enough for the Natural Language APIs.
To do this you will need to create an API key for the services you want and add the necessary restrictions to make the key as secure as possible. Detailed instructions on how to do this and how to use the key in a url can be found here.
The API call could be made from within the Chrome extension with any JavaScript method capable of performing POST requests. For example using XMLHttpRequest or the Fetch API. You can find an example of the parameters that need to be included in the request here.
You may run into CORS issues when making the request directly from the extension. I recommend reading this answer, where a couple of workarounds for these issues are suggested.

How to create and event with multiple cams with youtube-livestreaming-api

I'm trying to use youtube-livestream-api to create an Event and adding cameras.
What I have tried so far is:
1) Create single Broadcast with broadCasts.insert and then bind multiple streams. That didn't work, as I found out in the documentation.
2) Create multiple broadCasts and bind it to every stream, but when I go to the Youtube Content Editor, I see an event for each broadcast. Which is coherent with the documentation about a broadcast = a video.
My question is, is there any way using the API to create a single event with multiple cams, as you do in the Content Creator?
Finally i've found a similar question to this Does the YouTube Data API expose multi-camera livestream functionality?
In short, as is for now, there is no way with youtube API for having multiple cameras per stream.

LiveStreams: list empty result

I'm testing YouTube live streaming API using Java client libraries.
I have a simple project which is basically the copy of ListStreams example taken from here:
https://developers.google.com/youtube/v3/live/code_samples/java#retrieve_a_channel_s_live_video_streams.
I have my application registered in Google developers console. I have created a test public live stream and a test broadcast.
Everything works fine, I can broadcast video from my phone to this live stream.
But when I try to get a list of live streams from my channel I always get an empty result.
The funny thing is that I can successfully retrieve my channel's broadcasts using the LiveBroadcasts.java example.
But no matter what I do the list of streams is always empty.
Did anyone have similar problems ?
Cheers, Dmitry.

How to get anonymous list of live streams by game

I run the LiveStreamBrowser family of Chrome extensions, which display listings of currently live streams for popular games. I'd like to include YouTube Gaming as a provider, but I can't find a way in the API to do so.
liveBroadcasts/list and liveStreams/list both seem like they'd have the information I need, but neither seems to be returning anything when I use the test on the API page. liveStreams/list also complains about a missing filter parameter, when there's not one documented.
Further, I need an API that is callable directly from JavaScript. For example, Twitch's /streams API, which is called with a 'game' parameter and an API key.
Am I just missing something in the API documentation?
I don't think there is an API exposed for gaming live streams specifically. You can use the Search/list endpoint of the regular YouTube v3 API and filter the results return live content. From there, you could break down the results even more, searching by the game title.
part -> snippet
eventType -> live
type -> video (required when setting eventType to live)
HTTP GET https://www.googleapis.com/youtube/v3/search?part=snippet&eventType=live&type=video&key={YOUR_API_KEY}