Last active
August 14, 2026 03:15
-
-
Save stek29/8a7ac0e673818917525ec4031d77a713 to your computer and use it in GitHub Desktop.
Extract Telegram messages from db_sqlite PostBox – made for Telegram for macOS, but should work with Telegram for iOS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Postbox Media and Forward Export Review
Hi @stek29,
Thanks again for the work and research on Postbox media and forwarded-message support. I have put together a PR that brings those ideas into this repository in a reviewable branch.
PR: soakes/telegram-message-exporter#5
Branch:
feature/media-forwards-postboxRather than merging the fork directly, I selectively reimplemented the useful parts so we could keep the existing CLI behaviour, avoid unrelated README/repo URL changes, and add tests around the new parsing/export paths.
What Changed
--media-diroption.postbox/mediadirectory when possible.--me-nameoption for outgoing speaker labels.--debugoption for SQL key ranges and query plans.--contactlookup so filtered exports can resolve peer names correctly.CSV and Render Behaviour
How To Try It
git fetch origingit checkout feature/media-forwards-postboxpython -m pip install -e .telegram-exporter export --db /path/to/plaintext/db_sqlite --peer-id 123456789 --format html --out chat.html --media-dir /path/to/account/postbox/mediatelegram-exporter export --db /path/to/account/postbox/db/db_sqlite --peer-id 123456789 --format html --out chat.htmlIf the database path is inside
postbox/db/and the siblingpostbox/media/directory exists, the tool should pick it up automatically.Verification Already Done
black --check src/telegram_message_exporter tests telegram_exporter.py .github/scripts/bump_version.pyruff check src/telegram_message_exporter tests telegram_exporter.py .github/scripts/bump_version.pypylint src/telegram_message_exporter telegram_exporter.pypython -m pytest -q, currently14 passedpython telegram_exporter.py --help && python telegram_exporter.py export --helpReview Request
Could you please check out the branch and try it against your Telegram data, especially exports with forwarded messages and cached media?
The main things to confirm are:
--me-namestill labels outgoing messages the way you expect.--contactand--peer-idboth work for your Postbox database.If you are happy with the branch, I will merge the PR.