feat: počítání sdílených médií v týdenním i měsíčním přehledu
This commit is contained in:
@@ -82,7 +82,13 @@ def main():
|
||||
|
||||
tag_counts = {}
|
||||
candidates = []
|
||||
media_count = {"image": 0, "video": 0, "gifv": 0, "audio": 0, "total": 0}
|
||||
for toot in timeline:
|
||||
for att in toot.get("media_attachments", []):
|
||||
att_type = att.get("type", "")
|
||||
media_count["total"] += 1
|
||||
if att_type in media_count:
|
||||
media_count[att_type] += 1
|
||||
if toot.get("language") != "cs":
|
||||
continue
|
||||
if "@" in toot.get("account", {}).get("acct", ""):
|
||||
@@ -151,6 +157,7 @@ def main():
|
||||
"top": top,
|
||||
"tags": tags,
|
||||
"top_links": top_links,
|
||||
"media_count": media_count,
|
||||
}, f, ensure_ascii=False, indent=2)
|
||||
|
||||
print(f"Uloženo: {out_path} ({len(timeline)} tootů načteno, {len(top)} top, {len(tags)} hashtagů)")
|
||||
|
||||
Reference in New Issue
Block a user