mirror of
https://github.com/tiennm99/telegram-exporter.git
synced 2026-10-11 03:13:49 +00:00
275ec4757653acbb79b78b247fac543ba51d2c2c
Exports all media from a group to disk, one folder per logical post with albums collapsed, alongside a messages.jsonl sidecar linking every file to its message. Three properties the design is built around: - Identity is filter-invariant. A post's folder is the lowest message id in the full grouped_id group and filenames key on message id, so --types photo and --types video address the same files. A positional index would shift whenever a member message was deleted. - The cursor commits only after a complete post and is unreachable from every error path, so it can never point past in-flight work. - Filters are stored verbatim; a mismatch refuses the run and names what changed, because the cursor means 'handled through here under these filters'. Exactly one untrusted string becomes a path component: the filename leaf, sanitized stem and extension both. Every other component is an int enforced by type. The export directory is the chat id rather than the group title, which makes traversal via a renamed group structurally impossible and stops a mid-export rename from orphaning the download. Downloads are sequential. Telethon does not parallelize transfers, and concurrency mainly accelerates flood-wait escalation from seconds to hours.
telegram-exporter
Languages
Go
100%