opentele
A Python Telegram API Library for converting between tdata and telethon sessions, with built-in official Telegram APIs. Read the documentation.
Features
Dependencies
- telethon - Widely used Telegram's API library for Python.
- tgcrypto - AES-256-IGE encryption to works with
tdata
. - pyQt5 - Used by Telegram Desktop to streams data from files.
Installation
pip install --upgrade opentele
First Run
Load TDesktop from tdata folder and convert it to telethon, with a custom API:
from opentele.td import TDesktop
from opentele.tl import TelegramClient
from opentele.api import API, CreateNewSession, UseCurrentSession
import asyncio
async def main():
tdataFolder = r"C:\Users\<username>\AppData\Roaming\Telegram Desktop\tdata"
tdesk = TDesktop(tdataFolder)
api = API.TelegramIOS.Generate()
client = await tdesk.ToTelethon("newSession.session", CreateNewSession, api)
await client.connect()
await client.PrintSessions()
asyncio.run(main())
Authorization
opentele offers the ability to use official APIs, which are used by official apps. You can check that out here.
According to Telegram TOS: all accounts that sign up or log in using unofficial Telegram API clients are automatically put under observation to avoid violations of the Terms of Service.
It also uses the lang_pack parameter, of which telethon can't use because it's for official apps only.
Therefore, there are no differences between using opentele and official apps, the server can't tell you apart.
Incoming Features
Examples
The best way to learn anything is by looking at the examples. Am I right?
Documentation ![documentation](https://readthedocs.org/projects/opentele/badge/?version=latest&style=flat)