Telethon Updates
1.51K subscribers
29 photos
21 files
1.36K links
Official channel for updates about Telethon.
Official English group: @TelethonChat

Other channels:
• Russian: @TelethonRussian
• Persian: @TelethonGap
• Snippets: @TelethonSnippets2
Download Telegram
What does this mean for Telethon users? My interpretation is, if you're developing an application which can access the message history from channels and bot accounts, you are required to show these messages. If your application is published to some store, the risk of consequences for not complying is probably higher.

I am not a lawyer, but personal use or "userbots" (which simply enhance your experience with "commands") are probably safe. Still, you should read the official statement at https://core.telegram.org/api/sponsored-messages (the date seems to be now January 1, 2022).

As usual, using a library to interact with Telegram's library does not exempt you from complying with Telegram's Terms and Conditions yourself. The library is only a means to use the API, but you, the developer, have to make sure your application complies. Failing to comply risks getting your API access revoked.
1
Forwarded from lonami
Telegram has started enforcing the use of 64-bit identifiers for users and chats, and the current stable version of the library does not support them yet. If you try to login, you may see UPDATE_APP_TO_LOGIN error.

I will try to find time to update the library as soon as possible. Although the first version supporting this new layer may not be as well-tested as I would've liked (because I haven't had much time to devote to open source lately). Thank you for your patience.

If you want to stay updated, so you can subscribe to the GitHub thread https://github.com/LonamiWebs/Telethon/issues/3215.

If someone desperatily needs this fix, please uninstall telethon and install https://t.me/TelethonChat/400936 as a temporary workaround (or spechide's,
pip3 install git+git://github.com/SpEcHiDe/Telethon@72afe59#egg=telethon
) (or use a virtual environment).
👍4
Telethon Updates pinned «Telegram has started enforcing the use of 64-bit identifiers for users and chats, and the current stable version of the library does not support them yet. If you try to login, you may see UPDATE_APP_TO_LOGIN error. I will try to find time to update the library…»
Fix typo, add errors, and update to 133 again (#3157) (9c796e8 by SpEcHiDe)
1
Fix peer ID check to work with higher IDs (c9ecd61 by Lonami)
1
I have pushed v1.24 to PyPi, which fixes login (thus avoiding UPDATE_APP_TO_LOGIN), but I have not had the time to test this version thoroughly, so please make sure to report any issues you find on GitHub.

It contains the above two fixes (and the "latest" 133 layer, to prevent receiving broken constructors), but not the latest layer, currently 135, to avoid breaking more things than necessary). Note that if you uninstalled telethon to install the workarounds, you will now need to uninstall the workarounds and install telethon again.

Thank you for your patience and understanding.
🎉4🥰2
Telethon Updates pinned «I have pushed v1.24 to PyPi, which fixes login (thus avoiding UPDATE_APP_TO_LOGIN), but I have not had the time to test this version thoroughly, so please make sure to report any issues you find on GitHub. It contains the above two fixes (and the "latest"…»
Bump to v1.24 (bda4259 by Lonami)
1
Add missing async when downloading from URL (#3222) (f9643bf by Nenirey)
1
Improve readability for readthedocs/concepts/entities.rst (#3259) (805898c by vladdoster)
Slight rewording of error message (#3256) (530284a by SpEcHiDe)
Add support for new invite link format (#3213) (674b7d6 by kdrag0n)
👍2
Proper usage of messagebox in update handling loop (0129192 by Lonami)
Fix messagebox porting errors (259fcca by Lonami)
Remove GitHub workflow (0d597d1 by Lonami)
Fix constructing PtsInfo for channels (de2cd1f by Lonami)
Fix update handling for channels (1f40372 by Lonami)
Process self-produced updates like any other (f1a517d by Lonami)
Handle TypeNotFoundError during gzip packed msgs (015acf2 by Lonami)
Persist session state and usage fixes (f547a00 by Lonami)
Reimplement catch_up (4b85ced by Lonami)
Add missing catch_up param to client init (3aa53dd by Lonami)
Don't store empty pts in messagebox (4b61ce1 by Lonami)
Fix reset_deadline check in messagebox (f7ccf8d by Lonami)
Properly load and save channel state (f775484 by Lonami)
Reintroduce keepalive pings in the sender (b0b1f30 by Lonami)
Review, unify and simplify retry_range usage (a25f019 by Lonami)
Add new features from new layer (#3676) (539e3cb by New-dev0)
Merge branch 'v2' (ed70991 by Lonami)
1👍1
Avoid usage of __builtins__ in the generator (#3161) (d9e2a8a by penn5)
1
Fix flood_sleep_threshold was not being forwarded (4aa23cf by Lonami)
Use threads for factorization (3c7bb53 by Lonami)
Document more RPC errors (0eadca6 by Lonami)
1
Allow restricting channels (#3679) (7778e54 by New-dev0)
1
Regarding the annoying captcha in the documentation, the Read The Docs team has responded to me via email with the following:
--
Thanks for contacting us. This is an automatic CDN's protection feature from Cloudflare that we use to avoid DDoS attacks. When the algorithm detects weird behavior on a particular domain (for example, *a lot* of traffic in a very small window of time) it enables captcha protection.

I'd expect the captcha to be disabled soon once this "weird behavior" situation gets mitigated. Let me know otherwise.
--
If this is very, very annoying, one can always clone the repository and build the documentation offline (with make html -e, after installing the necessary dependencies).
1
Remove input_peer parameter from get_me (d426099 by Lonami)
Make raw API types immutable (070af28 by Lonami)
Make upload_file private (f2ef0bf by Lonami)
Begin unification of event builders and events (9726169 by Lonami)
Rework methods to manage event handlers (0802f7e by Lonami)
Fix date usage in messagebox impl (05457ea by Lonami)
Fix saving entity types in sqlite (a16c397 by Lonami)
Implement dispatching events (a1fe805 by Lonami)
Introduce some filters (055eca4 by Lonami)
Add proper warnings when applying filters to updates fails (a3a60e6 by Lonami)
👍3
If you're experiencing slow upload or download speeds in Telethon, cryptg~=0.3 with binary wheels has (finally) been released on PyPi thanks to the work of a68366 to fix CI.

What this means is you can upgrade cryptg to get improved upload and download speed as some have reported (over 10MB/s both directions) with the following command:

pip install --upgrade cryptg~=0.3
👍10
Recently https://github.com/LonamiWebs/Telethon/issues/3753 has resurfaced. Due to seemingly sudden interest, I have pushed a fix to the v1.24 branch, which will eventually be a proper PyPi release. This also contains changes to update handling. Neither of these changes have been tested extensively (as in, by a large amount of users yet), so please report any new issues if you do find them.

If you want to install these changes, you can do so with the following command:
pip3 install -U https://github.com/LonamiWebs/Telethon/archive/v1.24.zip

The reason for the longer delay between updates was that I really wanted v2 finished, but other issues are essentially forcing me to maintain the v1 branch for a little longer. I do not plan to add new features to v1. These will still have to wait for v2. But fixes for larger issues such as these should come to v1 for a while longer. Unfortunately v2 is still ways to come, until I can get enough motivation to get back to it.
👍15🔥73😱1
Also note that the v1.24 branch has had its layer updated (if you use raw API somewhere, some things may need updating).
🔥121👍1