added other instances to preload
This commit is contained in:
parent
8bf251b931
commit
187e46376e
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
from hashlib import sha256
|
from hashlib import sha256
|
||||||
|
|
||||||
conn = sqlite3.connect("blocks_default.db")
|
conn = sqlite3.connect("blocks_preloaded.db")
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
|
|
||||||
with open("pleroma_instances.txt", "r") as f:
|
with open("pleroma_instances.txt", "r") as f:
|
||||||
@ -14,4 +14,12 @@ with open("mastodon_instances.txt", "r") as f:
|
|||||||
while line := f.readline():
|
while line := f.readline():
|
||||||
print(line.rstrip(), sha256(bytes(line.rstrip(), "utf-8")).hexdigest())
|
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()}\"")
|
c.execute(f"insert into instances select \"{line.rstrip()}\", \"{sha256(bytes(line.rstrip(), 'utf-8')).hexdigest()}\"")
|
||||||
conn.commit()
|
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()
|
Loading…
x
Reference in New Issue
Block a user