From b92bab7f1a484ff17dc0b376e947531c357c198a Mon Sep 17 00:00:00 2001 From: Watchful1 Date: Thu, 21 Sep 2023 19:30:09 -0700 Subject: [PATCH] Handle the incorrect reauth --- personal/combine/merge_and_backfill.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/personal/combine/merge_and_backfill.py b/personal/combine/merge_and_backfill.py index f41a12d..8148262 100644 --- a/personal/combine/merge_and_backfill.py +++ b/personal/combine/merge_and_backfill.py @@ -66,7 +66,6 @@ def re_auth_pushshift(old_token): sys.exit(1) - def query_pushshift(ids, bearer, object_type): object_name = "comment" if object_type == ObjectType.COMMENT else "submission" url = f"https://api.pushshift.io/reddit/{object_name}/search?limit=1000&ids={','.join(ids)}" @@ -85,7 +84,7 @@ def query_pushshift(ids, bearer, object_type): if response.status_code == 200: break if response.status_code == 403: - log.warning(f"Pushshift 403, trying reauth") + log.warning(f"Pushshift 403, trying reauth: {response.json()}") log.warning(url) log.warning(f"'Authorization': Bearer {bearer}") bearer = re_auth_pushshift(bearer)