Any way to enable Monetization on Scheduled Live Broadcast, using YouTube DATA API (without being Content ID Partner)? - youtube

Is there any way now to enable Monetization on Scheduled Live Broadcast, using YouTube Data API, for ex. using LiveBroadcasts: update option?
I know there is this method, using YouTube Content ID API, but to use it needs to be Content ID Partner, which for majority usual "Verified Partners" (part of YouTube Partner Program) is not possible, is it?
Thanks, in advance!

Related

Is there a function to view donation information via YouTube Data API?

I am hoping to pull live stream donation information every 5 minutes onto my server. I am making a script to check that information for the names of the crew and send them payments automatically. Is there a way with the YouTube Data API to handle donation information?
None of the YouTube apis support this functionality. The main issue is that the YouTube apis are more then ten years old. They just give you basic access to the videos on YOuTube.
What you are looking for would be access to data used in the YouTube web app that being donations which is a relatively new future, and again part of the web app. Not just video data. Its just not something YouTube has released an api for yet.
Try and submit a feature request Issue tracker
As DalmTo mentioned, the YouTube Data API v3 doesn't have such feature.
However I recommend you to try out my open-source YouTube operational API. Indeed by requesting https://yt.lemnoslife.com/lives?part=donations&id=VIDEO_ID you will get in item["donations"] the donations currently displayed in the YouTube live chat. Especially may interest you:
Donation timestamp: donation["timestampUsec"] (example: 1654111675007219)
Donator channel id: donation["authorExternalChannelId"] (example: UC_PkX-rSBPWJqoK2zRRalfQ)
Donation amount: donation["purchaseAmountText"]["simpleText"] (example: 100,00\u00a0$US)
Donation message: donation["message"]["runs"][0] (example: FOR JUSTICE!)

Embed a YouTube channel's current live stream without the video ID

Every time a user starts a live stream on YouTube, a new ID is generated for the stream, along with the corresponding video and URL. Currently, if I want to embed a live stream, I can use YouTube's sharing functions to add the video to my page in an iFrame.
When the user stops streaming, embeds of the live stream automatically switch to showing a recording of that stream. However, if the user starts broadcasting again later on, the embed will continue to show the old recording instead of switching to the new stream. This is because the video ID in the embed is hard-coded and each stream generates a new video ID.
My goal is to create an embed that will automatically display a user's live stream whenever they are streaming, and show an indication of whether they're online or offline. Is there an embed URL that would allow me to do this, or is there something in the API that might help?
I want to embed other streams that aren't just my own, so I need to do this in a way that doesn't require the streamer to log in or authenticate on my site.
If you know the ID of a YouTube channel, and if that channel streams a livestream set to Public, an iframe with this URL will show it:
https://www.youtube.com/embed/live_stream?channel=YOUR_CHANNEL_ID_HERE
See https://stackoverflow.com/a/39582176/470749
Unfortunately I haven't found a similarly simple way to permanently embed the YouTube chat for that livestream.
As far as I can tell, there's nothing built into the YouTube API that would allow you to embed a channel's current live stream automatically without knowing its ID. That said, it's possible to implement this yourself by writing a custom API and hosting it on your own server.
I recognize that this can look like a daunting task, so I've laid out some rough steps below to get you started.
Set up an endpoint on your own server. You could accept a
channelId argument or hard-code one, depending on how extensible
you want this to be.
Query YouTube's search endpoint1 for the specified channelId and eventType=live. An HTTPS request for this will look something like this:https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=[CHANNEL_ID]&eventType=live&maxResults=1&order=date&type=video&key=[YOUR_API_KEY]
Check the search JSON response. If it returns any results (data.pageInfo.totalResults > 0), you know that the channel is live.
If the channel is live, redirect the request to your server directly to the live video's embed URL based on the video's ID in the query response (data.items[0].id.videoId).
If the channel isn't live, create a placeholder as you see fit, or make a second request to search for eventType=completed for past broadcasts, eventType=upcoming for scheduled broadcasts, or remove the eventType parameter to get the most recent video.
Once you have a server that can respond and redirect requests, you can embed an iFrame in your page that points directly to your API URL. Your server will handle the logic and, using the redirect, change the iFrame to a YouTube video player automatically, without requiring you to perform client-side logic or expose your API key2.
1 As with all YouTube API requests, search#list queries will count towards your daily quota. If you intend for this to be a high-traffic endpoint, you could either request an increased quota from YouTube, or implement a caching solution on your end to cut down on the number of requests you make.
2 GCP (Google Cloud Platform), which you'll use to manage your access the YouTube Data API, has pretty good protections against API key theft for times when you do have to expose it on the client side. That being said, best practice is to keep your key secret by storing it only on the server whenever possible.

