-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
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)
}
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",
)
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",
)