Load blocklists from ClearSky

Signed-off-by: Markus Birth <markus@birth-online.de>
This commit is contained in:
2026-05-13 13:26:21 +01:00
parent 7034050a4f
commit 2f7663117c
+11 -6
View File
@@ -47,7 +47,7 @@ class BlueBackBlocker():
return results
def add_to_list(self):
def add_to_list(self, list_uri: str, user_did: str):
pass
class ClearSky():
@@ -137,13 +137,18 @@ def main():
if not item_did in already_blocked:
to_block.add(item_did)
print(f"[bold red]{len(to_block)}[/bold red] users are not on our list yet. ([bold green]{len(blocked_by)-len(to_block)}[/bold green] are.)")
#print(blocked_by)
"""
# Lists I'm on that people subscribed to
subscribe_blocks_im_on = cs.get_subscribed_blocklists()
print(subscribe_blocks_im_on)
"""
task_csky_users = prog.add_task(f"Loading subscribed blocklists I'm on")
subscribed_blocklists_im_on = cs.get_subscribed_blocklists(lambda cur, tot: prog.update(task_csky_users, completed=cur, total=tot))
print(f"ClearSky returned [bold yellow]{len(subscribed_blocklists_im_on)}[/bold yellow] blocklists I'm on and others subscribed to.")
prev_len = len(to_block)
for item in subscribed_blocklists_im_on:
item_did = item["list_owner"]
if not item_did in already_blocked:
to_block.add(item_did)
print(f"[bold red]{len(to_block)-prev_len}[/bold red] list owners are not on our list yet.")
#print(subscribed_blocklists_im_on)
if __name__ == "__main__":
main()