From 56365cbcdf289fe04fae449c983f56bcd012b4e268d17ad2665b7e3a74d3eaa4 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 14 Jun 2021 14:40:36 +0000 Subject: [PATCH 1/2] =?UTF-8?q?-=20Update=20to=201.21.1:=20=20=20-=20New?= =?UTF-8?q?=20schema=20and=20QoL=20improvements=20(v1.21)=20=20=20-=20Sche?= =?UTF-8?q?me=20layer=20used:=20125=20=20=20-=20View=20new=20and=20changed?= =?UTF-8?q?=20raw=20API=20methods.=20=20=20-=20Not=20many=20changes=20in?= =?UTF-8?q?=20this=20release,=20mostly=20the=20layer=20=20=20=20=20change.?= =?UTF-8?q?=20Lately=20quite=20a=20few=20people=20have=20been=20reporting?= =?UTF-8?q?=20=20=20=20=20TypeNotFoundError,=20which=20occurs=20when=20the?= =?UTF-8?q?=20server=20sends=20types=20=20=20=20=20that=20it=20shouldn?= =?UTF-8?q?=E2=80=99t.=20This=20can=20happen=20when=20Telegram=20decides?= =?UTF-8?q?=20=20=20=20=20to=20add=20a=20new,=20incomplete=20layer,=20and?= =?UTF-8?q?=20then=20they=20change=20the=20=20=20=20=20layer=20without=20b?= =?UTF-8?q?umping=20the=20layer=20number=20(so=20some=20constructor=20=20?= =?UTF-8?q?=20=20=20IDs=20no=20longer=20match=20and=20the=20error=20occurs?= =?UTF-8?q?).=20This=20layer=20=20=20=20=20change=20should=20fix=20it.=20?= =?UTF-8?q?=20=20-=20Additions=20=20=20=20=20=20=20-=20Message.click()=20n?= =?UTF-8?q?ow=20supports=20a=20password=20parameter,=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20needed=20when=20doing=20things=20like=20changing=20the=20?= =?UTF-8?q?owner=20of=20a=20=20=20=20=20=20=20=20=20bot=20via=20@BotFather?= =?UTF-8?q?.=20=20=20-=20Enhancements=20=20=20=20=20=20=20-=20tgcrypto=20w?= =?UTF-8?q?ill=20now=20be=20used=20for=20encryption=20when=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20installed.=20=20=20-=20Bug=20fixes=20=20=20=20=20?= =?UTF-8?q?=20=20-=20Message.edit=20wasn=E2=80=99t=20working=20in=20your?= =?UTF-8?q?=20own=20chat=20on=20=20=20=20=20=20=20=20=20events=20other=20t?= =?UTF-8?q?han=20NewMessage.=20=20=20=20=20=20=20-=20client.delete=5Fdialo?= =?UTF-8?q?g()=20was=20not=20working=20on=20chats.=20=20=20=20=20=20=20-?= =?UTF-8?q?=20events.UserUpdate=20should=20now=20handle=20channels?= =?UTF-8?q?=E2=80=99=20typing=20=20=20=20=20=20=20=20=20status.=20=20=20?= =?UTF-8?q?=20=20=20=20-=20InputNotifyPeer=20auto-cast=20should=20now=20wo?= =?UTF-8?q?rk=20on=20other=20=20=20=20=20=20=20=20=20TLObject.=20=20=20=20?= =?UTF-8?q?=20=20=20-=20For=20some=20objects,=20False=20was=20not=20correc?= =?UTF-8?q?tly=20serialized.=20=20=20-=20New=20schema=20and=20QoL=20improv?= =?UTF-8?q?ements=20(v1.20)=20=20=20-=20Scheme=20layer=20used:=20124?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Telethon?expand=0&rev=12 --- Telethon-1.17.0.tar.gz | 3 - Telethon-1.21.1.tar.gz | 3 + _service | 14 ++++ _servicedata | 4 + python-Telethon.changes | 173 ++++++++++++++++++++++++++++++++++++++++ python-Telethon.spec | 10 +-- 6 files changed, 199 insertions(+), 8 deletions(-) delete mode 100644 Telethon-1.17.0.tar.gz create mode 100644 Telethon-1.21.1.tar.gz create mode 100644 _service create mode 100644 _servicedata diff --git a/Telethon-1.17.0.tar.gz b/Telethon-1.17.0.tar.gz deleted file mode 100644 index 277a7ae..0000000 --- a/Telethon-1.17.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dd38dd46dfd023cfdf9158f0b730c181ebff89a3b78408e7301552b543b62b92 -size 1326609 diff --git a/Telethon-1.21.1.tar.gz b/Telethon-1.21.1.tar.gz new file mode 100644 index 0000000..cd6b0ea --- /dev/null +++ b/Telethon-1.21.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ee2a8ec8988c05404642d5b46413ffcdfcd21709834e180ab95c6a49244e209 +size 455362 diff --git a/_service b/_service new file mode 100644 index 0000000..4ac179e --- /dev/null +++ b/_service @@ -0,0 +1,14 @@ + + + https://github.com/LonamiWebs/Telethon.git + git + enable + 1.21.1 + v1.21.1 + + + gz + *.tar + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..7389976 --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/LonamiWebs/Telethon.git + 1cef9173a0fea2f7f7ea638e914092f2ce80f778 \ No newline at end of file diff --git a/python-Telethon.changes b/python-Telethon.changes index 2be9eb1..91a33d6 100644 --- a/python-Telethon.changes +++ b/python-Telethon.changes @@ -1,3 +1,176 @@ +------------------------------------------------------------------- +Mon Jun 14 13:51:37 UTC 2021 - Matej Cepl + +- Update to 1.21.1: + - New schema and QoL improvements (v1.21) + - Scheme layer used: 125 + - View new and changed raw API methods. + - Not many changes in this release, mostly the layer + change. Lately quite a few people have been reporting + TypeNotFoundError, which occurs when the server sends types + that it shouldn’t. This can happen when Telegram decides + to add a new, incomplete layer, and then they change the + layer without bumping the layer number (so some constructor + IDs no longer match and the error occurs). This layer + change should fix it. + - Additions + - Message.click() now supports a password parameter, + needed when doing things like changing the owner of a + bot via @BotFather. + - Enhancements + - tgcrypto will now be used for encryption when + installed. + - Bug fixes + - Message.edit wasn’t working in your own chat on + events other than NewMessage. + - client.delete_dialog() was not working on chats. + - events.UserUpdate should now handle channels’ typing + status. + - InputNotifyPeer auto-cast should now work on other + TLObject. + - For some objects, False was not correctly serialized. + - New schema and QoL improvements (v1.20) + - Scheme layer used: 124 + - View new and changed raw API methods. + - A bit late to the party, but Telethon now offers a + convenient way to comment on channel posts. It works very + similar to reply_to: + client.send_message(channel, 'Great update!', comment_to=1134) + - This code will leave a comment to the channel post with ID + 1134 in channel. + - In addition, the library now logs warning or error + messages to stderr by default! You no longer should be + left wondering “why isn’t my event handler working” + if you forgot to configure logging. It took so long for + this change to arrive because nobody noticed that Telethon + was using a logging.NullHandler when it really shouldn’t + have. + - If you want the old behaviour of no messages being logged, + you can configure logging to CRITICAL severity: + + import logging + logging.basicConfig(level=logging.CRITICAL) + + This is not considered a breaking change because stderr + should only be used for logging purposes, not to emit + information others may consume (use stdout for that). + - Additions + - New comment_to parameter in client.send_message(), and + client.send_file() to comment on channel posts. + - Enhancements + - utils.resolve_invite_link handles the newer link + format. + - Downloading files now retries once on TimeoutError, + which has been happening recently. It is not guaranteed + to work, but it should help. + - Sending albums of photo URLs is now supported. + - EXIF metadata is respected when automatically resizing + photos, so the orientation information should no longer + be lost. + - Downloading a thumbnail by index should now use the + correct size ordering. + - Bug fixes + - Fixed a KeyError on certain cases with Conversation. + - Thumbnails should properly render on more + clients. Installing hachoir may help. + - Message search was broken when using a certain + combination of parameters. + - utils.resolve_id was misbehaving with some identifiers. + - Fix TypeNotFoundError was not being propagated, causing + deadlocks. + - Invoking multiple requests at once with ordered=True + was deadlocking. + - New raw API call methods (v1.19) + - Scheme layer used: 122 + - Telegram has had group calls for some weeks now. This new + version contains the raw API methods needed to initiate and + manage these group calls, however, the library will likely + not offer ways to stream audio directly. + - Telethon’s focus is being an asyncio-based, pure-Python + implementation to interact with Telegram’s API. Streaming + audio is beyond the current scope of the project and would + be a big undertaking. + - However, that doesn’t mean calls are not possible with + Telethon. If you want to help design a Python library to + perform audio calls, which can then be used with Telethon + (so you can use Telethon + that new library to perform + calls with Telethon), please refer to @pytgcallschat + and join the relevant chat to discuss and help with the + implementation! + - The above message was also posted in the official Telegram + group, if you wish to discuss it further. + - With that out of the way, let’s list the additions and + bug fixes in this release: + - Additions + - New has_left property for user permissions on + client.get_permissions(). + - Enhancements + - Updated documentation and list of known RPC errors. + - The library now treats a lack of ping responses as a + network error. + - client.kick_participant() now returns the service + message about the user being kicked, so you can delete + it. + - Bug fixes + - When editing inline messages, the text parameter is + preferred if provided. + - Additional senders are unconditionally disconnected + when disconnecting the main client, which should reduce + the amount of asyncio warnings. + - Automatic reconnection with no retries was failing. + - PhotoPathSize is now ignored when determining a + download size, since this “size” is not a JPEG + thumbnail unlike the rest. + - events.ChatAction should misbehave less. + - New layer and QoL improvements (v1.18) + - Scheme layer used: 120 + - Mostly fixes, and added some new things that can be done in + this new layer. + - For proxy users, a pull request was merged that will + use the python-socks library when available for proxy + support. This library natively supports asyncio, so it + should work better than the old pysocks. pysocks will still + be used if the new library is not available, and both will + be handled transparently by Telethon so you don’t need to + worry about it. + - Additions + - New client.set_proxy() method which lets you change + the proxy without recreating the client. You will need + to reconnect for it to take effect, but you won’t + need to recreate the client. This is also an external + contribution. + - New method to unpin messages client.unpin_message(). + - Enhancements + - Empty peers are excluded from the list of dialogs. + - If the python-socks library is installed (new optional + requirement), it will be used instead of pysocks for + proxy support. This should fix some issues with proxy + timeouts, because the new library natively supports + asyncio. + - client.send_file() will now group any media + type, instead of sending non-image documents + separatedly. This lets you create music albums, for + example. + - You can now search messages with a from_user that’s + not a user. This is a Telegram feature, we know the + name isn’t great, but backwards-compatibility has to + be kept. + - Bug fixes + - Fixes related to conversation timeouts. + - Large dates (over year 2038) now wrap around a 32-bit + integer, which is the only way we can represent them + to Telegram. Even if “wrong”, it makes things not + crash, and it’s the best we can do with 32-bit dates. + - The library was accidentally using a deprecated + argument in one of its friendly methods, producing a + warning. + - Improvements to the way marked IDs are parsed. + - SlowModeWaitError floods are no longer cached. + - Getting the buttons for a message could fail sometimes. + - Getting the display name for “forbidden” chats now works. + - Better handling of errors in some internal methods. +- Use git checkout to have tests again. + ------------------------------------------------------------------- Wed Oct 21 03:32:46 UTC 2020 - Steve Kowalik diff --git a/python-Telethon.spec b/python-Telethon.spec index 2b5a17d..792dc84 100644 --- a/python-Telethon.spec +++ b/python-Telethon.spec @@ -1,7 +1,7 @@ # # spec file for package python-Telethon # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ # Python2 is not supported %define skip_python2 1 Name: python-Telethon -Version: 1.17.0 +Version: 1.21.1 Release: 0 Summary: Full-featured Telegram client library for Python 3 License: MIT @@ -45,14 +45,13 @@ Telethon is an asyncio Python 3 MTProto library to interact with Telegram's API %prep %setup -q -n Telethon-%{version} -find {README.rst,LICENSE} -type f -perm /111 -exec chmod 644 {} \; +chmod 644 *.rst LICENSE %build %python_build %install %python_install -%python_expand rm -r %{buildroot}%{$python_sitelib}/tests %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -62,6 +61,7 @@ find {README.rst,LICENSE} -type f -perm /111 -exec chmod 644 {} \; %files %{python_files} %doc README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/telethon +%{python_sitelib}/Telethon-%{version}-py*.egg-info %changelog From 94ccdbce58d39eeeddffd56104766ae4d5fa1b747e5472a94859ffb346d6ee81 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 14 Jun 2021 18:22:40 +0000 Subject: [PATCH 2/2] Fix URL, use the GitHub tarballs. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Telethon?expand=0&rev=13 --- Telethon-1.21.1.tar.gz | 4 ++-- _service | 14 -------------- _servicedata | 4 ---- python-Telethon.changes | 1 - python-Telethon.spec | 3 ++- 5 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 _service delete mode 100644 _servicedata diff --git a/Telethon-1.21.1.tar.gz b/Telethon-1.21.1.tar.gz index cd6b0ea..3de95f5 100644 --- a/Telethon-1.21.1.tar.gz +++ b/Telethon-1.21.1.tar.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5ee2a8ec8988c05404642d5b46413ffcdfcd21709834e180ab95c6a49244e209 -size 455362 +oid sha256:793a98e775f7f4261fb7fa7a4a447f92a663e6697c7a7a5afcf3a54bfd3cf289 +size 446169 diff --git a/_service b/_service deleted file mode 100644 index 4ac179e..0000000 --- a/_service +++ /dev/null @@ -1,14 +0,0 @@ - - - https://github.com/LonamiWebs/Telethon.git - git - enable - 1.21.1 - v1.21.1 - - - gz - *.tar - - - diff --git a/_servicedata b/_servicedata deleted file mode 100644 index 7389976..0000000 --- a/_servicedata +++ /dev/null @@ -1,4 +0,0 @@ - - - https://github.com/LonamiWebs/Telethon.git - 1cef9173a0fea2f7f7ea638e914092f2ce80f778 \ No newline at end of file diff --git a/python-Telethon.changes b/python-Telethon.changes index 91a33d6..15b45d5 100644 --- a/python-Telethon.changes +++ b/python-Telethon.changes @@ -169,7 +169,6 @@ Mon Jun 14 13:51:37 UTC 2021 - Matej Cepl - Getting the buttons for a message could fail sometimes. - Getting the display name for “forbidden” chats now works. - Better handling of errors in some internal methods. -- Use git checkout to have tests again. ------------------------------------------------------------------- Wed Oct 21 03:32:46 UTC 2020 - Steve Kowalik diff --git a/python-Telethon.spec b/python-Telethon.spec index 792dc84..07cc517 100644 --- a/python-Telethon.spec +++ b/python-Telethon.spec @@ -19,13 +19,14 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} # Python2 is not supported %define skip_python2 1 +%define modname Telethon Name: python-Telethon Version: 1.21.1 Release: 0 Summary: Full-featured Telegram client library for Python 3 License: MIT URL: https://github.com/LonamiWebs/Telethon -Source: https://files.pythonhosted.org/packages/source/T/Telethon/Telethon-%{version}.tar.gz +Source: https://github.com/LonamiWebs/%{modname}/archive/refs/tags/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz BuildRequires: %{python_module pyaes} BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest-tornasync}