py-tgcalls 2.0.0rc6__py3-none-any.whl → 2.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. py_tgcalls-2.0.2.dist-info/METADATA +297 -0
  2. {py_tgcalls-2.0.0rc6.dist-info → py_tgcalls-2.0.2.dist-info}/RECORD +36 -36
  3. {py_tgcalls-2.0.0rc6.dist-info → py_tgcalls-2.0.2.dist-info}/WHEEL +1 -1
  4. pytgcalls/__version__.py +1 -1
  5. pytgcalls/ffmpeg.py +6 -7
  6. pytgcalls/filters.py +14 -1
  7. pytgcalls/media_devices/media_devices.py +4 -2
  8. pytgcalls/methods/calls/get_participants.py +1 -1
  9. pytgcalls/methods/calls/leave_call.py +12 -4
  10. pytgcalls/methods/stream/play.py +1 -3
  11. pytgcalls/methods/utilities/call_holder.py +14 -11
  12. pytgcalls/methods/utilities/idle.py +2 -2
  13. pytgcalls/methods/utilities/start.py +40 -19
  14. pytgcalls/mtproto/client_cache.py +1 -1
  15. pytgcalls/mtproto/hydrogram_client.py +9 -7
  16. pytgcalls/mtproto/mtproto_client.py +1 -1
  17. pytgcalls/mtproto/pyrogram_client.py +9 -7
  18. pytgcalls/mtproto/telethon_client.py +9 -7
  19. pytgcalls/mutex.py +2 -29
  20. pytgcalls/pytgcalls.py +1 -0
  21. pytgcalls/scaffold.py +0 -1
  22. pytgcalls/types/__init__.py +3 -7
  23. pytgcalls/types/calls/call.py +1 -10
  24. pytgcalls/types/calls/call_data.py +5 -3
  25. pytgcalls/types/calls/raw_call_update.py +1 -1
  26. pytgcalls/types/{groups → chats}/__init__.py +0 -4
  27. pytgcalls/types/{groups → chats}/chat_update.py +1 -5
  28. pytgcalls/types/{groups → chats}/group_call_participant.py +14 -2
  29. pytgcalls/types/{groups → chats}/updated_group_call_participant.py +1 -1
  30. pytgcalls/types/dict.py +5 -0
  31. pytgcalls/types/flag.py +6 -0
  32. pytgcalls/types/participant_list.py +2 -2
  33. pytgcalls/types/stream/media_stream.py +1 -5
  34. pytgcalls/ytdlp.py +8 -1
  35. py_tgcalls-2.0.0rc6.dist-info/METADATA +0 -128
  36. pytgcalls/types/groups/joined_group_call_participant.py +0 -12
  37. pytgcalls/types/groups/left_group_call_participant.py +0 -12
  38. {py_tgcalls-2.0.0rc6.dist-info → py_tgcalls-2.0.2.dist-info}/LICENSE +0 -0
  39. {py_tgcalls-2.0.0rc6.dist-info → py_tgcalls-2.0.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,297 @@
1
+ Metadata-Version: 2.1
2
+ Name: py-tgcalls
3
+ Version: 2.0.2
4
+ Summary: Async client API for the Telegram Calls.
5
+ Author-email: Laky-64 <iraci.matteo@gmail.com>
6
+ License: GNU LESSER GENERAL PUBLIC LICENSE
7
+ Version 3, 29 June 2007
8
+
9
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
10
+ Everyone is permitted to copy and distribute verbatim copies
11
+ of this license document, but changing it is not allowed.
12
+
13
+
14
+ This version of the GNU Lesser General Public License incorporates
15
+ the terms and conditions of version 3 of the GNU General Public
16
+ License, supplemented by the additional permissions listed below.
17
+
18
+ 0. Additional Definitions.
19
+
20
+ As used herein, "this License" refers to version 3 of the GNU Lesser
21
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
22
+ General Public License.
23
+
24
+ "The Library" refers to a covered work governed by this License,
25
+ other than an Application or a Combined Work as defined below.
26
+
27
+ An "Application" is any work that makes use of an interface provided
28
+ by the Library, but which is not otherwise based on the Library.
29
+ Defining a subclass of a class defined by the Library is deemed a mode
30
+ of using an interface provided by the Library.
31
+
32
+ A "Combined Work" is a work produced by combining or linking an
33
+ Application with the Library. The particular version of the Library
34
+ with which the Combined Work was made is also called the "Linked
35
+ Version".
36
+
37
+ The "Minimal Corresponding Source" for a Combined Work means the
38
+ Corresponding Source for the Combined Work, excluding any source code
39
+ for portions of the Combined Work that, considered in isolation, are
40
+ based on the Application, and not on the Linked Version.
41
+
42
+ The "Corresponding Application Code" for a Combined Work means the
43
+ object code and/or source code for the Application, including any data
44
+ and utility programs needed for reproducing the Combined Work from the
45
+ Application, but excluding the System Libraries of the Combined Work.
46
+
47
+ 1. Exception to Section 3 of the GNU GPL.
48
+
49
+ You may convey a covered work under sections 3 and 4 of this License
50
+ without being bound by section 3 of the GNU GPL.
51
+
52
+ 2. Conveying Modified Versions.
53
+
54
+ If you modify a copy of the Library, and, in your modifications, a
55
+ facility refers to a function or data to be supplied by an Application
56
+ that uses the facility (other than as an argument passed when the
57
+ facility is invoked), then you may convey a copy of the modified
58
+ version:
59
+
60
+ a) under this License, provided that you make a good faith effort to
61
+ ensure that, in the event an Application does not supply the
62
+ function or data, the facility still operates, and performs
63
+ whatever part of its purpose remains meaningful, or
64
+
65
+ b) under the GNU GPL, with none of the additional permissions of
66
+ this License applicable to that copy.
67
+
68
+ 3. Object Code Incorporating Material from Library Header Files.
69
+
70
+ The object code form of an Application may incorporate material from
71
+ a header file that is part of the Library. You may convey such object
72
+ code under terms of your choice, provided that, if the incorporated
73
+ material is not limited to numerical parameters, data structure
74
+ layouts and accessors, or small macros, inline functions and templates
75
+ (ten or fewer lines in length), you do both of the following:
76
+
77
+ a) Give prominent notice with each copy of the object code that the
78
+ Library is used in it and that the Library and its use are
79
+ covered by this License.
80
+
81
+ b) Accompany the object code with a copy of the GNU GPL and this license
82
+ document.
83
+
84
+ 4. Combined Works.
85
+
86
+ You may convey a Combined Work under terms of your choice that,
87
+ taken together, effectively do not restrict modification of the
88
+ portions of the Library contained in the Combined Work and reverse
89
+ engineering for debugging such modifications, if you also do each of
90
+ the following:
91
+
92
+ a) Give prominent notice with each copy of the Combined Work that
93
+ the Library is used in it and that the Library and its use are
94
+ covered by this License.
95
+
96
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
97
+ document.
98
+
99
+ c) For a Combined Work that displays copyright notices during
100
+ execution, include the copyright notice for the Library among
101
+ these notices, as well as a reference directing the user to the
102
+ copies of the GNU GPL and this license document.
103
+
104
+ d) Do one of the following:
105
+
106
+ 0) Convey the Minimal Corresponding Source under the terms of this
107
+ License, and the Corresponding Application Code in a form
108
+ suitable for, and under terms that permit, the user to
109
+ recombine or relink the Application with a modified version of
110
+ the Linked Version to produce a modified Combined Work, in the
111
+ manner specified by section 6 of the GNU GPL for conveying
112
+ Corresponding Source.
113
+
114
+ 1) Use a suitable shared library mechanism for linking with the
115
+ Library. A suitable mechanism is one that (a) uses at run time
116
+ a copy of the Library already present on the user's computer
117
+ system, and (b) will operate properly with a modified version
118
+ of the Library that is interface-compatible with the Linked
119
+ Version.
120
+
121
+ e) Provide Installation Information, but only if you would otherwise
122
+ be required to provide such information under section 6 of the
123
+ GNU GPL, and only to the extent that such information is
124
+ necessary to install and execute a modified version of the
125
+ Combined Work produced by recombining or relinking the
126
+ Application with a modified version of the Linked Version. (If
127
+ you use option 4d0, the Installation Information must accompany
128
+ the Minimal Corresponding Source and Corresponding Application
129
+ Code. If you use option 4d1, you must provide the Installation
130
+ Information in the manner specified by section 6 of the GNU GPL
131
+ for conveying Corresponding Source.)
132
+
133
+ 5. Combined Libraries.
134
+
135
+ You may place library facilities that are a work based on the
136
+ Library side by side in a single library together with other library
137
+ facilities that are not Applications and are not covered by this
138
+ License, and convey such a combined library under terms of your
139
+ choice, if you do both of the following:
140
+
141
+ a) Accompany the combined library with a copy of the same work based
142
+ on the Library, uncombined with any other library facilities,
143
+ conveyed under the terms of this License.
144
+
145
+ b) Give prominent notice with the combined library that part of it
146
+ is a work based on the Library, and explaining where to find the
147
+ accompanying uncombined form of the same work.
148
+
149
+ 6. Revised Versions of the GNU Lesser General Public License.
150
+
151
+ The Free Software Foundation may publish revised and/or new versions
152
+ of the GNU Lesser General Public License from time to time. Such new
153
+ versions will be similar in spirit to the present version, but may
154
+ differ in detail to address new problems or concerns.
155
+
156
+ Each version is given a distinguishing version number. If the
157
+ Library as you received it specifies that a certain numbered version
158
+ of the GNU Lesser General Public License "or any later version"
159
+ applies to it, you have the option of following the terms and
160
+ conditions either of that published version or of any later version
161
+ published by the Free Software Foundation. If the Library as you
162
+ received it does not specify a version number of the GNU Lesser
163
+ General Public License, you may choose any version of the GNU Lesser
164
+ General Public License ever published by the Free Software Foundation.
165
+
166
+ If the Library as you received it specifies that a proxy can decide
167
+ whether future versions of the GNU Lesser General Public License shall
168
+ apply, that proxy's public statement of acceptance of any version is
169
+ permanent authorization for you to choose that version for the
170
+ Library.
171
+
172
+ Project-URL: Homepage, https://pytgcalls.github.io/
173
+ Project-URL: Repository, https://github.com/pytgcalls/pytgcalls.git
174
+ Project-URL: Documentation, https://pytgcalls.github.io/PyTgCalls
175
+ Project-URL: Changelog, https://pytgcalls.github.io/PyTgCalls/Changelogs
176
+ Keywords: audio,python,library,video,telegram,stream,ffmpeg,cpp,webrtc,voice-chat,voip,group-chat,video-calls,calls,video-chat,pytgcalls,ntgcalls,tgcalls,py-tgcalls,pyrogram,telethon,hydrogram
177
+ Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
178
+ Classifier: Operating System :: OS Independent
179
+ Classifier: Programming Language :: Python :: 3
180
+ Classifier: Programming Language :: Python :: 3 :: Only
181
+ Classifier: Programming Language :: Python :: 3.8
182
+ Classifier: Programming Language :: Python :: 3.9
183
+ Classifier: Programming Language :: Python :: 3.10
184
+ Classifier: Programming Language :: Python :: 3.11
185
+ Classifier: Programming Language :: Python :: 3.12
186
+ Requires-Python: >=3.8
187
+ Description-Content-Type: text/markdown
188
+ License-File: LICENSE
189
+ Requires-Dist: aiohttp >=3.9.3
190
+ Requires-Dist: ntgcalls >=1.2.0
191
+ Requires-Dist: psutil
192
+ Requires-Dist: screeninfo
193
+ Requires-Dist: deprecation
194
+ Provides-Extra: hydrogram
195
+ Requires-Dist: hydrogram >=0.1.4 ; extra == 'hydrogram'
196
+ Provides-Extra: pyrogram
197
+ Requires-Dist: pyrogram >=1.2.20 ; extra == 'pyrogram'
198
+ Provides-Extra: telethon
199
+ Requires-Dist: telethon >=1.24.0 ; extra == 'telethon'
200
+
201
+ <img src="https://raw.githubusercontent.com/pytgcalls/pytgcalls/master/.github/images/banner.png" alt="pytgcalls logo" />
202
+ <p align="center">
203
+ <b>A simple and elegant client that allows you to make group voice calls quickly and easily.</b>
204
+ <br>
205
+ <a href="https://github.com/pytgcalls/pytgcalls/tree/master/example">
206
+ Examples
207
+ </a>
208
+
209
+ <a href="https://pytgcalls.github.io/">
210
+ Documentation
211
+ </a>
212
+
213
+ <a href="https://pypi.org/project/py-tgcalls/">
214
+ PyPi
215
+ </a>
216
+
217
+ <a href="https://t.me/pytgcallsnews">
218
+ Channel
219
+ </a>
220
+
221
+ <a href="https://t.me/pytgcallschat">
222
+ Chat
223
+ </a>
224
+ </p>
225
+
226
+ # PyTgCalls [![PyPI](https://img.shields.io/pypi/v/py-tgcalls.svg?logo=python&logoColor=%23959DA5&label=pypi&labelColor=%23282f37)](https://pypi.org/project/py-tgcalls/) [![Downloads](https://pepy.tech/badge/py-tgcalls)](https://pepy.tech/project/py-tgcalls)
227
+ This project allows making Telegram call using MtProto and WebRTC, this is possible thanks to the power of [NTgCalls] library and [@evgeny-nadymov]
228
+
229
+ #### Example Usage
230
+ ```python
231
+ from pytgcalls import PyTgCalls
232
+ from pytgcalls import idle
233
+ from pytgcalls.types import MediaStream
234
+ ...
235
+ chat_id = -1001185324811
236
+ app = PyTgCalls(client)
237
+ app.start()
238
+ app.play(
239
+ chat_id,
240
+ MediaStream(
241
+ 'http://docs.evostream.com/sample_content/assets/sintel1m720p.mp4',
242
+ )
243
+ )
244
+ idle()
245
+ ```
246
+
247
+ ## Features
248
+ - Prebuilt wheels for macOS, Linux and Windows.
249
+ - Supporting all type of MTProto libraries: Pyrogram, Telethon and Hydrogram.
250
+ - Work with voice chats in channels and chats.
251
+ - Join as channels or chats.
252
+ - Mute/unmute, pause/resume, stop/play, volume control and more...
253
+
254
+ ## Requirements
255
+ - Python 3.8 or higher.
256
+ - An MTProto Client
257
+ - A [Telegram API key](https://docs.pyrogram.org/intro/setup#api-keys).
258
+
259
+ ## How to install?
260
+ Here's how to install the PyTgCalls lib, the commands are given below:
261
+
262
+ ``` bash
263
+ # With Git
264
+ pip install git+https://github.com/pytgcalls/pytgcalls -U
265
+
266
+ # With PyPi (Recommended)
267
+ pip install py-tgcalls -U
268
+ ```
269
+
270
+ ## Key Contributors
271
+ * <b><a href="https://github.com/Laky-64">@Laky-64</a> (DevOps Engineer, Software Architect):</b>
272
+ * Played a crucial role in developing PyTgCalls being an ex developer of pyservercall and of tgcallsjs.
273
+ * Automation with GitHub Actions
274
+ * <b><a href="https://github.com/kuogi">@kuogi</a> (Senior UI/UX designer, Documenter):</b>
275
+ * As a Senior UI/UX Designer, Kuogi has significantly improved the user interface of our documentation,
276
+ making it more visually appealing and user-friendly.
277
+ * Played a key role in writing and structuring our documentation, ensuring that it is clear,
278
+ informative, and accessible to all users.
279
+ * <b><a href="https://github.com/vrumger">@vrumger</a> (Senior Node.js Developer, Software Architect):</b>
280
+ * Has made important fixes and enhancements to the WebRTC component of the library,
281
+ improving its stability and performance.
282
+ * Main developer of TgCallsJS
283
+ * <b><a href="https://github.com/alemidev">@alemidev</a> (Senior Python Developer):</b>
284
+ * Has made important fixes and enhancements to the async part of the library
285
+
286
+ ## Junior Developers
287
+ * <b><a href="https://github.com/TuriOG">@TuriOG</a> (Junior Python Developer):</b>
288
+ * Currently working on integrating NTgCalls into <a href="//github.com/pytgcalls/pytgcalls">PyTgCalls</a>, an important step
289
+ in expanding the functionality and usability of the library.
290
+
291
+ ## Special Thanks
292
+ * <b><a href="https://github.com/evgeny-nadymov">@evgeny-nadymov</a>:</b>
293
+ A heartfelt thank you to Evgeny Nadymov for graciously allowing us to use their code from telegram-react.
294
+ His contribution has been pivotal to the success of this project.
295
+
296
+ [NTgCalls]: https://github.com/pytgcalls/ntgcalls
297
+ [@evgeny-nadymov]: https://github.com/evgeny-nadymov/
@@ -1,79 +1,79 @@
1
1
  pytgcalls/__init__.py,sha256=TfZGf1enqqs50mBB406vygB6zYgn3vAjBYFUDO4Pviw,248
2
- pytgcalls/__version__.py,sha256=y0B7ZR3Q3YBruJD1vgqFl1sLUm6_2LUesuwSiUVq0eE,25
2
+ pytgcalls/__version__.py,sha256=kumiGImhzOTlTrRM-6jDo2mNnVHGO_2vxtrhB0nzAiw,22
3
3
  pytgcalls/environment.py,sha256=ctCHACvG6l8SdpPewSBhOvc70kbwpv18maC0TwLvZ08,1924
4
4
  pytgcalls/exceptions.py,sha256=0MmAktc53ajYAc7ThjD2tJ9PDyibUi0iHZMfUy2IoKs,4109
5
- pytgcalls/ffmpeg.py,sha256=1GavkVf562Y_8cT4EZxxj_b7Y0-l8yyGkX0D5eUHeas,8520
6
- pytgcalls/filters.py,sha256=cmFWhRkgjQMk1WQqnd-hOAvM6x3dufJ1xjQAEL1vKLQ,4409
5
+ pytgcalls/ffmpeg.py,sha256=sut7ssGcvprC3NWFpCfyguyNKAXaeM0mv3lXSvDPRpM,8518
6
+ pytgcalls/filters.py,sha256=HFMBBbo_NCw6wqTtseHoDRsspJHQ49BUHBA1cxm7u4g,4852
7
7
  pytgcalls/mtproto_required.py,sha256=6B-31p5qH_6oekUgypV4nK3hqPS6Nr-pA8S81wjnbaY,630
8
- pytgcalls/mutex.py,sha256=fSsAL4NuB7esBG90k4eUX388Knpr1_76Mz5BZlkSC0w,1119
9
- pytgcalls/pytgcalls.py,sha256=VI9aRwPE-Lo1lh18ByOnkFxf1_8tq2ECyz5igPo1r8w,1443
8
+ pytgcalls/mutex.py,sha256=Frjji5Ctzlk4AXEBuBLnDK-7HbtreoV6zuyKpFpMNI4,236
9
+ pytgcalls/pytgcalls.py,sha256=oBcWgBwusnXmjHrLEE99VVXARReVyrXdn9SyeBWHbVo,1479
10
10
  pytgcalls/pytgcalls_session.py,sha256=_BGJWvf7t3mki2DhlEPjh9cypvYuSFkMSxzTsfepwUk,2719
11
- pytgcalls/scaffold.py,sha256=d5NFFm-Ntlu07fpXOE_OI4ULrvNb3Y4WDtM0nsKjqk4,986
11
+ pytgcalls/scaffold.py,sha256=LihXRBl1kSqJSQvEoH5rAXJXrbnnIqSMBYrhXpW5hHs,958
12
12
  pytgcalls/statictypes.py,sha256=CdlqgQNhTZ_uTE8-B8m01fJ7TlD2B42EI2QBPxDdAtA,3842
13
13
  pytgcalls/sync.py,sha256=IsOH3TD7cxUg_-zdGt12HoS8sBlXvcGayPZAoxxKM48,3396
14
14
  pytgcalls/version_manager.py,sha256=egeGgvb66zWlLTMuw2U-b0x8MfnRzMm1xAEVN87HF5c,296
15
- pytgcalls/ytdlp.py,sha256=4Sl0L2uEmBSeRYfpavtAmxv41AOiQ3LotEjrqRbehc0,1961
15
+ pytgcalls/ytdlp.py,sha256=VqeWts_jgPJTmcOM5_rckuKEOA0N2FujaBWvX3CyXE0,2196
16
16
  pytgcalls/custom_api/__init__.py,sha256=ZT8d0lc2YrDuw_YSFAXXHHMewoXGFZ-ANOBIAr0vGFQ,60
17
17
  pytgcalls/custom_api/custom_api.py,sha256=Ko3aS6psrwPmOhRPxvG0fepXt4STrA0StvINSxz4Cj8,1890
18
18
  pytgcalls/handlers/__init__.py,sha256=pubbxI4pLqQpAKf8-toD6ija4cpSvbCJOQFjTiDjX1E,75
19
19
  pytgcalls/handlers/handlers_holder.py,sha256=eDCRF6-zPSUmBb8ZuAPiJfgDvg2Qv6efdX6GlOXHxTA,1033
20
20
  pytgcalls/media_devices/__init__.py,sha256=H6uUA6akUqp8WCiT2gLrqUtFdqpd9rcfqDviP5Vhrls,183
21
21
  pytgcalls/media_devices/device_info.py,sha256=KueJCRVXXDcxQJzoGfkzcD2kL58pkMUn7Fr3aUwnNtQ,489
22
- pytgcalls/media_devices/media_devices.py,sha256=0zCst7GzMHg9QyvNwGUyuveFzfvwUGEGfU8RrLnFH_I,3149
22
+ pytgcalls/media_devices/media_devices.py,sha256=KG4fKfubpeMQZVm9IuQmzDaLhsvKzKRdE3zIYRAhEHM,3227
23
23
  pytgcalls/media_devices/screen_info.py,sha256=ARD5nQoYDUt1rU-kOK8G5O5byGXGeFbZWWdDswdCDHc,1107
24
24
  pytgcalls/methods/__init__.py,sha256=hk1blAT5u_Isemdrg0nqInLsdRzTTZnak5NdAfkBPAk,217
25
25
  pytgcalls/methods/calls/__init__.py,sha256=xg4DZZClEnxwaj-DAq3e8gSR-g-MiYBdUEBth64lSXA,214
26
26
  pytgcalls/methods/calls/change_volume_call.py,sha256=viA3yHVxPJ421yE1dfFTh-kNEFTxMlaVFxVjC-PeX-0,719
27
- pytgcalls/methods/calls/get_participants.py,sha256=dT725XXn9oiTbWV6mFradIydoQUx_COPButivDhzAxE,568
28
- pytgcalls/methods/calls/leave_call.py,sha256=ZjZbjlQn8KuX3mUjzXfX42EpL9_iU3fsXYdidfqUrUM,1091
27
+ pytgcalls/methods/calls/get_participants.py,sha256=gKUAzvha1RpvbtSI_n-GlBQkOONxzibCaCr4aA17Mag,567
28
+ pytgcalls/methods/calls/leave_call.py,sha256=e3lYJKFD29Qg1qgolmLKUk9_X1uApOT1pGYF8ZgwMqQ,1369
29
29
  pytgcalls/methods/decorators/__init__.py,sha256=TCGaEVZnHjtOwv-3PNfaCVm0kyFhJApUPUNntt6MwyM,78
30
30
  pytgcalls/methods/decorators/on_update.py,sha256=ZTL4YcQk0N4Ru56a5WItUvkSN5SAqr6_RDZvXmZMIHs,316
31
31
  pytgcalls/methods/stream/__init__.py,sha256=_4j-CEby4_2Kadva86tFMC4GSSzhBBjKLXfrgTk4gzo,343
32
32
  pytgcalls/methods/stream/mute_stream.py,sha256=auo2aAazfEC90Ab6MzaiPdddiJ1w4fN_9HaORkAeOBY,570
33
33
  pytgcalls/methods/stream/pause_stream.py,sha256=z_AIWABrQMHmTwvlah_PrH9EjXbro8gKxZni4Km5ICg,573
34
- pytgcalls/methods/stream/play.py,sha256=acuav8C9wEyur8FMAT7zFxkEvNDu45gnodUmGFrfIKA,7376
34
+ pytgcalls/methods/stream/play.py,sha256=wU4WKEp4cMfJPVDW-aug69HrzXrMJHCKkqrv-pCxQkg,7307
35
35
  pytgcalls/methods/stream/played_time.py,sha256=IkUdyHrqpzpRl9uf0uZhg1COo4zsHnQOPu3nipjVatI,570
36
36
  pytgcalls/methods/stream/resume_stream.py,sha256=z_DgP4cDExjEqEeX_ZL--50MXQ9lrATK876SIwE71PQ,576
37
37
  pytgcalls/methods/stream/unmute_stream.py,sha256=KUMhfMbhsPmZsmpF4cGWC1FVW7YwXha2MmQnqrBhM8s,576
38
38
  pytgcalls/methods/utilities/__init__.py,sha256=JcKwqNo6fFXXfuab94fNEraKF1P9fnSSgr0WQDRjF2w,339
39
39
  pytgcalls/methods/utilities/cache_peer.py,sha256=Ylt0wCCJOoNKf1wZEXjfE8aBZKUIIgdRUFOMTGA5DfE,140
40
- pytgcalls/methods/utilities/call_holder.py,sha256=RZ9DFhZO66ghtGqxLbYS86hq2UCjTzTiN_xzL5bgD-M,903
40
+ pytgcalls/methods/utilities/call_holder.py,sha256=MQxAYL3fDDWhf3UFRyLhJD_FVYOeWUNkr8pAII46htQ,972
41
41
  pytgcalls/methods/utilities/compose.py,sha256=Nzdv8orMmka5NIBZ1SW1nsqXRzArZl4m6FdZU7syaR4,334
42
42
  pytgcalls/methods/utilities/cpu_usage.py,sha256=Mbga4MFCIwuh7WC8sqBbv1Pa6ALcp5AIDyfYMH_Bix4,162
43
- pytgcalls/methods/utilities/idle.py,sha256=lkjbYzpU7iz-maE0kS6RVtHJ4h1PsmGqnZmaENGIKeE,768
43
+ pytgcalls/methods/utilities/idle.py,sha256=MDdzHTv1ws2yBhsvhBUnssGdghkZ2KwR0HUCPOwV38o,814
44
44
  pytgcalls/methods/utilities/ping.py,sha256=hhIMSHk2BzMB-IKpwLdZFVrsEvGm2ftJwKLs1k4anh8,244
45
45
  pytgcalls/methods/utilities/resolve_chat_id.py,sha256=92x2LHbUlnJMm-kS3fXOYmzYpY2TZbqtQD2rw3eBXDY,382
46
46
  pytgcalls/methods/utilities/run.py,sha256=cnYQd2xB5Cr_WS0Q2cXJZPGiN6JOCULzj1r4xXVyrlg,152
47
- pytgcalls/methods/utilities/start.py,sha256=qhFiuVdkUnyTNMaoSQGwn5XFZrirKRkBphFeHrzHmo8,8498
47
+ pytgcalls/methods/utilities/start.py,sha256=7mHp6RkfhuYC6i0JYmQvxK4KYRmkcvOs9kSrClPhNnk,9342
48
48
  pytgcalls/methods/utilities/stream_params.py,sha256=hYcNxx__McmPeHgOUDEuNcN7ThgDjukejQYHrfmWm-A,1519
49
49
  pytgcalls/mtproto/__init__.py,sha256=X4zvzFG7km7qHyE0fdvA550WcOVO_xl_p__gvIfDGmw,130
50
50
  pytgcalls/mtproto/bridged_client.py,sha256=kK22n-CKjtfmtNE6bXCpuL6kWAUK2_Ul7cGgx_HNuHQ,4975
51
- pytgcalls/mtproto/client_cache.py,sha256=LYjmvhgaaEyczoJFZ35vGXFlN4ADwXYvt1bhrVS4ipw,5088
52
- pytgcalls/mtproto/hydrogram_client.py,sha256=TgItS6KKPJna1yIXJ7iXflfRWRpPvMXHoRKzo6q09lE,21014
53
- pytgcalls/mtproto/mtproto_client.py,sha256=rqsUOE7llTXSAru9GfBMhUKufEgWQL65QLHRj4TEfgw,6884
54
- pytgcalls/mtproto/pyrogram_client.py,sha256=cNaQu00rZTFVTj3CE2V_eL5yT1XcGwkgwcGfb6aa53s,21203
55
- pytgcalls/mtproto/telethon_client.py,sha256=GFZ0LM8PXRVXwJfYV_gVVZ_qjEmWCJD_nmqiPE8oCCo,20105
56
- pytgcalls/types/__init__.py,sha256=JTMTa2flwWkBSEjhAAXE0oL4IJFRb12XU0npp9Neypc,1071
51
+ pytgcalls/mtproto/client_cache.py,sha256=1yA5CFAmWZUsWdpqk5vlaN3j1RV1rIN-X7EcqmsnlfY,5087
52
+ pytgcalls/mtproto/hydrogram_client.py,sha256=iSqwvK8yZZCYMmFQOSXpcDwZOFrBGt-3vJUMyxar-Sc,21116
53
+ pytgcalls/mtproto/mtproto_client.py,sha256=LO71RqgxZ3bYxSFb6l9cc4ks6_peyqHN4i_z478c7yw,6883
54
+ pytgcalls/mtproto/pyrogram_client.py,sha256=iyJMJo6iTULfmGh-jdfJgu8DNVFxzOn28A5_E7uH4-Q,21305
55
+ pytgcalls/mtproto/telethon_client.py,sha256=8BkYncXnPUIJRgrhUBnMIlXV2_fm6vLkN8URVaSuow4,20207
56
+ pytgcalls/types/__init__.py,sha256=yJVJZoH9M9u9VgpZGUX-MF4NzE-vKp4KrId21YQbcGE,910
57
57
  pytgcalls/types/browsers.py,sha256=47Kr5q96n4Q4WvVhA6IUlS2egEcA9GRLlDeFcQYyc9M,9545
58
58
  pytgcalls/types/cache.py,sha256=FfsOcmYnsBGPlJoTPIXXYcUSpGE3rhx6cjIH77hyUL0,1059
59
+ pytgcalls/types/dict.py,sha256=lAo9hu4VlVJa9S7P8Y81BYmKtvz0rH7hwpGcH3ynHUw,78
60
+ pytgcalls/types/flag.py,sha256=dQPcQmTgTQzcOLTvGe8t_e9mY4qsVnCZFrrTk17b2Xw,132
59
61
  pytgcalls/types/list.py,sha256=UjP_XxxMpPkLlu6yEy29JYqOM5VITFwwJcDm0wZni1c,78
60
- pytgcalls/types/participant_list.py,sha256=-thRoLgnsTW9ujPHNEwrWgOY8GRwsl_k99DslsHLDQ0,879
62
+ pytgcalls/types/participant_list.py,sha256=LmGjU63MK1v3SS2_4xNbk04OOjmukNdAXYLRn2L-730,916
61
63
  pytgcalls/types/py_object.py,sha256=VlazuMP0cFpExKimW8BtWR66LDewnNdQSLC7r_t7JIM,842
62
64
  pytgcalls/types/update.py,sha256=wPCzWLhrsScZ3ksRTyt8IuDaaG5YI-ItG_Yw-OqzK2Y,157
63
65
  pytgcalls/types/user_agent.py,sha256=sSfeGqUe0v0wqBgdVszNFK0iOC_0Tdyto9CglBXlY4U,1086
64
66
  pytgcalls/types/calls/__init__.py,sha256=6O2wp7I3d2YGLNeMgXTRyG37Y6BESafneLdr9n37_4s,346
65
- pytgcalls/types/calls/call.py,sha256=On9NXxExNCH9I4YrEuTKQUDT6BlAKKl551dYOIlseeo,761
67
+ pytgcalls/types/calls/call.py,sha256=wxa3L3nZnbTKtZbezCaA3iUt4rZ5IriQyMMrgRlp7GA,485
66
68
  pytgcalls/types/calls/call_config.py,sha256=b6P43YTGF2t7E2CyD1mSYPJDUBvYYeHoxB3hSbTVyOY,120
67
- pytgcalls/types/calls/call_data.py,sha256=uKs-tbFdGnwMSw30je6yI7efe2KdXGC7gYKi7q27GtA,530
69
+ pytgcalls/types/calls/call_data.py,sha256=-qPj2QhWv32Xs7LyFQY4hiWDqJ21B8VBvdzREK8bDvY,544
68
70
  pytgcalls/types/calls/call_protocol.py,sha256=OVIQs1VgdY-DWbZbNr41hjLA4pGQvHx8Rgom1_NhJxQ,408
69
71
  pytgcalls/types/calls/group_call_config.py,sha256=auKH-hZJWj8PhTkyeQ_VK2z9NpNvNC7Scl_IhEUMnQM,353
70
- pytgcalls/types/calls/raw_call_update.py,sha256=pRiqpQfZha57SCQADk58WT4UHfp_smK71r05mmgmDbU,795
71
- pytgcalls/types/groups/__init__.py,sha256=S2bwXC6BA-NfCyDOoMqkd6YivFRJcy6hX5-EClpu1ms,463
72
- pytgcalls/types/groups/chat_update.py,sha256=U_8YSMdrx10ARormhwdbnZt-GQ1rjlLOKK4Vog9duCg,738
73
- pytgcalls/types/groups/group_call_participant.py,sha256=9HTC0Bw0AGU_MgThk3ieQSdfJGHDJZ5uU_SpOxvLr9U,757
74
- pytgcalls/types/groups/joined_group_call_participant.py,sha256=FRI0J9FEBacs4JoioXfQtYyKSP_z_lezxNW0p-tWyeA,291
75
- pytgcalls/types/groups/left_group_call_participant.py,sha256=9J-lVyA_u11VFLO3vW7bTWKE6pBkL3BXzqsVWAkVRzM,289
76
- pytgcalls/types/groups/updated_group_call_participant.py,sha256=ZZ-VqFYAvGCF3oBFW2kroCyanvAt6o-iJkizwdwoLe8,292
72
+ pytgcalls/types/calls/raw_call_update.py,sha256=hpNw6HrTW8Z36Lh2HinS-wzprryRtsIxyIFbIfjGgeI,795
73
+ pytgcalls/types/chats/__init__.py,sha256=v8pUp_vbr2kQpyHtAQc80N-YqzmXHe9SbllUsa6njkU,261
74
+ pytgcalls/types/chats/chat_update.py,sha256=wh8v2I-pZxJWGNBjIwWRbhY-ZCI4v8qGabDTpuJaHu0,619
75
+ pytgcalls/types/chats/group_call_participant.py,sha256=HQ2EVZKE1_uEjtUKdUA8yJemdc189IN4mioSP-KDEiY,1020
76
+ pytgcalls/types/chats/updated_group_call_participant.py,sha256=-KID-z-4e43fhYWQp0pNMKPfmZizbJHXyzn6yLtIGNg,291
77
77
  pytgcalls/types/raw/__init__.py,sha256=ROHsKFeUMUtlFbx2rhfrdB-TuVm0zBuvNo29Ccn5614,308
78
78
  pytgcalls/types/raw/audio_parameters.py,sha256=1DsBPwdn_Ukd2Tbkb3whP_ILo9xJY_3XNNmbO4_NO9Q,449
79
79
  pytgcalls/types/raw/audio_stream.py,sha256=wEMa93hHt0VBUSuS6gPJlFIGZp5GdNU94O2C2u4AXnY,476
@@ -82,12 +82,12 @@ pytgcalls/types/raw/video_parameters.py,sha256=LXBpdaw5vyNayVfgtmF-gRkCY_ATwAnun
82
82
  pytgcalls/types/raw/video_stream.py,sha256=2Chrk7NFWF1H9V7hH71RZ5rF3iBhT53syFkHKw4-5gc,433
83
83
  pytgcalls/types/stream/__init__.py,sha256=xfF-9ZulOLk3E6G1nw1Ky0ZRWXlFuER0Uj8HQn3650w,338
84
84
  pytgcalls/types/stream/audio_quality.py,sha256=4X94ErmTeLP4TVcE3eLtPPdtluSPxgxbgTosuNJOVhc,141
85
- pytgcalls/types/stream/media_stream.py,sha256=vH32FrwdMSA9-S54bvessVHewh_l-5WXqupQE8pe-x4,8979
85
+ pytgcalls/types/stream/media_stream.py,sha256=ZtREk2bjrBRnyKWdJWgxCa8z_NX7Oa02wUITcoI80m8,8860
86
86
  pytgcalls/types/stream/stream_audio_ended.py,sha256=2_EFa98F0vWu0d0jBmLtzp4NH_xBkDO_6yP9UtyKuCs,164
87
87
  pytgcalls/types/stream/stream_video_ended.py,sha256=9YFTTZPMDpB95eb815rGtgDrzBGfTeazJ5mZwP6Hvks,164
88
88
  pytgcalls/types/stream/video_quality.py,sha256=HBfWq005kh-D19MaVE9VzVdnODzrXf4IJUimCfslfiU,231
89
- py_tgcalls-2.0.0rc6.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
90
- py_tgcalls-2.0.0rc6.dist-info/METADATA,sha256=0rWEYipuPX9YXcaO_Q2qmINeiYELecuBJAbDrbcYw8A,4886
91
- py_tgcalls-2.0.0rc6.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
92
- py_tgcalls-2.0.0rc6.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
93
- py_tgcalls-2.0.0rc6.dist-info/RECORD,,
89
+ py_tgcalls-2.0.2.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
90
+ py_tgcalls-2.0.2.dist-info/METADATA,sha256=0Fmju1o3_K53gft3sMZpLHnaPKlK6c4ioF660I5SYkM,14357
91
+ py_tgcalls-2.0.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
92
+ py_tgcalls-2.0.2.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
93
+ py_tgcalls-2.0.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
pytgcalls/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '2.0.0rc6'
1
+ __version__ = '2.0.2'
pytgcalls/ffmpeg.py CHANGED
@@ -48,12 +48,10 @@ async def check_stream(
48
48
  except FileNotFoundError:
49
49
  raise FFmpegError('ffprobe not installed')
50
50
 
51
- stream_list = []
52
- format_content = []
53
51
  try:
54
52
  stdout, stderr = await asyncio.wait_for(
55
53
  ffprobe.communicate(),
56
- timeout=30,
54
+ timeout=20,
57
55
  )
58
56
  result = loads(stdout.decode('utf-8')) or {}
59
57
  stream_list = result.get('streams', [])
@@ -61,7 +59,8 @@ async def check_stream(
61
59
  if 'No such file' in stderr.decode('utf-8'):
62
60
  raise FileNotFoundError()
63
61
  except (subprocess.TimeoutExpired, JSONDecodeError):
64
- pass
62
+ ffprobe.terminate()
63
+ raise
65
64
 
66
65
  have_video = False
67
66
  is_image = False
@@ -127,15 +126,15 @@ async def cleanup_commands(
127
126
  stdout=asyncio.subprocess.PIPE,
128
127
  stderr=asyncio.subprocess.PIPE,
129
128
  )
130
- result = ''
131
129
  try:
132
130
  stdout, _ = await asyncio.wait_for(
133
131
  proc_res.communicate(),
134
- timeout=30,
132
+ timeout=20,
135
133
  )
136
134
  result = stdout.decode('utf-8')
137
135
  except (subprocess.TimeoutExpired, JSONDecodeError):
138
- pass
136
+ proc_res.terminate()
137
+ raise
139
138
  supported = re.findall(r'(?m)^ *(-.*?)\s+', result)
140
139
  new_commands = []
141
140
  ignore_next = False
pytgcalls/filters.py CHANGED
@@ -7,6 +7,7 @@ from typing import Union
7
7
  from .mtproto import BridgedClient
8
8
  from .pytgcalls import PyTgCalls
9
9
  from .types import ChatUpdate
10
+ from .types import GroupCallParticipant
10
11
  from .types import StreamAudioEnded
11
12
  from .types import StreamVideoEnded
12
13
  from .types import Update
@@ -138,7 +139,7 @@ async def _stream_filter(_, __, u: Update):
138
139
  return isinstance(u, (StreamVideoEnded, StreamAudioEnded))
139
140
 
140
141
 
141
- stream = create(_stream_filter)
142
+ stream_end = create(_stream_filter)
142
143
 
143
144
 
144
145
  # noinspection PyPep8Naming
@@ -167,3 +168,15 @@ class chat_update(Filter):
167
168
  if isinstance(update, ChatUpdate):
168
169
  return self.flags & update.status
169
170
  return False
171
+
172
+
173
+ class call_participant(Filter):
174
+ def __init__(self, flags: Optional[GroupCallParticipant.Action] = None):
175
+ self.flags = flags
176
+
177
+ async def __call__(self, client: PyTgCalls, update: Update):
178
+ if isinstance(update, UpdatedGroupCallParticipant):
179
+ if self.flags is None:
180
+ return True
181
+ self.flags & update.participant.action
182
+ return False
@@ -72,9 +72,11 @@ class MediaDevices:
72
72
  except subprocess.TimeoutExpired:
73
73
  return list_devices
74
74
  if platform == 'win32':
75
- list_raw = result.split('DirectShow audio devices')[1]
75
+ list_raw = result.split('DirectShow audio devices')
76
+ if len(list_raw) < 2:
77
+ return list_devices
76
78
  output = re.findall(
77
- '\\[.*?].*?"(.*?)".*?\n\\[.*?].*?"(.*?)"', list_raw,
79
+ '\\[.*?].*?"(.*?)".*?\n\\[.*?].*?"(.*?)"', list_raw[1],
78
80
  )
79
81
  for device in output:
80
82
  list_devices.append(
@@ -5,7 +5,7 @@ from typing import Union
5
5
  from ...mtproto_required import mtproto_required
6
6
  from ...scaffold import Scaffold
7
7
  from ...statictypes import statictypes
8
- from ...types.groups import GroupCallParticipant
8
+ from ...types.chats import GroupCallParticipant
9
9
 
10
10
 
11
11
  class GetParticipants(Scaffold):
@@ -19,6 +19,15 @@ class LeaveCall(Scaffold):
19
19
  chat_id: Union[int, str],
20
20
  ):
21
21
  chat_id = await self.resolve_chat_id(chat_id)
22
+ is_p2p_waiting = (
23
+ chat_id in self._p2p_configs and
24
+ not self._p2p_configs[chat_id].wait_data.done()
25
+ )
26
+ if not is_p2p_waiting:
27
+ try:
28
+ await self._binding.stop(chat_id)
29
+ except ConnectionNotFound:
30
+ raise NotInCallError()
22
31
  if chat_id < 0: # type: ignore
23
32
  chat_call = await self._app.get_full_chat(
24
33
  chat_id,
@@ -32,9 +41,8 @@ class LeaveCall(Scaffold):
32
41
  )
33
42
  else:
34
43
  await self._app.discard_call(chat_id)
35
- try:
36
- await self._binding.stop(chat_id)
37
- except ConnectionNotFound:
38
- raise NotInCallError()
44
+ if is_p2p_waiting:
45
+ self._p2p_configs.pop(chat_id)
46
+ return
39
47
  if chat_id < 0: # type: ignore
40
48
  self._need_unmute.discard(chat_id)
@@ -102,9 +102,7 @@ class Play(Scaffold):
102
102
  )
103
103
  data.g_a_or_b = await self._binding.create_p2p_call(
104
104
  chat_id,
105
- data.g,
106
- data.p,
107
- data.random,
105
+ data.dh_config,
108
106
  data.g_a_or_b,
109
107
  media_description,
110
108
  )
@@ -2,7 +2,7 @@ from ntgcalls import StreamStatus
2
2
 
3
3
  from ...scaffold import Scaffold
4
4
  from ...types import Call
5
- from ...types.list import List
5
+ from ...types.dict import Dict
6
6
 
7
7
 
8
8
  class CallHolder(Scaffold):
@@ -16,19 +16,22 @@ class CallHolder(Scaffold):
16
16
 
17
17
  @property
18
18
  async def calls(self):
19
- calls_list: dict = await self._binding.calls() # type: ignore
20
- return List([
21
- Call(x, self._conversions[calls_list[x]]) for x in calls_list
22
- ])
19
+ calls_list = await self._binding.calls()
20
+ return Dict({
21
+ x: Call(x, self._conversions[calls_list[x]])
22
+ for x in calls_list
23
+ })
23
24
 
24
25
  @property
25
26
  async def group_calls(self):
26
- return List([
27
- x for x in await self.calls if x.chat_id < 0
28
- ])
27
+ return Dict({
28
+ chat_id: x
29
+ for chat_id, x in (await self.calls).items() if chat_id < 0
30
+ })
29
31
 
30
32
  @property
31
33
  async def private_calls(self):
32
- return List([
33
- x for x in await self.calls if x.chat_id > 0
34
- ])
34
+ return Dict({
35
+ chat_id: x
36
+ for chat_id, x in (await self.calls).items() if chat_id > 0
37
+ })
@@ -20,8 +20,8 @@ async def idle():
20
20
  task = None
21
21
 
22
22
  def signal_handler(signum, __):
23
- py_logger.info(f"Stop signal received ({signals[signum]}). Exiting...")
24
- task.cancel()
23
+ py_logger.info(f'Stop signal received ({signals[signum]}). Exiting...')
24
+ asyncio.get_event_loop().run_in_executor(None, task.cancel)
25
25
 
26
26
  for s in (SIGINT, SIGTERM, SIGABRT):
27
27
  signal_fn(s, signal_handler)