This module is small util for easy converting Telegram sessions to various formats (Telethon, Pyrogram, Tdata)
$ pip install TGConvertor
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()
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.
- 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