tuber icon indicating copy to clipboard operation
tuber copied to clipboard

Unable to read token from:.httr-oauth

Open MislavSag opened this issue 3 years ago • 5 comments

I am not sure if I set up the app and oauth the right way, but I am getting following error after calling yt_oauth(my_id, my_secret):

Error in yt_oauth(client_id, client_secret) : 
  Unable to read token from:.httr-oauth

I have downloaded developed version of the package.

In docs, it says I should 'other' application app, but other was not available in choices, so I have chosen desktop app. I am not sure if that is important.

MislavSag avatar Feb 25 '21 12:02 MislavSag

By default, the yt_oauth function looks for an access token stored in a file named .httr-oauth. If you run the authentication for the first time or did not store the token in a file before, it may help to add the argument token = "" when running the yt_oauth command: yt_oauth(app_id = "your_app_id", app_secret = "your_app_secret", token = "")

jobreu avatar Mar 01 '21 22:03 jobreu

would you have time to do a simple PR here @jobreu? thank you!

soodoku avatar Mar 01 '21 23:03 soodoku

Should I just add what I wrote above to the README?

jobreu avatar Mar 01 '21 23:03 jobreu

Good q. Not clear to me if there is something broken in yt_oauth that we need this extra explicit empty param. @muschellij2 any opinion?

good to hold off @jobreu till @muschellij2 gets back

soodoku avatar Mar 01 '21 23:03 soodoku

If that's the case, then you can probably do

file.remove(".httr-oauth")
yt_oauth()

I also sent a small PR to clean up oauth code.

muschellij2 avatar Mar 02 '21 02:03 muschellij2