]> git.mxchange.org Git - fba.git/commitdiff
added other instances to preload
authorEnju Aihara <5-EnjuAihara@users.noreply.gitlab.varis.social>
Fri, 4 Mar 2022 15:46:50 +0000 (16:46 +0100)
committerEnju Aihara <5-EnjuAihara@users.noreply.gitlab.varis.social>
Fri, 4 Mar 2022 15:46:50 +0000 (16:46 +0100)
blocks_preloaded.db
preload_db.py

index 41f5482659d9109fb79428e915004f2b80a4c300..31395d4215b28f338444967a7989a787e9c3a766 100644 (file)
Binary files a/blocks_preloaded.db and b/blocks_preloaded.db differ
index fde4eaf377f82fdb8bc583b1f091aab258d5e403..ac6aa284f059f73e1f504590ba381ca6bfad7a84 100644 (file)
@@ -1,7 +1,7 @@
 import sqlite3
 from hashlib import sha256
 
-conn = sqlite3.connect("blocks_default.db")
+conn = sqlite3.connect("blocks_preloaded.db")
 c = conn.cursor()
 
 with open("pleroma_instances.txt", "r") as f:
@@ -14,4 +14,12 @@ with open("mastodon_instances.txt", "r") as f:
     while line := f.readline():
         print(line.rstrip(), sha256(bytes(line.rstrip(), "utf-8")).hexdigest())
         c.execute(f"insert into instances select \"{line.rstrip()}\", \"{sha256(bytes(line.rstrip(), 'utf-8')).hexdigest()}\"")
-        conn.commit()
\ No newline at end of file
+        conn.commit()
+
+with open("other_instances.txt", "r") as f:
+    while line := f.readline():
+        print(line.rstrip(), sha256(bytes(line.rstrip(), "utf-8")).hexdigest())
+        c.execute(f"insert into instances select \"{line.rstrip()}\", \"{sha256(bytes(line.rstrip(), 'utf-8')).hexdigest()}\"")
+        conn.commit()
+
+conn.close()
\ No newline at end of file