tuber icon indicating copy to clipboard operation
tuber copied to clipboard

Add API key authentication

Open gvelasq opened this issue 2 years ago • 3 comments

Hello, thank you for this great package. @ivelasq and I have been working on a GitHub Actions script that uses list_channel_videos() on a schedule, and we were wondering if you would consider a PR that uses the API key flow as opposed to the OAuth token flow.

While right now the package has yt_oauth(), yt_token(), and yt_check_token() for the OAuth flow, we are proposing to add new functions yt_auth_api_key(), yt_api_key(), and yt_check_api_key() for the API key flow. Both flows could share yt_authorized() to check whether a token or API key are available.

We plan to build out the functionality in a fork, to make use of the great functions list_channel_videos() and get_playlist_items(), and thought this might be of interest to others who only need access to limited scopes.

gvelasq avatar Apr 29 '22 22:04 gvelasq

go for it!

i don't see any blockers as long as you don't have 'breaking' changes.

soodoku avatar Apr 29 '22 23:04 soodoku

This would be amazing as I have not managed to go past the initial setup. The instructions for the package mention that the "type" of the application should be set to "Other", but the option does not seem to be there. When using yt_oauth(), I keep getting the error:

You can’t sign in because [App Name] sent an invalid request. You can try again later, or contact the developer about this issue. Learn more about this error.

If you are a developer of [App Name], see error details.
Error 400: redirect_uri_mismatch

gueyenono avatar Sep 10 '22 21:09 gueyenono

Thank you for the interest. This has been on the backburner, but will plan to resume work on this in the next few months.

gvelasq avatar Sep 11 '22 22:09 gvelasq

This is now fixed in the development version of the package. See @ivelasq's blog post using the new functions: https://ivelasq.rbind.io/blog/automated-youtube-dashboard

gvelasq avatar Aug 04 '23 03:08 gvelasq