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

Error making post #49

Closed
amanthei opened this issue Jan 24, 2017 · 6 comments
Closed

Error making post #49

amanthei opened this issue Jan 24, 2017 · 6 comments

Comments

@amanthei
Copy link

Hello,

Trying to use the post method for a text post.

t = Tumblpy(TUMBLR_CONSUMER_KEY, TUMBLR_CONSUMER_SECRET,
            TUMBLR_ACCESS_KEY, TUMBLR_ACCESS_SECRET)

        blog_url = t.post('user/info')
        blog_url = blog_url['user']['blogs'][0]['url']
        blog_url = blog_url.replace('http://', '')
        blog_url = blog_url.replace('/', '')
        print(blog_url)

        try:
            if image:
                #Create a photo post using a local filepath
                post = t.post('post', blog_url=blog_url, params={'type':'photo', 'caption': text, 'data': image})
            elif url:
                #Create a link post
                post = t.post('post', blog_url=blog_url, params={'type':'link', 'url': url, 'description': text})
            else:
                print('im definitely text')
                #Create a text post
                post = t.post('post', blog_url=blog_url, params={'type':'text', 'body': text})
        except Exception as e:
            import pdb; pdb.set_trace()
            print(e)

        return HttpResponse(status=200)

The text is just a normal string. I'm using Pythin 3.4.

Error is tumblpy.exceptions.TumblpyError: There was an error making your request. and error_code is 404

Any ideas why this isn't working? Thanks!

@megagorilla
Copy link

I had this too, for a temporary fix do: pip install python-tumblpy==1.1.0

@michaelhelmick
Copy link
Owner

Hi @amanthei, which version of Tumblpy are you using and what does blog_url print out as?

@amanthei
Copy link
Author

Hey @michaelhelmick I was using 1.1.3. Just tried @megagorilla's temporary fix of rolling back to 1.1.0 and that worked perfectly. blog_url (before replacing characters in the code above, which I tried in case it was supposed to be without the http://) correctly prints out as my blog url: http://thedirectory.tumblr.com/

@michaelhelmick
Copy link
Owner

Thanks! I don't use the Tumblr api too often anymore, but I'll try and debug this personally this week!

@michaelhelmick
Copy link
Owner

python-tumblpy==1.1.4 is out! Should fix this issue!

@amanthei
Copy link
Author

amanthei commented Feb 8, 2017

Brilliant, thanks!

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

3 participants