feat: přidán --init mode, --dry-run, filtr created_at

This commit is contained in:
2026-04-04 14:48:57 +02:00
parent 3f8e184499
commit 64731e6b90
2 changed files with 23 additions and 1 deletions
+22
View File
@@ -86,8 +86,30 @@ def save_welcomed(welcomed):
parser = argparse.ArgumentParser()
parser.add_argument("--dry-run", action="store_true", help="Pouze vypíše co by se stalo, nic neodesílá")
parser.add_argument("--init", action="store_true", help="Stáhne všechny existující účty a uloží jejich ID do welcomed.json bez odesílání tootů")
args = parser.parse_args()
# --- --init: označit všechny existující účty jako uvítané ---
if args.init:
all_ids = set()
max_id = None
while True:
params = "limit=80"
if max_id is not None:
params += f"&max_id={max_id}"
page = api_get(f"/api/v1/admin/accounts?{params}", ADMIN_TOKEN)
if not page:
break
for account in page:
all_ids.add(account["id"])
max_id = page[-1]["id"]
print(f"[INIT] Načteno celkem {len(all_ids)} účtů...", end="\r")
print()
save_welcomed(all_ids)
print(f"[INIT] Hotovo uloženo {len(all_ids)} ID do welcomed.json")
raise SystemExit(0)
# --- Hlavní logika ---
accounts = api_get("/api/v1/admin/accounts?order=newest&limit=20", ADMIN_TOKEN)
+1 -1
View File
@@ -1 +1 @@
["116099549727519820", "116127273263382313", "116128177820418097", "116141792826154864", "116144286217194293", "116154657073269480", "116158614490312678", "116170256054539646", "116170614642317484", "116178404922095929", "116193071329347528", "116198302059185321", "116205281310353001", "116227624836913979", "116237145399664481", "116288673489103920", "116289664908714786", "116299265563853066", "116329847494946855", "116342628895905045"]
["111299880936395867", "111300530055223178", "111303126013641107", "111578218947353065", "111601954370432109", "111674651383349773", "111873873110655657", "112355689592684680", "112438564807807490", "112574672032878502", "112675777055003908", "112709476659443150", "112739098293657507", "112741544668000928", "112745062183416743", "112818664816843315", "112820694864962890", "112837400250793113", "112897314632055551", "113282571866320576", "113346419895350585", "113414821289392559", "113419032041224169", "113422527804017068", "113423958224029742", "113436948208617961", "113584782122369864", "113612139041364539", "113746402116793864", "113775741416053817", "113855208804139906", "113866969055176747", "114035374008935754", "114111947806034579", "114329498380846786", "114331054470320761", "114332057789647256", "114573021864809970", "114754699853870877", "114768222471230250", "114800505767001579", "114802624020999935", "114809850010323770", "114816189774820526", "114828993685959216", "114907789225667037", "114908755569728280", "114917698472491117", "114923190623512092", "114931667279457051", "115112892803206481", "115226654433430601", "115484595111398544", "115604456101243920", "115621849682974145", "115631605322729475", "115670923896520439", "115677933573549294", "115742168682741746", "115746832959608679", "115751267024401232", "115756733930694201", "115792774667742818", "115792839218530447", "115792935261008225", "115793053194345586", "115793159331732170", "115815052704334823", "115850193177172021", "115899590892649527", "115906158504000780", "115917171539457542", "116013266197178500", "116030166855398462", "116030707491594106", "116030905237057489", "116034290748145615", "116034291458992113", "116034293175672844", "116034737898962177", "116037632095653693", "116039910560012096", "116042425044045145", "116042691766450651", "116045574706726446", "116046142351334160", "116046966196977400", "116047711214202222", "116058671648672552", "116063312277791332", "116074759187739237", "116075600922900182", "116076020740032625", "116085242689566116", "116095985988684838", "116098164756587866", "116099549727519820", "116127273263382313", "116128177820418097", "116141792826154864", "116144286217194293", "116154657073269480", "116158614490312678", "116170256054539646", "116170614642317484", "116178404922095929", "116193071329347528", "116198302059185321", "116205281310353001", "116227624836913979", "116237145399664481", "116288673489103920", "116289664908714786", "116299265563853066", "116329847494946855", "116342628895905045"]