From 9220955381c2ceb9812435b582187c112e59626c Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 29 Sep 2023 20:34:26 -0400 Subject: [PATCH] fix(patreon): use patreon api --- update.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/update.py b/update.py index 6075ab0d..9a4cf9e0 100644 --- a/update.py +++ b/update.py @@ -3,7 +3,6 @@ import json import os import pathlib -import re # lib imports import cloudscraper @@ -193,13 +192,11 @@ def update_patreon(): Get patron count from Patreon. """ print('Updating Patreon data...') - patreon_url = 'https://www.patreon.com/LizardByte' + patreon_url = 'https://www.patreon.com/api/campaigns/6131567' response = s.get(url=patreon_url) - data = dict( - patron_count=int(re.search(r'\"patron_count\":\s(\d+)', response.text).group(1)) - ) + data = response.json()['data']['attributes'] file_path = os.path.join('patreon', 'LizardByte') write_json_files(file_path=file_path, data=data)