Skip to main content

Tumblr with no OAuth

TL;DR: tumblr_noauth is a Python package which provides a TumblrSession(email, password) class which extends requests.Session and provides a Tumblr login/logout process.

Tumblr supplies an OAuth API which you can use for fairly simple tasks, mostly for dashboard-like functions; there’s a lot left out, such as

  • Checking if a URL is available for creating a new blog; the endpoint at www.tumblr.com/check_if_tumblelog_name_is_available requires authentication
  • Probably others which I forget

With no official way to access that data, tumblr_noauth provides a workaround: emulate a whole Tumblr “session”; you feed it a username and password (which aren’t stored, even in the TumblrSession object) and it performs a login request (and a logout request with __exit__ or at the end of the with clause).

Under the hood, a TumblrSession is a requests.Session with some special behavior optimized for use with Python’s with statements.

The following methods in a TumblrSession object are specialized to make the https://www.tumblr.com/ prefix optional:

  • delete
  • get
  • head
  • options
  • patch
  • post
  • put

i.e. the high-level HTTP requests.

Example usage:

import json
import tumblr_noauth

with open('creds.json') as f:
    creds = json.load(f)

with TumblrSession(creds['email'], creds['password']) as session:
    data = {'name': staff}
    resp = session.post('check_if_tumblelog_name_is_available',
    data=data)

    print(resp, ';', resp.text)

Where the with clause automatically logs in and out of Tumblr.

For additional “authenticity”, you might want to set your headers to something like...

# this is lying
headers = {
    'Host': 'www.tumblr.com',
    'Origin': 'https://www.tumblr.com',
    'Referer': 'https://www.tumblr.com/dashboard',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36',
    'X-Requested-With': 'XMLHttpRequest',
}

Metadata

Release files for tumblr-noauth 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for tumblr-noauth 0.1.0
File Interpreter ABI Platform Actions
tumblr_noauth-0.1.0-py3-none-any.whl Python 3 none any Details for tumblr_noauth-0.1.0-py3-none-any.whl

Release files / tumblr_noauth-0.1.0-py3-none-any.whl

Download URL tumblr_noauth-0.1.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1339b1d4d49e9de7baa504cc369dfa6741595fd6bfeed975b702819ec3738149
BLAKE2b-256 checksum
How to use checksums
d43c50d176bcb7992b448b55926ffa49094a81f752a5ac1cba82eec22e1a19cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for tumblr-noauth 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page