{"id":13732273,"url":"https://github.com/knadh/tg-archive","last_synced_at":"2025-05-14T07:08:11.325Z","repository":{"id":37933961,"uuid":"348447943","full_name":"knadh/tg-archive","owner":"knadh","description":"A tool for exporting Telegram group chats into static websites like mailing list archives.","archived":false,"fork":false,"pushed_at":"2025-03-13T06:08:56.000Z","size":73,"stargazers_count":986,"open_issues_count":30,"forks_count":153,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-11T19:13:24.153Z","etag":null,"topics":["exporter","static-site","static-site-generator","telegram","telegram-api","telegram-export"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knadh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-16T18:12:15.000Z","updated_at":"2025-04-08T16:05:50.000Z","dependencies_parsed_at":"2024-10-23T10:52:22.680Z","dependency_job_id":"b76f0057-c181-4282-83b3-fa68fb222dce","html_url":"https://github.com/knadh/tg-archive","commit_stats":{"total_commits":54,"total_committers":13,"mean_commits":4.153846153846154,"dds":"0.35185185185185186","last_synced_commit":"ac44043a474b1d1984bf7391709bd3879b7e5000"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Ftg-archive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Ftg-archive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Ftg-archive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knadh%2Ftg-archive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knadh","download_url":"https://codeload.github.com/knadh/tg-archive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092656,"owners_count":22013290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exporter","static-site","static-site-generator","telegram","telegram-api","telegram-export"],"created_at":"2024-08-03T02:01:51.285Z","updated_at":"2025-05-14T07:08:11.306Z","avatar_url":"https://github.com/knadh.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\n![favicon](https://user-images.githubusercontent.com/547147/111869334-eb48f100-89a4-11eb-9c0c-bc74cdee197a.png)\n\n\n**tg-archive** is a tool for exporting Telegram group chats into static websites, preserving chat history like mailing list archives.\n\n**IMPORTANT:** I'm no longer actively maintaining or developing this tool. Can review and merge PRs (as long as they're not massive and are clearly documented).\n\n## Preview\nThe [@fossunited](https://tg.fossunited.org) Telegram group archive.\n\n![image](https://user-images.githubusercontent.com/547147/111869398-44188980-89a5-11eb-936f-01d98276ba6a.png)\n\n\n## How it works\ntg-archive uses the [Telethon](https://github.com/LonamiWebs/Telethon) Telegram API client to periodically sync messages from a group to a local SQLite database (file), downloading only new messages since the last sync. It then generates a static archive website of messages to be published anywhere.\n\n## Features\n- Periodically sync Telegram group messages to a local DB.\n- Download user avatars locally.\n- Download and embed media (files, documents, photos).\n- Renders poll results.\n- Use emoji alternatives in place of stickers.\n- Single file Jinja HTML template for generating the static site.\n- Year / Month / Day indexes with deep linking across pages.\n- \"In reply to\" on replies with links to parent messages across pages.\n- RSS / Atom feed of recent messages.\n\n## Install\n- Get [Telegram API credentials](https://my.telegram.org/auth?to=apps). Normal user account API and not the Bot API.\n  - If this page produces an alert stating only \"ERROR\", disconnect from any proxy/vpn and try again in a different browser.\n\n- Install with: `uv pip install tg-archive` (tested with Python 3.13.2).\n\n### Usage\n\n1. `tg-archive --new --path=mysite` (creates a new site. `cd` into mysite and edit `config.yaml`).\n1. `tg-archive --sync` (syncs data into `data.sqlite`).\n  Note: First time connection will prompt for your phone number + a Telegram auth code sent to the app. On successful auth, a `session.session` file is created. DO NOT SHARE this session file publicly as it contains the API autorization for your account.\n1. `tg-archive --build` (builds the static site into the `site` directory, which can be published)\n\n### Customization\nEdit the generated `template.html` and static assets in the `./static` directory to customize the site.\n\n### Note\n- The sync can be stopped (Ctrl+C) any time to be resumed later.\n- Setup a cron job to periodically sync messages and re-publish the archive.\n- Downloading large media files and long message history from large groups continuously may run into Telegram API's rate limits. Watch the debug output.\n\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknadh%2Ftg-archive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknadh%2Ftg-archive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknadh%2Ftg-archive/lists"}