Going live in Youtube by using embedded player in the application is a violation?

I am building an app which does live streaming to Youtube channel using an embedded player. So i want to know if it violates the policy of Youtube since I am using a different application to do live to the youtube Also, all the application users will stream to a single youtube channel, so any idea in how many live streams can take place at a time?
It was stated in the Broadcast and Stream documentation of the YouTube API that "only one event is live at any given time, and the video content for each broadcast is unique". To learn more about policy, you can read the YouTube API developer policies.

Is it legal to use Youtube Data API to create youtube-like app that aggregrate youtube videos from any channel?

i'm planning to create some app that use youtube-api.
Is it legal to use Youtube Data API to create youtube-like app that aggregrate youtube videos from any channel? even it is not my channel or my video? Can I (legally) monetize those app with Admob?
Your question is answered in the first paragraph of the YouTube API Terms of Service.
1. Is it legal to use Youtube Data API to create youtube-like app that aggregrate youtube videos from any channel?
The terms don't prohibit it, as long as the client is compliant with the ToS. So, yes, it is legal.
2. Can I (legally) monetize those app with Admob?
It depends.
You agree not to use the YouTube API for any of the following commercial uses unless You obtain YouTube's prior written approval: [...] the sale of advertising, sponsorships, or promotions on any page of the API Client containing YouTube audiovisual content, unless other content not obtained from YouTube appears on the same page and is of sufficient value to be the basis for such sales.
I'm not an expert in law questions, but what this says (imho) is that you may advertise your application if it does not solely contain YouTube content. In other words, your application has to extend the functionality of https://youtube.com, not recreate it.
In any case, you may not block or in any way alter in-player ads.
Conclusion
Based on the short concept of your app you posted in the question, I would say:
You may build "youtube-like app that aggregrate youtube videos from any channel", but
you may not advertise it, since it does not feature original content.
if you plan to publish this on app store please review the IOS Guide Lines
5.2.3 Audio/Video Downloading: Apps should not facilitate illegal file sharing or include the ability to save, convert, or download media
from third-party sources (e.g. Apple Music, YouTube, SoundCloud,
Vimeo, etc.) without explicit authorization from those sources.
Streaming of audio/video content may also violate Terms of Use, so be
sure to check before your app accesses those services. Documentation
must be provided upon request.
And this SO question

Can I use YouTube API to enable YouTube Live Streaming?

I'm developing a YouTube live streaming related program. I know there're APIs to create/list/delete broadcasts and live streams. But all these are assuming that YouTube Live Streaming is already enabled on your account.
I tried to but failed to find any API with which I can use to enable YouTube live streaming on my account. Is there such an API?
As far as I can tell, there is not. As you can see here: https://support.google.com/youtube/answer/2474026?hl=en, in order to create live events on youtube an account must be verified and in good standing.
If you are making the API requests using a YouTube account that fulfills these requirements you can use the YouTube Data API to create liveBroadcasts, otherwise you will likely receive an insufficientPermissions error. This error is detailed here: https://developers.google.com/youtube/v3/live/docs/errors#youtube.liveBroadcasts.insert-insufficientPermissions-liveStreamingNotEnabled-permission.userNotEnabled
One potential way you could tell if an account is able to create live events programmatically would be to call the channels.list() method, and return the status. The status of the channels will have status.longUploadStatus. Long uploads also require an account to be verified and in good standing, so if this value returns allowed you likely have the permissions to work with live events. More details of this can be found in the YouTube Data API documentation.
Let me know if you find information to the contrary.

Resources