]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 24 May 2023 06:40:12 +0000 (08:40 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 24 May 2023 06:40:12 +0000 (08:40 +0200)
- no shortening of packages

fba.py

diff --git a/fba.py b/fba.py
index 79adabf1ae905d0c1134537c1c1644b2a05b8cec..a4d3b737bad4cd248e4cbc929b3823344426d5a7 100644 (file)
--- a/fba.py
+++ b/fba.py
@@ -1,10 +1,9 @@
-from bs4 import BeautifulSoup
-from hashlib import sha256
-
-import reqto
+import bs4
+import hashlib
 import re
-import sqlite3
+import reqto
 import json
+import sqlite3
 import sys
 import time
 import validators
@@ -73,7 +72,7 @@ def is_blacklisted(domain: str) -> bool:
     return blacklisted
 
 def get_hash(domain: str) -> str:
-    return sha256(domain.encode("utf-8")).hexdigest()
+    return hashlib.sha256(domain.encode("utf-8")).hexdigest()
 
 def update_last_blocked(domain: str):
     # NOISY-DEBUG: print("DEBUG: Updating last_blocked for domain", domain)
@@ -576,7 +575,7 @@ def get_mastodon_blocks(domain: str) -> dict:
     }
 
     try:
-        doc = BeautifulSoup(
+        doc = bs4.BeautifulSoup(
             reqto.get(f"https://{domain}/about/more", headers=headers, timeout=(config["connection_timeout"], config["read_timeout"])).text,
             "html.parser",
         )
@@ -614,7 +613,7 @@ def get_friendica_blocks(domain: str) -> dict:
     blocks = []
 
     try:
-        doc = BeautifulSoup(
+        doc = bs4.BeautifulSoup(
             reqto.get(f"https://{domain}/friendica", headers=headers, timeout=(config["connection_timeout"], config["read_timeout"])).text,
             "html.parser",
         )