I'm trying to find a way to retrieve my own private playlists from YouTube, for display on my own personal website. So far, all the documentation appears to say that retrieving private user data (like private playlists) requires that your site's users go through an authentication process in order to provide their own authentication.
In my case, I don't wan't my users to authenticate, I want my site to authenticate to my own account every time it accesses the Youtube Data API, in order to retrieve my own private playlists.
Is that possible? I thought it might be doable if I could just save the authentication token for my own account, but apparently the token changes? And what's the most appropriate method by which I should obtain the initial authorization token for my own account?
You can go through the OAuth 2 for Installed Applications flow once, and generate and save a refresh token. Your server-side code can then use the refresh token to get a valid access token whenever it needs to make an API call on your behalf. This could be completely hidden from the visitors of your website if you code it correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With