Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read token from:.httr-oauth #103

Open
MislavSag opened this issue Feb 25, 2021 · 5 comments
Open

Unable to read token from:.httr-oauth #103

MislavSag opened this issue Feb 25, 2021 · 5 comments

Comments

@MislavSag
Copy link

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.

@jobreu
Copy link
Contributor

jobreu commented Mar 1, 2021

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 = "")

@soodoku
Copy link
Member

soodoku commented Mar 1, 2021

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

@jobreu
Copy link
Contributor

jobreu commented Mar 1, 2021

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

@soodoku
Copy link
Member

soodoku commented Mar 1, 2021

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

@muschellij2
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants