tumblr-utils icon indicating copy to clipboard operation
tumblr-utils copied to clipboard

Feature: Save drafts using OAuth

Open stirdraws opened this issue 6 years ago • 13 comments

Any way to go about this other than privately posting all 4k of my drafts?

stirdraws avatar Dec 04 '18 22:12 stirdraws

Why would you have 4k drafts?

bbolli avatar Dec 04 '18 22:12 bbolli

You can try to change the API URL. As explained here: https://www.tumblr.com/docs/en/api/v2#postsdraft--retrieve-draft-posts the only change is the addition of /drafts after /posts.

bbolli avatar Dec 04 '18 22:12 bbolli

Looks like drafts require oauth as well.

m----r avatar Dec 05 '18 00:12 m----r

I have adhd and kept saving things to read for when my brain wasn't crapping out, and then failing to clear them. A lot. Over basically a decade. Thanks very much, I'll give this a shot!

stirdraws avatar Dec 05 '18 04:12 stirdraws

Having authentication errors because I can't seem to nail down what to do here... I have my keys and tokens, but I'm a bit confused per the tumble.py directions to "prepare the file ~/.config/tumblr" with them. Is that a directory on the computer itself? If so, I'm on a macbook running OS X 10.7 and may need an alternate path; I appreciate any clarification or direction on how to proceed you can give me.

stirdraws avatar Dec 05 '18 10:12 stirdraws

I'm sorry, the OAuth instructions are only valid for tumble.py. I didn't notice this when researching the drafts API. tumblr_backup.py doesn't currently support OAuth-entication.

~ is just a shorthand notation for your home directory.

bbolli avatar Dec 05 '18 15:12 bbolli

I don't suppose it's as simple as moving the relevant code from tumble.py to tumblr_backup.py and editing some references, is it?

I'm a self-taught spaghetti coder and a lot of this is outside my existing experience, so layman's terms are appreciated.

stirdraws avatar Dec 05 '18 18:12 stirdraws

You can always give it a try!

bbolli avatar Dec 05 '18 23:12 bbolli

I gave it my best! No dice, unfortunately; can't get it to authenticate and save drafts at all.

The inability to access hidden posts is frustrating, but I'm grateful for the help and the ability to experiment with it. And I learned a lot, so I can't consider it a waste of time despite the lack of desired results.

Thanks for all the help!

stirdraws avatar Dec 09 '18 00:12 stirdraws

Erm, now we have no issue to track this. It's probably possible to implement. Could someone reopen?

cebtenzzre avatar Dec 09 '18 16:12 cebtenzzre

With access to the API key and secret, it should be relatively easy to use tumblr/pytumblr to allow the user to use OAuth to save likes, drafts, etc.. This would also be a workaround for NSFW blogs that can't download some likes, because with account-level access the likes are exposed regardless of whether the blog is marked explicit, or whether or not the likes are made public.

I'd do it myself and submit a pull request, but I don't have access to an API key that isn't rate limited, and I doubt that Tumblr would get back to me in time for the apocalypse in two days. If whoever provided the API key for this could also provide the secret (or if it's already in there point me to it, because if it is there I'm blind), I could try and throw something together. Don't work too much in Python, though, so it probably won't be pretty.

ann4belle avatar Dec 15 '18 19:12 ann4belle

Same predicament as stirdraws, I'm also interested in an enhancement that would preserve drafts. Luckily enough, some explicit posts saved in my drafts were still viewable after the purge but I don't know how long that'll last. Very interested if this issue could be implemented!

nyansensei avatar Dec 20 '18 07:12 nyansensei

This is covered by PR #200. It requires a config file at ~/.config/tumblr. See the docstring in tumble.py for instructions on how to create this file. Anybody on Windows should edit tumblr_utils.py and change the CONFIG variable at the top to some other path (with backslashes escaped, e.g 'C:\\Users\\Me\\tumblr_config.txt'), since the default is for Unix-like systems.

cebtenzzre avatar Dec 21 '18 19:12 cebtenzzre