sigaev-pro / TGConvertor

Convertor FOR TELEGRAM SESSIONS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TGSessionsConverter

PyPI PyPI - License

This module is small util for easy converting Telegram sessions to various formats (Telethon, Pyrogram, Tdata)


Installation

$ pip install TGConvertor

Quickstart

from TGConvertor.manager.manager import SessionManager
from pathlib import Path

API_ID = 123
API_HASH = "Your API HASH"


def main():
    session = SessionManager.from_tdata_folder(Path("TDATA/tdata"))
    res = session.to_pyrogram_string()
    print(res)


if __name__ == "__main__":
    main()

How it works

An authorization session consists of an authorization key and some additional data required to connect. The module simply extracts this data and creates an instance of TelegramSession based on it, the methods of which are convenient to use to convert to the format you need.

TODO

  • From telethon\pyrogram SQLite session file
  • From telethon\pyrogram SQLite session stream
  • From tdata
  • To telethon client object (Sync\Async)
  • To telethon SQLite session file
  • To pyrogram client object
  • To pyrogram SQLite session file
  • To tdata
  • From telethon client object
  • From pyrogram client object
  • CLI usage
  • Write normal docs

About

Convertor FOR TELEGRAM SESSIONS

License:MIT License


Languages

Language:Python 100.0%