How can I use the YouTube LivStreaming API to detect that a YouTube live broadcast has been deleted? - youtube-api

I am using the YouTube LiveStreaming API to retrieve the list of lives and cache them in a database.
Can I use the LiveStreaming API to detect deleted liveBroadcast?
I thought that the lifeCycleStatus of a deleted liveBroadcast would be in the revoked state, but I was mistaken. I believe this is probably the status of cases that have been disabled by the YouTube admin team.
I don't think it is currently possible to retrieve deleted lives via the List API. Is this understanding correct?
Thank you.

Related

Google YouTube Data v3 API Blocked From Uploading Videos

Recently I have been using multiple scripts that allow you to upload a video via the YouTube Data v3 API from GCP.
However, the videos always gets auto privated and locked. I have done research and found out it's because you need verification on your API key or whatever.
Does anyone know how to get the API key verified or to be able to use the API to upload videos without it being auto locked to private?
Does anyone know how to get the API key verified or to be able to use the API to upload videos without it being auto locked to private?
To be clear api keys are used to access private user data. To upload videos to YouTube you need to use Oauth2 and be authorized to access a users YouTube account
However, the videos always gets auto privated and locked.
If you check the documentation for Videos: insert you will find the source of your issue and what you need to do to fix it.
All videos uploaded via the videos.insert endpoint from unverified API projects created after 28 July 2020 will be restricted to private viewing mode. To lift this restriction, each API project must undergo an audit to verify compliance with the Terms of Service. Please see the API Revision History for more details.
Go though the verification process and then you will be able to upload public videos.
Unverified apps
What you need to know about Google verification

Permissions to access someone's private videos on YouTube

We're working on an integration with youtube channels (using Youtube Data Api v3). We need to access the videos (private also) on our user's channels.
The flow is the following:
User authorizes his/her youtube account on our site using OAuth.
We show user the list of videos on user's youtube channel.
User selects some of them (they can be private) and sends us for processing.
We need to somehow access the actual video files which the user asks us to process.
The issue is that youtube does not give any streaming URLs or download links.
Looks like, the API provides only iframe embedded code, which works ONLY for the browser, where the user is actually logged into youtube.
How can we access(can we?!) the private video, if we have the OAuth access-token of the video owner?
The YouTube Data API lets you incorporate functions normally executed on the YouTube website into your own website or application. The lists below identify the different types of resources that you can retrieve using the API. The API also supports methods to insert, update, or delete many of these resources. This in a sense means that you can see most of what you can see on the YouTube website including uploading new videos.
Downloading Youtube videos is against their Terms of Service, so the API does not support that.
Page linked above refers to Youtube ToS that states:
You shall not download any Content unless you see a “download” or similar link displayed by YouTube on the Service for that Content.
YouTube partners may have access to this feature in their API (no idea i have never seen the api), if you have access to this i suggest you contact your manager directly they should be able to instruct you on how to access it assuming the feature exists.

Storing YouTube metadata

I've read YouTube's Terms of Service several times and have Googled this question tirelessly with no concrete answer. This is not a legal question about my specific YouTube API client, I just want to know if any YouTube developer has used the API in this way. I'm working on a side project for myself that's essentially an Instagram-YouTube mashup. I am a YouTube developer with an API key. Can my API client store a videos title, description and id in my database when my users like a video on my client? I don't know how else I can keep track of my users liked videos within my client.
Since you already specified that this is in fact not a legal question, the short answer is: Yes, you can (meaning it is possible).
There is one more possibility coming to mind, though:
You could authenticate users via OAuth 2.0 using the https://www.googleapis.com/auth/youtube scope. That way, you can manage their liked videos and add/remove videos to this list when a user clicks the according buttons on your website (you can also check if any given video is already liked by the user). In this case, all the track-keeping is done by YouTube itself. This ultimately means that whenever a user likes a video in your app, they also like it on the YouTube website. This may or may not be desired, it is for you to decide that.

Is it possible to allow many users to make live broadcasts using YouTube API and a single account?

I want to make a web application and I want to use YouTube API to allow my users make live broadcasts.
Is it necessary that my users log with their Google/YouTube accounts to use the live stream or is it possible to make them use this function without bothering them with this detail?
In order to create the Live Event and Live Stream objects required for a livestream on YouTube, the user making those requests must be authenticated.
From the Docs:
Your application must have authorization credentials to be able to use the YouTube Live Streaming API.
Obtaining authorization credentials guide here.
Adding a live event is similar to uploading a video. The user making the upload must be authenticated in order for the video to appear on their channel.

Is it possible to host videos uploaded to my website on youtube?

I have Java based website. I would like users to log into my website and then upload videos to youtube using my youtube account. Users should not be required to have their own youtube account since videos will be uploaded using my youtube account.
Does youtube support this scenario?
If so, is there a sample code that shows me how to do this in Java?
I have used UploadVideo.java sample provided by google (https://developers.google.com/youtube/v3/code_samples/java#upload_a_video), but it requires users to log into youtube account using their id and password. That is not my use case.
Please study the terms and conditions of the Youtube service ; I think they do not allow this:
https://www.youtube.com/static?gl=GB&template=terms
YouTube accounts
4.1 In order to access some features of the Website or other elements of the Service, you will have to create a YouTube account. When
creating your account, you must provide accurate and complete
information. It is important that you must keep your YouTube account
password secure and confidential.
4.2 You must notify YouTube immediately of any breach of security or unauthorised use of your YouTube account that you become aware of.
4.3 You agree that you will be solely responsible (to YouTube, and to others) for all activity that occurs under your YouTube account.
and
5.1.L: you agree not to access Content or any reason other than your personal, non-commercial use solely as intended through and permitted
by the normal functionality of the Service, and solely for Streaming.
"Streaming" means a contemporaneous digital transmission of the
material by YouTube via the Internet to a user operated Internet
enabled device in such a manner that the data is intended for
real-time viewing and not intended to be downloaded (either
permanently or temporarily), copied, stored, or redistributed by the
user.
You can not let other people use your YouTube account/channel. The way to do is using YouTube Direct Lite
You basically add a ytdl with playlist tag while uploading videos.
You can check Android Client for how to do it in Java.
As to whether it is technically possible, yes, see https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol
The technical problem here is users will be able to delete videos too if they have your access token with full permissions. basically you need to:
load your html page with the upload interface.
add to the onclick event of the upload button to send an ajax request to a script on your server which will:
return the access token of your account to the client
soon thereafter change the access token using the refresh token
Its still technically vulnerable though. a possible solution is to obtain the access token ONLY with the scope:
https://www.googleapis.com/auth/youtube.upload
There is a very good chance it will not be vulnerable then. You should test it.

Resources