From fd700cd13a1de33825e2dfbac9823b06125da1294bfabbf78ee158759b2e2d95 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 26 Mar 2025 00:57:51 +0000 Subject: [PATCH] - Lowercase metadata directory name. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Telethon?expand=0&rev=32 --- .gitattributes | 23 +++ .gitignore | 1 + Telethon-1.30.3.tar.gz | 3 + Telethon-1.38.0.tar.gz | 3 + Telethon-1.38.1.tar.gz | 3 + Telethon-1.39.0.tar.gz | 3 + python-Telethon.changes | 400 ++++++++++++++++++++++++++++++++++++++++ python-Telethon.spec | 69 +++++++ 8 files changed, 505 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Telethon-1.30.3.tar.gz create mode 100644 Telethon-1.38.0.tar.gz create mode 100644 Telethon-1.38.1.tar.gz create mode 100644 Telethon-1.39.0.tar.gz create mode 100644 python-Telethon.changes create mode 100644 python-Telethon.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Telethon-1.30.3.tar.gz b/Telethon-1.30.3.tar.gz new file mode 100644 index 0000000..0f8e63a --- /dev/null +++ b/Telethon-1.30.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1534dbda5d16a509bdc934a7d4bbfba4473ba08b27143e0fe70aacf1f7be50e0 +size 491933 diff --git a/Telethon-1.38.0.tar.gz b/Telethon-1.38.0.tar.gz new file mode 100644 index 0000000..50485bd --- /dev/null +++ b/Telethon-1.38.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:517f50157dcb176096a747ad8945fe5c254f62f29435dedee1ad6b790c4bec65 +size 506719 diff --git a/Telethon-1.38.1.tar.gz b/Telethon-1.38.1.tar.gz new file mode 100644 index 0000000..348c409 --- /dev/null +++ b/Telethon-1.38.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfa2afdd1f9ac204530c861b2a9e4651985bdb4681486163668b6230cf857159 +size 506728 diff --git a/Telethon-1.39.0.tar.gz b/Telethon-1.39.0.tar.gz new file mode 100644 index 0000000..51d8411 --- /dev/null +++ b/Telethon-1.39.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d9ad3989cb73f2b3b387352a87f1ca561dae5f2d9c607499244e0a11bf9e77c +size 509308 diff --git a/python-Telethon.changes b/python-Telethon.changes new file mode 100644 index 0000000..6f97101 --- /dev/null +++ b/python-Telethon.changes @@ -0,0 +1,400 @@ +------------------------------------------------------------------- +Wed Mar 26 00:56:52 UTC 2025 - Steve Kowalik + +- Lowercase metadata directory name. + +------------------------------------------------------------------- +Mon Mar 17 13:11:04 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 1.39.0 + * fix(session): persist session after `session.set_dc` + * Update to layer 195 + * Avoid error when trying to reset deadline for no msgbox entries + * Updated to Layer 196 (#4525) + * Add missing parameters to Message constructor (#4529) + * Fix IOError with some image modes in photo resize This fixes image + compression with mode "P" (potentially others) which is necessary + as the server has erroneous alpha color with some types of images + (mode "P" for example). This also properly applies the background + argument that may be passed to _resize_photo_if_needed by always + compressing images with alpha regardless of whether the server + will compress the image for us. + * Document drop_author and add drop_media_captions drop_author is + already supported but is undocumented. drop_media_captions for + consistency with drop_author being implemented. + * Respect receive_updates=False + * Improve edit_message message type hint This also allows + utils.get_message_id to get the ID of InputMessageID. + * Update to layer 198 + * Unconditionally match text and link text in markdown Fixes cases + where there's a nested [] in the text by matching until "](" is + reached. This doesn't match newlines in URLs because that makes + no sense. + * Fix overlapping URLs and improve overlapping in md Also remove the + unused overlap function. + * Make markdown URL regex less greedy Fixes multiple URLs in a single + message. + * fix: support batch sending of image URLs and video URLs in albums + * Consider range list-like This allows you to pass range() to things + such as get_messages as ids= without first explicitly converting it + to a list. + * Update to layer 199 + +------------------------------------------------------------------- +Mon Jan 13 19:50:54 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 1.38.1 + * Fix Python 3.6 compatibility + +------------------------------------------------------------------- +Thu Nov 21 09:29:35 UTC 2024 - Dirk Müller + +- update to 1.38.0: + * Formatting entities misbehaved with albums. + * Sending a Message object with a file did not use the new file. +- update to 1.37.0: + * Support for CDN downloads should be back. Telethon still + prefers no CDN by default. + * FloodWaitPremium should now be handled like any other floodwaits. + * Fixed edge-case when using get_messages(..., reverse=True). + * ConnectionError when using proxies should be raised properly. +- update to 1.36.0: + * Certain updates, such as :tl:`UpdateBotStopped`, should now be + processed reliably. +- update to 1.35.0: + * "Custom secret support" should work with TcpMTProxy. + * Some type hints should now be more accurate. + * Session path couldn't be a pathlib.Path or None. + * Python versions older than 3.9 should now be supported again. + * Readthedocs should hopefully build the v1 documentation again. +- update to 1.34.0: + * reply_to_chat and reply_to_sender are now in Message. + * parse_mode with a custom instance containing both parse and + unparse should now work. + * Parsing and unparsing message entities should now behave better + in certain corner-cases. +- update to 1.33.0: + * webbrowser is now imported conditionally, to support niche environments. +Library should now retry on the suddenly-common TimedOutError. +- update to 1.32.0: + * new and changed raw API methods +- update to 1.31.0: + * dropped imghdr support to prepare for python 3.12 + +------------------------------------------------------------------- +Wed Sep 20 02:49:49 UTC 2023 - Bernhard Wiedemann + +- Update to version 1.30.3 + * Support reproducible builds + * Various fixes and changes + https://github.com/LonamiWebs/Telethon/compare/v1.26.0...v1.30.3 + +------------------------------------------------------------------- +Mon Dec 5 19:32:14 UTC 2022 - Yogalakshmi Arunachalam + +- Update to version 1.26.0 + * Bump to v1.26 and update layer to 149 + Sort updates preemptively + Closes #3936. + There are two changes made to ensure the first update in a channel + cannot be lost, first by always sorting updates before applying pts, + and second by cautiously initializing the local pts if the client + had no pts known beforehand. + It might be possible to cleanup the handling of possible gaps now + that updates are always sorted, but that requires more thought. + +------------------------------------------------------------------- +Thu Oct 27 21:22:55 UTC 2022 - Yogalakshmi Arunachalam + +- Update to 1.25.4 + * Revert accidental NO_UPDATES_TIMEOUT + +------------------------------------------------------------------- +Thu Sep 22 21:31:48 UTC 2022 - Yogalakshmi Arunachalam + +- Update to v1.25 + * Add note on 2FA for qr_login + * Handle ServerError while getting difference + * Re-raise unhandled errors that occur during update handling + * Document the client instance cannot be used after logout + * Add a hard timeout on disconnect + * Update some raw API examples + * del_surrogate for HTML inline URLs + * Ignore ChannelParticipantLeft during iter_participants + * Wrap buttons typehint in Optional + * Fix events.Album did not have chat in PM + * Ignore aggressive parameter in iter_participants + * Replace mentions of master branch with v1 + * Fix get_permissions for small group chats + * Manually construct reply_to for send_message result + * Strip 0-length message entities + * Make custom, functions and types proper modules + * Trust pts values during apply_difference + * Do not remove ENTRY_SECRET during apply difference + * Handle auth errors during get difference + * Recognize invite links with plus sign prefix + * Document new known RPC errors + * Handle CancelledError inside update loop + * Make use of AlbumHack for all albums + * Fix UpdateShort from socket was not unboxed + * Fix some MD parsing of inline URLs (#3920) + * Fix raw API docs generation + * Remove missed async keywords from the revert + * Revert "Add missing async keywords in SQLiteSession" + * Revert "Make sessions async" + * Revert "Mark certain SQLiteSession methods as async" + * Revert "Add workaround for SQLiteSession needing save after init" + * Update to layer 144 + * Also except ChannelInvalidError during get_diff + * Fix missing variable and assignment in reset_deadline + * Handle ValueError during get_channel_difference + * Fix reset_deadline was not doing its job + * Prevent double-logging of 'timeout for updates' + * Support sending 4GB files (#3891) + * Add ENTITY_BOUNDS_INVALID and POSTPONED_TIMEOUT to known errors (#3887) + * Fix HTML/MD parser producing empty MessageEntity (#3885) + +------------------------------------------------------------------- +Mon Aug 29 03:58:55 UTC 2022 - Yogalakshmi Arunachalam + +- Update to 1.24.0 + * No changelog + +------------------------------------------------------------------- +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. + +------------------------------------------------------------------- +Wed Oct 21 03:32:46 UTC 2020 - Steve Kowalik + +- Update to 1.17.0: + * Breaking Changes + + Message.from_id is now a :tl:`Peer`, not int! If you want the marked sender ID (much like old behaviour), replace all uses of .from_id with .sender_id. This will mostly work, but of course in old and new versions you have to account for the fact that this sender may no longer be a user. + + You can no longer assign to Message.reply_to_msg_id and Message.to_id because these are now properties that offer a "view" to the real value from a different field. + + Answering inline queries with a photo or document will now send the photo or document used in the resulting message by default. Not sending the media was technically a bug, but some people may be relying on this old behaviour. You can use the old behaviour with include_media=False. + * Additions + + New raise_last_call_error parameter in the client constructor to raise the same error produced by the last failing call, rather than a generic ValueError. + + New formatting_entities parameter in client.send_message() , and client.send_file() to bypass the parse mode and manually specify the formatting entities. + + New client.get_permissions() method to query a participant's permissions in a group or channel. This request is slightly expensive in small group chats because it has to fetch the entire chat to check just a user, so use of a cache is advised. + + Message.click() now works on normal polls! + + New local_addr parameter in the client constructor to use a specific local network address when connecting to Telegram. + + client.inline_query() now lets you specify the chat where the query is being made from, which some bots need to provide certain functionality. + + You can now get comments in a channel post with the reply_to parameter in client.iter_messages() . Comments are messages that "reply to" a specific channel message, hence the name (which is consistent with how Telegram's API calls it). + * Enhancements + + Updated documentation and list of known errors. + + If hachoir is available, the file metadata can now be extracted from streams and in-memory bytes. + + The default parameters used to initialize a connection now match the format of those used by Telegram Desktop. + + Specifying 0 retries will no longer cause the library to attempt to reconnect. + + The library should now be able to reliably download very large files. + + Global search should work more reliably now. + + Old usernames are evicted from cache, so getting entities by cached username should now be more reliable. + + Slightly less noisy logs. + + Stability regarding transport-level errors (transport flood, authorization key not found) should be improved. In particular, you should no longer be getting unnecessarily logged out. + + Reconnection should no longer occur if the client gets logged out (for example, another client revokes the session). + + Bug fixes + + In some cases, there were issues when using events.Album together with events.Raw . + + For some channels, one of their channel photos would not show up in client.iter_profile_photos() . + + In some cases, a request that failed to be sent would be forgotten, causing the original caller to be "locked" forever for a response that would never arrive. Failing requests should now consistently be automatically re-sent. + + The library should more reliably handle certain updates with "empty" data. + + Sending documents in inline queries should now work fine. + + Manually using client.sign_up should now work correctly, instead of claiming "code invalid". + + Special mention to some of the other changes in the 1.16.x series: + + The thumb for download_media now supports both str and :tl:`VideoSize`. + + Thumbnails are sorted, so -1 is always the largest. + +------------------------------------------------------------------- +Fri Sep 11 02:24:22 UTC 2020 - Steve Kowalik + +- Update to 1.16.4: + * Added support to force_file on any media, including things that were not + possible before like .webp files. + * Sending a copy of messages with polls will now work when possible. + * The library now automatically retries on inter-dc call errors + * Square brackets removed from IPv6 addresses. This may fix IPv6 support. + * New client.qr_login(). + * message.click now lets you click on buttons requesting phone or location. + +------------------------------------------------------------------- +Wed Jun 3 15:52:04 UTC 2020 - Dead Mozay + +- Update to version 1.14.0: + * No changelog was made available. + +------------------------------------------------------------------- +Fri Feb 28 14:15:21 UTC 2020 - Tomáš Chvátal + +- Format with spec-cleaner +- Add missing runtime dependencies + +------------------------------------------------------------------- +Thu Feb 27 13:15:34 UTC 2020 - Dead Mozay + +- Initial package diff --git a/python-Telethon.spec b/python-Telethon.spec new file mode 100644 index 0000000..538da6b --- /dev/null +++ b/python-Telethon.spec @@ -0,0 +1,69 @@ +# +# spec file for package python-Telethon +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define modname Telethon +%{?sle15_python_module_pythons} +Name: python-Telethon +Version: 1.39.0 +Release: 0 +Summary: Full-featured Telegram client library for Python 3 +License: MIT +URL: https://github.com/LonamiWebs/Telethon +Source: https://github.com/LonamiWebs/%{modname}/archive/refs/tags/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pyaes} +BuildRequires: %{python_module pytest-asyncio} +BuildRequires: %{python_module pytest-tornasync} +BuildRequires: %{python_module pytest-trio} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module rsa} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-pyaes +Requires: python-rsa +BuildArch: noarch +%python_subpackages + +%description +Telethon is an asyncio Python 3 MTProto library to interact with Telegram's API +as a user or through a bot account (bot API alternative). + +%prep +%setup -q -n Telethon-%{version} +chmod -x *.rst LICENSE + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# test_all_methods_present needs readthedocs available +%pytest -k 'not test_all_methods_present' + +%files %{python_files} +%doc README.rst +%license LICENSE +%{python_sitelib}/telethon +%{python_sitelib}/telethon-%{version}.dist-info + +%changelog