HTML → JSON → Telegram
A desktop application for restoring and importing Telegram Desktop chat history: converts an HTML backup to JSON, merges parts, and imports the history into Telegram via Telethon.
Or run from source — instructions below.
- 📦 Convert Telegram Desktop HTML export to JSON
- 🔗 Merge
messages.json,messages2.json, … into a singleresult.json - 📤 Import history into Telegram via Telethon (CheckHistoryImport → Init → UploadMedia → Start)
- 🖼️ Support for all content types:
formatted text, photos, videos, video messages ("circles"), voice messages, stickers
(
.webp/.tgs/.webm), GIFs, documents, locations, polls, contacts, calls, pinned messages, forwarded messages, replies - 🌍 Interface: RU / EN / ES / DE / FR
- 🔐 Login via Telegram/SMS code and 2FA password directly in the GUI
- 🧪 Test mode and importing only the first N messages
- 👥 Sender map (sender_map): names from the backup → real user_ids
- 📊 Progress bars and built-in execution console
| 📦 Converter | 🔗 Merge | 📤 Import |
|---|---|---|
![]() |
![]() |
![]() |
🛡️ Security
The application runs entirely locally: backups, API data, and sessions
are not sent anywhere except Telegram servers.
The release is scanned on VirusTotal — the report is linked in the badge at the top of the page.
- Windows 10/11 x64
- Python 3.10+
git clone https://github.com/A-R-E-S/TelegramImportStudio.git
cd TelegramImportStudio
python -m venv .venv
# Windows:
.venv\Scripts\activate
# Linux / macOS:
# source .venv/bin/activate
pip install -r requirements.txt
python main.py- Go to my.telegram.org.
- Log in using your phone number.
- Open the API development tools section.
- Copy the
api_idandapi_hashinto the corresponding fields on the "Import" screen in the app.
💡 The data is stored locally in the
settings.jsonfile and is not sent anywhere.
Where to get the Chat ID?
Via the @userinfobot or @getidsbot bot in Telegram.
Where to get the user_id for the sender_map?
Via the @userinfobot bot.
Why does the antivirus flag the .exe?
This is a false positive due to PyInstaller packaging. Verify the SHA256 and check the VirusTotal report above.
What does the test mode do?
It goes through the entire process (preparation, authorization, media upload) but does not launch the final history import.
What happens if the internet connection drops during the import?
Some files might fail to upload — they will be marked as errors in the console. You can restart the import: the skipped messages will be sent again.
Where is the Telegram session stored?
In the telegram_import_gui.session file next to the running .exe (or next to main.py if running from source).
The project is intended to work with your own data and your own accounts.
The author is not responsible for violating Telegram's terms of service, account bans, data loss, or misuse of the API. By using the program, you accept all risks.
The project is distributed under the MIT license.



