From e4dd3a63465217cb0d7e73970a5c80f354580b76 Mon Sep 17 00:00:00 2001 From: Enju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com> Date: Wed, 6 Apr 2022 17:31:32 +0200 Subject: [PATCH] use .json() instead of .text --- fetch_blocks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fetch_blocks.py b/fetch_blocks.py index 0522b85..eb4f718 100644 --- a/fetch_blocks.py +++ b/fetch_blocks.py @@ -1,5 +1,4 @@ from requests import get -from json import loads from hashlib import sha256 import sqlite3 from bs4 import BeautifulSoup @@ -51,7 +50,7 @@ for blocker, software in c.fetchall(): try: # Blocks c.execute("delete from blocks where blocker = ?", (blocker,)) - json = loads(get(f"https://{blocker}/nodeinfo/2.1.json").text) + json = get(f"https://{blocker}/nodeinfo/2.1.json").json() if "mrf_simple" in json["metadata"]["federation"]: for mrf in json["metadata"]["federation"]["mrf_simple"]: for blocked in json["metadata"]["federation"]["mrf_simple"][mrf]: -- 2.39.5