Skip to content

mrVXBoT/TG-session-converter

Repository files navigation

TGSessionsConverter | VX Edition

Telegram Logo

A powerful utility for converting and managing Telegram session files

Python 3.7+ License: MIT Telethon Pyrogram

✨ Features

  • 🔄 Session Conversion: Convert between Telethon and Pyrogram session formats
  • 🔐 String Sessions: Generate portable string sessions from existing session files
  • Session Validation: Verify the validity of session files
  • 👤 New Sessions: Create new Telethon or Pyrogram sessions with login
  • 🔢 API Management: Easy API credentials handling (file storage or direct input)
  • 🖥️ Multi-platform: Works on Windows, macOS, and Linux
  • 🎨 User-friendly Interface: Colorful, intuitive console interface

📋 Table of Contents

🚀 Installation

Option 1: Clone the repository

# Clone the repository
git clone https://github.com/yourusername/TGSessionsConverter.git

# Navigate to the project directory
cd TGSessionsConverter

# Install dependencies
pip install -r requirements.txt

Option 2: Install via pip

pip install TGSessionsConverter

📦 Dependencies

The project requires the following dependencies:

Dependency Description Required
Telethon Telegram client library for Python Yes
Pyrogram Modern Telegram client library Yes
tgcrypto Cryptography for Pyrogram Yes
colorama Colored terminal output Optional
tqdm Progress bars Optional
nest_asyncio Fix asyncio nested event loops Optional
stream-sqlite Stream SQLite databases Optional

💻 Usage

Interactive Mode

The easiest way to use TGSessionsConverter is through its interactive console interface:

python tg_client_converter.py

This will launch the main menu where you can select various operations:

1. Create new Telethon session (login)
2. Create new Pyrogram session (login)
3. Convert Telethon session to Pyrogram
4. Convert Pyrogram session to Telethon
5. Convert session to String session
6. Check session validity
7. Delete session file
8. Create API credentials file
0. Exit

Command-line Interface

TGSessionsConverter also offers a command-line interface for automation:

# Convert Telethon session to Pyrogram
python tg_client_converter.py convert --from telethon --to pyrogram --input telethon_session --output pyrogram_session --api-id YOUR_API_ID --api-hash YOUR_API_HASH

# Create a new Telethon session
python tg_client_converter.py login --type telethon --api-id YOUR_API_ID --api-hash YOUR_API_HASH --phone +1234567890

# Check session validity
python tg_client_converter.py check --session session_name --api-id YOUR_API_ID --api-hash YOUR_API_HASH

# Create API credentials file
python tg_client_converter.py config --api-id YOUR_API_ID --api-hash YOUR_API_HASH

📝 Examples

Converting Pyrogram session to Telethon

python tg_client_converter.py convert --from pyrogram --to telethon --input my_pyrogram_session --output my_telethon_session

Generating a String Session

python tg_client_converter.py convert --from telethon --to string --input my_telethon_session

Creating an API credentials file

python tg_client_converter.py config

❓ Troubleshooting

Common Issues

Issue Solution
"Unknown DC ID" error Make sure your session file is not corrupted and contains valid data
SQLite database is locked Close any applications using the session file and try again
Import errors Ensure all required dependencies are installed
Session validation fails Your session may have expired or been revoked; create a new one

Logging

To enable detailed logging for troubleshooting:

import logging
logging.basicConfig(level=logging.DEBUG)

🔒 Security Notice

IMPORTANT:

  • Session files and string sessions contain authentication data. Keep them secure.
  • Never share your API ID, API Hash, or session files with others.
  • Creating too many sessions in a short time may result in your account being limited.
  • Use this tool responsibly and in accordance with Telegram's Terms of Service.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ by VX

GitHubTelegram

About

TGSessionsConverter | VX Edition | telegram session converter

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages