]> git.mxchange.org Git - fba.git/commitdiff
use .json() instead of .text
authorEnju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com>
Wed, 6 Apr 2022 15:31:32 +0000 (17:31 +0200)
committerEnju Aihara <9839590-EnjuAihara@users.noreply.gitlab.com>
Wed, 6 Apr 2022 15:31:32 +0000 (17:31 +0200)
fetch_blocks.py

index 0522b851f5d6ddd4ae4bc44861215f7932b89f0d..eb4f718ee8938bef28af58767dd6205623a12e39 100644 (file)
@@ -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]: