manojkarthick / reddsaver

CLI tool to download saved and upvoted media from Reddit
Apache License 2.0
143 stars 9 forks source link

Unable to get access token #21

Closed bastiano closed 3 years ago

bastiano commented 3 years ago

Installed in archlinux from the AUR repository. I followed the running instructions in this page. The command "reddsaver -e reddsaver.env -d reddsaver --show-config" didn't show configuration errors. But the next command did:

 % reddsaver -e reddsaver.env -d reddsaver  
Error: ReqwestError(reqwest::Error { kind: Decode, source: Error("missing field `access_token`", line: 1, column: 41) })

Dunno what to do.

manojkarthick commented 3 years ago

Hi @bastiano - The error basically means that the program was unable to get an access token from the Reddit API.

Possible reasons why this might be happening:

Could you check if any of the above is the issue you are facing?

If none of the above works for you: can you run RUST_LOG=debug reddsaver -e reddsaver.env -d reddsaver and add the output here? (It might contain sensitive values such as your password, so make sure to mask them before commenting). This can help with additional debugging on my end. Thanks!

bradym commented 3 years ago

I ran into the same error. On a hunch I quoted my password in the .env file and it started working. Seems like one of the special characters in my password may have been causing the issue for me.

bastiano commented 3 years ago

Hi @manojkarthick

at the end of the output of these commands I get always the same message in the last line "Error: UrlError(RelativeUrlWithoutBase)"

I have set the url at "http://localhost:8080" as it is in the Running instructions.

manojkarthick commented 3 years ago

I ran into the same error. On a hunch I quoted my password in the .env file and it started working. Seems like one of the special characters in my password may have been causing the issue for me.

Thanks @bradym - would you mind sharing what special character that was so I can try to reproduce the error?

manojkarthick commented 3 years ago

Hi @manojkarthick

* Config is fine

* I don't use Two Factor Authentication

* When running the commands:

  * "env -i reddsaver -e reddsaver.env -d reddsaver"
  * "RUST_LOG=debug reddsaver -e reddsaver.env -d reddsaver"
  * "reddsaver -e reddsaver.env -d reddsaver"

at the end of the output of these commands I get always the same message in the last line "Error: UrlError(RelativeUrlWithoutBase)"

I have set the url at "http://localhost:8080" as it is in the Running instructions.

Hi @bastiano - I released v0.3.1 with a fix for the UrlError issue. Could you update and give a try?

bastiano commented 3 years ago

Good! @manojkarthick It's working perfectly after update. It's great that it makes a subfolder for every subreedit. Thanks!

bastiano commented 3 years ago

Thanks @bradym for the suggestion. I quoted my password too.

bradym commented 3 years ago

@manojkarthick my password includes !, # and *. I'm not sure which one was the issue, I'm guessing ! or #.

manojkarthick commented 3 years ago

Thanks @bradym and @bastiano - I've updated the README example to include quotes, I will close this issue. Please feel free to create a new issue if you encounter any problems.