bbolli / tumblr-utils

Utilities for dealing with Tumblr blogs, Tumblr backup
GNU General Public License v3.0
667 stars 124 forks source link

API Key error #214

Closed arturo3982 closed 3 years ago

arturo3982 commented 4 years ago

I am still receiving "HTTP Error 401: Unauthorized getting" error after updating tumblr_backup.py with my unique API key.

cebtenzzre commented 4 years ago

You're pasting in your OAuth consumer key, correct? Reference

arturo3982 commented 4 years ago

Yes, I used the consumer key. I noticed that the key in the API URL does not change no matter what I try.

https://api.tumblr.com/v2/blog/blog.tumblr.com/posts?reblog_info=true&api_key=[Generic Key]&limit=1

cebtenzzre commented 4 years ago

I'm wondering whether you're putting the API key in the right place - it needs to go inside the single quotes on this line: https://github.com/bbolli/tumblr-utils/blob/da3370c157cc40449c852240fdb2fd43cd848020/tumblr_backup.py#L105 There should be no other lines starting with API_KEY = in the file. And to make sure you're editing the right file, you could put raise RuntimeError just before the imports and see if anything changes - it should fail with that exception instead of showing the HTTP error.

arturo3982 commented 4 years ago

Even with raise RuntimeError, I am still receiving the same error message.

cebtenzzre commented 4 years ago

Then you are definitely editing the wrong file. How are you running tumblr-utils? Show me your exact command line, it might look like this:

python C:\path\to\tumblr-utils\tumblr_backup.py blog-name

If it just starts with tumblr_backup.py ... and that script is on your PATH, then maybe you have several copies. In that case, check the output of where tumblr_backup.py in Command Prompt on Windows, or which -a tumblr_utils.py on any other OS.