opentele-py313
Python 3.13+ Compatible Fork
This is a Python 3.13+ compatible fork of the original opentele library by thedemons.
What's Changed?
- Python 3.13 Compatibility: Fixed compatibility issues with Python 3.13 by handling new class attributes (
__firstlineno__and__static_attributes__) in theextend_classdecorator. - All original functionality remains intact.
Original Project
This fork is based on opentele v1.15.1. All credit for the original library goes to thedemons.
Original repository: https://github.com/thedemons/opentele
Features
- Convert Telegram Desktop tdata sessions to telethon sessions and vice versa.
- Use telethon with official APIs to avoid bot detection.
- Randomize device info using real data that recognized by Telegram server.
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
For Python 3.13+
Install this fork from PyPI:
pip install --upgrade opentele-py313
For Python 3.12 and below
Use the original library:
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():
# Load TDesktop client from tdata folder
tdataFolder = r"C:\Users\<username>\AppData\Roaming\Telegram Desktop\tdata"
tdesk = TDesktop(tdataFolder)
# Using official iOS API with randomly generated device info
# print(api) to see more
api = API.TelegramIOS.Generate()
# Convert TDesktop session to telethon client
# CreateNewSession flag will use the current existing session to
# authorize the new client by `Login via QR code`.
client = await tdesk.ToTelethon("newSession.session", CreateNewSession, api)
# Although Telegram Desktop doesn't let you authorize other
# sessions via QR Code (or it doesn't have that feature),
# it is still available across all platforms (APIs).
# Connect and print all logged in devices
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
- Writing data to tdata for converting telethon sessions to tdesktop.
- Random device information for initConnection to avoid spam-detection.
- Add support for pyrogram.
- Develop opentele-tui using textual for non-experience user.
Examples
The best way to learn anything is by looking at the examples. Am I right?
- Example on readthedocs
- Example on github
Documentation 
- Read documentation on readthedocs
- Read documentation on github
Metadata
Release files for opentele-py313 1.15.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| opentele_py313-1.15.2.tar.gz | 74.2 kB | Without provenance | Details for opentele_py313-1.15.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| opentele_py313-1.15.2-py3-none-any.whl | Python 3 | none | any | Details for opentele_py313-1.15.2-py3-none-any.whl |
Total release size: 155.4 kB
Release files / opentele_py313-1.15.2.tar.gz
| Download URL | opentele_py313-1.15.2.tar.gz |
|---|---|
| Size | 74.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f491b74cbe211614f2de958c9ad9b466c61ebd417097b5a89acb647280fa205a
|
|
BLAKE2b-256 checksum How to use checksums |
50134ce0e97404249baac222d68a34398f4988909d95d100e8ee4e793a023bb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / opentele_py313-1.15.2-py3-none-any.whl
| Download URL | opentele_py313-1.15.2-py3-none-any.whl |
|---|---|
| Size | 81.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1d0df6f4055d054148abc3272a30a80959aca51f1d1b9efd31facb1d1b54e08
|
|
BLAKE2b-256 checksum How to use checksums |
1244181d09fbb6b31db4c366e268818c3e019f7d2b6d2df3cb497dbd69a8ffdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for opentele-py313 1.15.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.