Checking user's youtube quota before uploading the video - youtube-api

When using YouTube Data API, then do we need to check quota before uploading the video. What I am doing, after authentication and exchanging the token, I am saving access_token, refresh_token and expires_in.
Then with the help of access_token I am able to upload video. But just wanted to know do I need to check any quota usage beforehand.
Uploads a video to YouTube
One important thing: Logged in user (narendardiscover#gmail) will be uploading the video after giving access to MyApp2018. Please see the attached image. So video will be uploaded on narendardiscover youtube account. So do I need to check any quota of narendardiscovoer.

Quota is tracked for a Google Cloud Console Project (in your case this is "MyApp2018"). The YouTube Data API does not differentiate between channels, so regardless which of your end users wants to upload a video through your app, the API operation will always be added to your application's quota.

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

Allowing user to upload to their own channel using youtube api

Youtube's api ToS state that we must allow a user to upload a video to their own account or to our youtube application account. What would be the proper process for doing this? The code snippets refer to using one's own account (e.g. api key and secret key). Will these work for uploading to the user's account?
Well, if you want users to upload video on your channel, what they need is your OAuth token. This SO question also have an information about your problem.
This documentation will explain you on how to obtain an OAuth access token. It contains sample code that you can copy/follow.
For more information, you can check these tutorials:
How to Authenticate & upload videos to YouTube Channel in PHP
PHP server-side YouTube V3 OAuth API video upload guide

Dailymotion API Usage

I am just hitting below mentioned url of Dailymotion api to search for a video and then use video id to be played in videoplayer provided by daily motion.
https://api.dailymotion.com/videos?fields=description,id,taken_time,thumbnail_180_url,title,url,views_total,&search=kohli&limit=100
I am hitting this without any API key. Is there any limit for only this kind of usage?
There is no limit defined anywhere in Dailymotion API Documentation. API key is required for special requests like to generate access token, to get user information after logging in, to upload videos, mostly for authentications etc.

API - Upload video in PHP to a specific Channel

We're planning on using the YouTube API Data V3 to allow users to upload videos to our channel via PHP. My question is, what are the correct steps in allowing the video to be uploaded on a server, to our Channel? I though that is where the Server or possibly Browser key would come into play?
Currently, I'm able to upload the video, but after the user signs in, it get's uploaded to their Channel. Do we need to store the access token generated by account that we want all the videos to be uploaded to?
You can actually save the refresh token once the account of your server signs in and reuse it in your code, rather than signing in a user every time.
You can do so by getting a refresh token from OAuth2 Playground and setting it in your youtube object.
Here it explains a little more.
And a step by step video.

YouTube video upload API

I have completed uploading videos to YouTube from my website, that's for particular user account only (means all videos uploaded to single user account). Now I want that user come to my site enter their YouTube username and password and selected video will be upload to their account.
Till now what i have done is i have uploaded videos to my own account with my developer key. But now i want that if any user uploads video to YouTube then it uploads to his/her account. I am not able to find out the way because it may possible that they don't have developer key which is required to upload. So i need help in this.
I have seen API but I am not able to work out help for this. Anyone can help me in this?
Thanks!
You need to use the OAuth 2.0 API documented here: https://developers.google.com/youtube/2.0/developers_guide_protocol_oauth2 to obtain the credentials you need.
Using the credentials you create a link to Google's authorization service which your customers follow. On that page they can either allow, or deny, access to their YouTube account to your service. Assuming permission is granted, the service will redirect to the "callback" location URL you provided along with a pair of access tokens. You can then use these tokens to upload videos to YouTube and the videos will appear in the customer's account as they they had uploaded them.
It would be helpful if you could be more specific about what you are asking.
This is the youtube API for uploading videos:
http://code.google.com/apis/youtube/2.0/developers_guide_protocol_uploading_videos.html

Resources