Create authenticated session to Patreon with Google credentials in Python

Hello,

I’m writing a script to download a few assets from campaigns I support in python, and I am having difficulty understanding how to properly authenticate to patreon through my google account. I have read a number of the docs concerning this subject, but they all seem to assume that I am trying to use patreon as the OAuth IDP, which I am not. All I want to do is be able to download a few files after logging in properly. I have the following questions/thoughts:

  • I assume that what I am trying to accomplish is called ‘OAuth2 authentication’, not Authorization - My google account already has permission to access patreon. I just want to use that account to programmatically access subscribed content.
  • I have created a client in my patreon account.
  • I do not understand what any documentation means when it refers to a ‘redirect url’. In my patreon client I’ve simply set it to ‘https://example.com’. I understand what the concept of the redirect url is, but I don’t see any indication about what it should be for my use case. Am I just redirecting back to the home page of patreon after I authenticate or what?
  • When I look at the patreon-python package, the example seems to solely concern itself with the client_id, client_secret, and redirect url for patreon - I don’t see anything about how to authenticate via google, the same way that a human would click on the ‘sign in with google’ button.
  • I am NOT using Flask. I am NOT making an application that is meant to be logged into itself. I am writing a script that is meant to use my google credentials to create an authenticated session to patreon so that I can download a few files.

Can someone please help me understand what I need to do? I know that the tools I should use are requests-oauthlib, requests, and/or patreon-python, but I don’t understand what the inputs need to be for authenticating to patreon as my google user in a python script. This is incredibly frustrating and the only examples seem to assume that I’m creating my own application that I want to provide authorization and authentication to via google, and that’s not what I want at all.

Your Google account accessing patreon.com would not enable it to be able to call the api or get involved by the api.

In order to call the api, you must have a relevant and valid token.

Redirect uri is the uri where patreon.com will return the user after the authorization flow, at which your app should take the authorization code, contact the api in order to get valid tokens.

Python package may be outdated. Authentication via Google would need to be custom coded for your app. It is not something that is provided by the api (like any other api).

I am writing a script that is meant to use my google credentials to create an authenticated session to patreon so that I can download a few files

If you are going to download other creators’ files, those creators must go through an app you built and give permission to it through the authentication flow. Only with such authorized tokens you could access their files.

If you want to download your own files, you can just c/p the creator access token that is in your app details at Platform | Applications | Patreon , and use it to call the api without needing to authorize.

PHP lib is up to date and is a popular lib that is used by many. You can just copy its logic or drop it in somewhere to use it as an intermediary for your api processes.

If you are going to download other creators’ files, those creators must go through an app you built and give permission to it through the authentication flow. Only with such authorized tokens you could access their files.

@codebard I don’t understand how this is possible - If I log into the Patreon site, I can manually click on the links to files posted in other creator’s campaigns and just download them. The creators don’t have to use or accept the use of any kind of app for that to happen. That’s what I’m looking to do. I’m not interested in performing an API action really unless I need it to create some kind of token to authenticate a session. I want to simulate the kind of request that is done when asking to download a file. My understanding of how to do this is to create a session with the requests module and perform some kind of login action to grant the session access to patreon, the same as any human. Is that not conceivable?

The creators don’t have to use or accept the use of any kind of app for that to happen.

You are a qualifying patron hence patreon.com allows those downloads.

In public api there is no means to effect that. It currently doesn’t support file attachments either. So its not possible at this point.