Youtube API - Listing hidden videos of my channel using OAuth - youtube

I need to list all my unlisted videos on a web page, using OAuth2. Associated with my email, there are 2 channels.
I am using this code: youtube/api-samples
When I first authorize OAuth, it lists the videos I uploaded on the chosen account, then when I reload the page it says I don't have videos uploaded.
If i remove all the cookies and reauthorize again it works, then if i reload the page again I get the "No videos" message.
It seems that it tries to list the wrong channel when i reload, but I am sure I authorized the right channel.
Am i doing something wrong?

Related

How to get logged in user youtube details using youtube data api v3

how to get logged in user youtube details in react
had tried using javascript but is there any ways to get ?
i want get youtube details of logged in user , like number of videos and subscribers in react.
The YouTube data api is channel based not user based. There for any information you get back about the currently logged in Channel is not going to be user related.
Request the profile scope and then go though the Google People api.

No longer able to get watched history of youtube user using Youtube API?

All the related SO questions and answers say to use the playlist ID returned in the contentDetails.relatedPlaylists.watchHistory returned by the youtube.channels.list endpoint. That value now always seems to be set to "HL". I'm using an OAuth token to authenticate the request. Is there another way to get the list of recently watched videoes for the authenticated user? I also noticed that the list of watched videos no longer appears on the user's YouTube home page, just recommended videoes. Am I just SOL or is there some new way to access the watch history?

Can we get user's YouTube data (history, recommended videos, ...) through YouTube API?

I'm new to YouTube API. Is it possible to get user's data if he is authenticated into my application using his Google account.
The YouTube Api v2 used to have a feature like this if i remember correctly. Unforutnatly that API has long since been shut down.
Activites.list which just gives a list of video's recommend that the user watch. There is nothing for History of what videos the user has watched or liked.
Authenticated:
If the user is authenticated you can use the home parameter which is used to show the videos that would be recommend to said user by YouTube
Set this parameter's value to true to retrieve the activity feed that displays on the YouTube home page for the currently authenticated user.

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 OAuth: Why do some accounts give me "Invalid Credentials"?

I'm using OmniAuth in Rails to authenticate users through YouTube OAuth.
I have several Google/YouTube accounts. Two of them log in just fine. Two of them fail with "invalid_credentials".
I'm not entirely sure what that error means; it doesn't appear in the OAuth 2 spec.
I'm successfully logged into all four of these accounts on the Google side using multiple sign-in, so it's not that I'm logging in incorrectly. Two of the accounts work, so it's not that my API key is bad.
What's going on?
I've got the answer.
They're returning invalid_credentials because there's no YouTube account associated with the user who's trying to log in.
But! I did make sure to log into YouTube with those accounts before trying to log into my app. Turns out that's not enough.
In this brave new world, Google users can log into YouTube without actually creating a YouTube account. In the YouTube UI, a YouTube account is a "channel". It is now possible to log into YouTube and not have a channel.
To create a channel, click the user menu (represented by your profile picture) in the top-right corner of the page and click "My Channel". You'll be prompted to create one.
Then you can log in with YouTube OAuth.

Resources