tumblr / pytumblr

A Python Tumblr API v2 Client
Apache License 2.0
723 stars 196 forks source link

Create a photoset post using several urls #114

Open aomizuan opened 6 years ago

aomizuan commented 6 years ago

i cant figure out how create photoset using several urls if someone could explain to me, it whould be great

nobbyfix commented 6 years ago

The Tumblr API doesn't allow to post a photoset using multiple urls, you'd have to send them using the data tag. https://www.tumblr.com/docs/en/api/v2#posting

Wittionary commented 5 years ago

#Creates a photoset post using several local filepaths
client.create_photo(blogName, state="draft", tags=["jb is cool"], format="markdown",
                    data=["/Users/johnb/path/to/my/image.jpg", "/Users/johnb/Pictures/kittens.jpg"],
                    caption="## Mega sweet kittens")
poulp commented 5 years ago

I'm checking the documentation and I see that there is another endpoint to create a new post entry (/posts instead of /post wich is currently used and marked as legacy).

So it's possible to create a post with a photoset coming for severals urls images using the new format set up by the tumblr api (https://www.tumblr.com/docs/npf). But this change involve some extra work on this library because other post creation (text, video, etc.) will be impacted.