Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class NSASimulator:
BASE_URL = "https://api.gotinder.com/"

def __init__(self, facebook_auth_filename=SECRETS_FILENAME):
self.sesh = requests.Session()

# Look I have no idea what these are I just copy/pasted
# them from the API call my phone makes. If this makes
Expand Down Expand Up @@ -63,7 +64,7 @@ def _auth(self):
connected to your Facebook account sorry fam.

"""
response = requests.post(self.BASE_URL + "auth", data=self.fb_auth)
response = self.sesh.post(self.BASE_URL + "auth", data=self.fb_auth)
if response.status_code == 200:
self.headers["X-Auth-Token"] = response.json()["token"]
print("Authenticated to Tinder 馃敀馃敟")
Expand All @@ -75,7 +76,7 @@ def _auth(self):
def _get(self, url):
if not self.authed:
self._auth()
response = requests.get(self.BASE_URL + url, headers=self.headers)
response = self.sesh.get(self.BASE_URL + url, headers=self.headers)
print(response.text)
return response

Expand Down