pytgcallszero 0.0.1__tar.gz

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 (130) hide show
  1. pytgcallszero-0.0.1/LICENSE +165 -0
  2. pytgcallszero-0.0.1/PKG-INFO +126 -0
  3. pytgcallszero-0.0.1/README.md +94 -0
  4. pytgcallszero-0.0.1/pyproject.toml +51 -0
  5. pytgcallszero-0.0.1/pytgcallszero/__init__.py +15 -0
  6. pytgcallszero-0.0.1/pytgcallszero/__version__.py +1 -0
  7. pytgcallszero-0.0.1/pytgcallszero/chat_lock.py +25 -0
  8. pytgcallszero-0.0.1/pytgcallszero/custom_api/__init__.py +3 -0
  9. pytgcallszero-0.0.1/pytgcallszero/custom_api/custom_api.py +62 -0
  10. pytgcallszero-0.0.1/pytgcallszero/environment.py +53 -0
  11. pytgcallszero-0.0.1/pytgcallszero/exceptions.py +171 -0
  12. pytgcallszero-0.0.1/pytgcallszero/ffmpeg.py +298 -0
  13. pytgcallszero-0.0.1/pytgcallszero/filters.py +229 -0
  14. pytgcallszero-0.0.1/pytgcallszero/handlers/__init__.py +3 -0
  15. pytgcallszero-0.0.1/pytgcallszero/handlers/handlers_holder.py +49 -0
  16. pytgcallszero-0.0.1/pytgcallszero/list_to_cmd.py +11 -0
  17. pytgcallszero-0.0.1/pytgcallszero/media_devices/__init__.py +13 -0
  18. pytgcallszero-0.0.1/pytgcallszero/media_devices/device_info.py +13 -0
  19. pytgcallszero-0.0.1/pytgcallszero/media_devices/input_device.py +11 -0
  20. pytgcallszero-0.0.1/pytgcallszero/media_devices/media_devices.py +50 -0
  21. pytgcallszero-0.0.1/pytgcallszero/media_devices/screen_device.py +10 -0
  22. pytgcallszero-0.0.1/pytgcallszero/media_devices/speaker_device.py +10 -0
  23. pytgcallszero-0.0.1/pytgcallszero/methods/__init__.py +15 -0
  24. pytgcallszero-0.0.1/pytgcallszero/methods/calls/__init__.py +11 -0
  25. pytgcallszero-0.0.1/pytgcallszero/methods/calls/change_volume_call.py +31 -0
  26. pytgcallszero-0.0.1/pytgcallszero/methods/calls/get_participants.py +24 -0
  27. pytgcallszero-0.0.1/pytgcallszero/methods/calls/leave_call.py +52 -0
  28. pytgcallszero-0.0.1/pytgcallszero/methods/decorators/__init__.py +7 -0
  29. pytgcallszero-0.0.1/pytgcallszero/methods/decorators/on_update.py +14 -0
  30. pytgcallszero-0.0.1/pytgcallszero/methods/internal/__init__.py +35 -0
  31. pytgcallszero-0.0.1/pytgcallszero/methods/internal/clear_cache.py +11 -0
  32. pytgcallszero-0.0.1/pytgcallszero/methods/internal/clear_call.py +18 -0
  33. pytgcallszero-0.0.1/pytgcallszero/methods/internal/connect_call.py +143 -0
  34. pytgcallszero-0.0.1/pytgcallszero/methods/internal/emit_sig_data.py +9 -0
  35. pytgcallszero-0.0.1/pytgcallszero/methods/internal/handle_connection_changed.py +27 -0
  36. pytgcallszero-0.0.1/pytgcallszero/methods/internal/handle_mtproto_updates.py +176 -0
  37. pytgcallszero-0.0.1/pytgcallszero/methods/internal/handle_stream_ended.py +23 -0
  38. pytgcallszero-0.0.1/pytgcallszero/methods/internal/handle_stream_frame.py +41 -0
  39. pytgcallszero-0.0.1/pytgcallszero/methods/internal/join_presentation.py +58 -0
  40. pytgcallszero-0.0.1/pytgcallszero/methods/internal/log_retries.py +14 -0
  41. pytgcallszero-0.0.1/pytgcallszero/methods/internal/request_broadcast_part.py +42 -0
  42. pytgcallszero-0.0.1/pytgcallszero/methods/internal/request_broadcast_timestamp.py +25 -0
  43. pytgcallszero-0.0.1/pytgcallszero/methods/internal/switch_connection.py +35 -0
  44. pytgcallszero-0.0.1/pytgcallszero/methods/internal/update_sources.py +42 -0
  45. pytgcallszero-0.0.1/pytgcallszero/methods/internal/update_status.py +22 -0
  46. pytgcallszero-0.0.1/pytgcallszero/methods/stream/__init__.py +21 -0
  47. pytgcallszero-0.0.1/pytgcallszero/methods/stream/mute.py +22 -0
  48. pytgcallszero-0.0.1/pytgcallszero/methods/stream/pause.py +22 -0
  49. pytgcallszero-0.0.1/pytgcallszero/methods/stream/play.py +98 -0
  50. pytgcallszero-0.0.1/pytgcallszero/methods/stream/record.py +43 -0
  51. pytgcallszero-0.0.1/pytgcallszero/methods/stream/resume.py +22 -0
  52. pytgcallszero-0.0.1/pytgcallszero/methods/stream/send_frame.py +38 -0
  53. pytgcallszero-0.0.1/pytgcallszero/methods/stream/time.py +24 -0
  54. pytgcallszero-0.0.1/pytgcallszero/methods/stream/unmute.py +22 -0
  55. pytgcallszero-0.0.1/pytgcallszero/methods/utilities/__init__.py +19 -0
  56. pytgcallszero-0.0.1/pytgcallszero/methods/utilities/cache_peer.py +7 -0
  57. pytgcallszero-0.0.1/pytgcallszero/methods/utilities/call_holder.py +40 -0
  58. pytgcallszero-0.0.1/pytgcallszero/methods/utilities/compose.py +18 -0
  59. pytgcallszero-0.0.1/pytgcallszero/methods/utilities/cpu_usage.py +7 -0
  60. pytgcallszero-0.0.1/pytgcallszero/methods/utilities/idle.py +35 -0
  61. pytgcallszero-0.0.1/pytgcallszero/methods/utilities/ping.py +12 -0
  62. pytgcallszero-0.0.1/pytgcallszero/methods/utilities/resolve_chat_id.py +14 -0
  63. pytgcallszero-0.0.1/pytgcallszero/methods/utilities/run.py +8 -0
  64. pytgcallszero-0.0.1/pytgcallszero/methods/utilities/start.py +91 -0
  65. pytgcallszero-0.0.1/pytgcallszero/methods/utilities/stream_params.py +89 -0
  66. pytgcallszero-0.0.1/pytgcallszero/mtproto/__init__.py +4 -0
  67. pytgcallszero-0.0.1/pytgcallszero/mtproto/bridged_client.py +338 -0
  68. pytgcallszero-0.0.1/pytgcallszero/mtproto/client_cache.py +194 -0
  69. pytgcallszero-0.0.1/pytgcallszero/mtproto/hydrogram_client.py +857 -0
  70. pytgcallszero-0.0.1/pytgcallszero/mtproto/mtproto_client.py +329 -0
  71. pytgcallszero-0.0.1/pytgcallszero/mtproto/pyrogram_client.py +863 -0
  72. pytgcallszero-0.0.1/pytgcallszero/mtproto/telethon_client.py +810 -0
  73. pytgcallszero-0.0.1/pytgcallszero/mtproto_required.py +25 -0
  74. pytgcallszero-0.0.1/pytgcallszero/mutex.py +13 -0
  75. pytgcallszero-0.0.1/pytgcallszero/pytgcalls.py +57 -0
  76. pytgcallszero-0.0.1/pytgcallszero/pytgcalls_session.py +72 -0
  77. pytgcallszero-0.0.1/pytgcallszero/scaffold.py +135 -0
  78. pytgcallszero-0.0.1/pytgcallszero/statictypes.py +107 -0
  79. pytgcallszero-0.0.1/pytgcallszero/sync.py +112 -0
  80. pytgcallszero-0.0.1/pytgcallszero/types/__init__.py +49 -0
  81. pytgcallszero-0.0.1/pytgcallszero/types/browsers.py +380 -0
  82. pytgcallszero-0.0.1/pytgcallszero/types/cache.py +45 -0
  83. pytgcallszero-0.0.1/pytgcallszero/types/calls/__init__.py +19 -0
  84. pytgcallszero-0.0.1/pytgcallszero/types/calls/call.py +26 -0
  85. pytgcallszero-0.0.1/pytgcallszero/types/calls/call_config.py +6 -0
  86. pytgcallszero-0.0.1/pytgcallszero/types/calls/call_data.py +21 -0
  87. pytgcallszero-0.0.1/pytgcallszero/types/calls/call_protocol.py +16 -0
  88. pytgcallszero-0.0.1/pytgcallszero/types/calls/call_sources.py +4 -0
  89. pytgcallszero-0.0.1/pytgcallszero/types/calls/group_call_config.py +14 -0
  90. pytgcallszero-0.0.1/pytgcallszero/types/calls/pending_connection.py +17 -0
  91. pytgcallszero-0.0.1/pytgcallszero/types/calls/raw_call_update.py +31 -0
  92. pytgcallszero-0.0.1/pytgcallszero/types/chats/__init__.py +9 -0
  93. pytgcallszero-0.0.1/pytgcallszero/types/chats/chat_update.py +33 -0
  94. pytgcallszero-0.0.1/pytgcallszero/types/chats/group_call_participant.py +55 -0
  95. pytgcallszero-0.0.1/pytgcallszero/types/chats/updated_group_call_participant.py +14 -0
  96. pytgcallszero-0.0.1/pytgcallszero/types/dict.py +10 -0
  97. pytgcallszero-0.0.1/pytgcallszero/types/flag.py +7 -0
  98. pytgcallszero-0.0.1/pytgcallszero/types/list.py +10 -0
  99. pytgcallszero-0.0.1/pytgcallszero/types/participant_list.py +33 -0
  100. pytgcallszero-0.0.1/pytgcallszero/types/py_object.py +34 -0
  101. pytgcallszero-0.0.1/pytgcallszero/types/raw/__init__.py +13 -0
  102. pytgcallszero-0.0.1/pytgcallszero/types/raw/audio_parameters.py +15 -0
  103. pytgcallszero-0.0.1/pytgcallszero/types/raw/audio_stream.py +18 -0
  104. pytgcallszero-0.0.1/pytgcallszero/types/raw/stream.py +21 -0
  105. pytgcallszero-0.0.1/pytgcallszero/types/raw/video_parameters.py +21 -0
  106. pytgcallszero-0.0.1/pytgcallszero/types/raw/video_stream.py +18 -0
  107. pytgcallszero-0.0.1/pytgcallszero/types/stream/__init__.py +23 -0
  108. pytgcallszero-0.0.1/pytgcallszero/types/stream/audio_quality.py +8 -0
  109. pytgcallszero-0.0.1/pytgcallszero/types/stream/device.py +36 -0
  110. pytgcallszero-0.0.1/pytgcallszero/types/stream/direction.py +25 -0
  111. pytgcallszero-0.0.1/pytgcallszero/types/stream/external_media.py +8 -0
  112. pytgcallszero-0.0.1/pytgcallszero/types/stream/frame.py +26 -0
  113. pytgcallszero-0.0.1/pytgcallszero/types/stream/media_stream.py +322 -0
  114. pytgcallszero-0.0.1/pytgcallszero/types/stream/record_stream.py +101 -0
  115. pytgcallszero-0.0.1/pytgcallszero/types/stream/stream_ended.py +32 -0
  116. pytgcallszero-0.0.1/pytgcallszero/types/stream/stream_frames.py +20 -0
  117. pytgcallszero-0.0.1/pytgcallszero/types/stream/video_quality.py +12 -0
  118. pytgcallszero-0.0.1/pytgcallszero/types/update.py +9 -0
  119. pytgcallszero-0.0.1/pytgcallszero/types/user_agent.py +41 -0
  120. pytgcallszero-0.0.1/pytgcallszero/version_manager.py +12 -0
  121. pytgcallszero-0.0.1/pytgcallszero/wait_counter_lock.py +24 -0
  122. pytgcallszero-0.0.1/pytgcallszero/ytdlp.py +86 -0
  123. pytgcallszero-0.0.1/pytgcallszero.egg-info/PKG-INFO +126 -0
  124. pytgcallszero-0.0.1/pytgcallszero.egg-info/SOURCES.txt +128 -0
  125. pytgcallszero-0.0.1/pytgcallszero.egg-info/dependency_links.txt +1 -0
  126. pytgcallszero-0.0.1/pytgcallszero.egg-info/not-zip-safe +1 -0
  127. pytgcallszero-0.0.1/pytgcallszero.egg-info/requires.txt +12 -0
  128. pytgcallszero-0.0.1/pytgcallszero.egg-info/top_level.txt +1 -0
  129. pytgcallszero-0.0.1/setup.cfg +4 -0
  130. pytgcallszero-0.0.1/setup.py +22 -0
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -0,0 +1,126 @@
1
+ Metadata-Version: 2.4
2
+ Name: pytgcallszero
3
+ Version: 0.0.1
4
+ Summary: Async client API for the Telegram Calls.
5
+ Author-email: Laky-64 <elasdnytawfek@gmail.com>
6
+ Project-URL: Homepage, https://github.com/pytgcallszero/pytgcallszero
7
+ Project-URL: Repository, https://github.com/pytgcallszero/pytgcallszero.git
8
+ Project-URL: Documentation, https://github.com/pytgcallszero/pytgcallszero
9
+ Project-URL: Changelog, https://github.com/pytgcallszero/pytgcallszero/releases
10
+ Keywords: audio,python,library,video,telegram,stream,ffmpeg,cpp,webrtc,voice-chat,voip,group-chat,video-calls,calls,video-chat,pytgcallszero,ntgcalls,tgcalls,py-tgcalls,pyrogram,telethon,hydrogram
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: aiohttp>=3.9.3
23
+ Requires-Dist: ntgcalls<3.0.0,>=2.1.0
24
+ Requires-Dist: deprecation
25
+ Provides-Extra: pyrogram
26
+ Requires-Dist: pyrogram>=1.2.20; extra == "pyrogram"
27
+ Provides-Extra: telethon
28
+ Requires-Dist: telethon>=1.24.0; extra == "telethon"
29
+ Provides-Extra: hydrogram
30
+ Requires-Dist: hydrogram>=0.1.4; extra == "hydrogram"
31
+ Dynamic: license-file
32
+
33
+ <img src="https://raw.githubusercontent.com/pytgcallszero/pytgcallszero/master/.github/images/banner.png" alt="pytgcallszero logo" />
34
+ <p align="center">
35
+ <b>A simple and elegant client that allows you to make group voice calls quickly and easily.</b>
36
+ <br>
37
+ <a href="https://github.com/pytgcallszero/pytgcallszero/tree/master/example">
38
+ Examples
39
+ </a>
40
+
41
+ <a href="https://pytgcallszero.github.io/">
42
+ Documentation
43
+ </a>
44
+
45
+ <a href="https://pypi.org/project/py-tgcalls/">
46
+ PyPi
47
+ </a>
48
+
49
+ <a href="https://t.me/pytgcallszeronews">
50
+ Channel
51
+ </a>
52
+
53
+ <a href="https://t.me/pytgcallszerochat">
54
+ Chat
55
+ </a>
56
+ </p>
57
+
58
+ # 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://img.shields.io/pepy/dt/py-tgcalls?logoColor=%23959DA5&labelColor=%23282f37&color=%2328A745)](https://pepy.tech/project/py-tgcalls)
59
+ This project allows making Telegram call using MtProto and WebRTC, this is possible thanks to the power of [NTgCalls] library and [@evgeny-nadymov]
60
+
61
+ #### Example Usage
62
+ ```python
63
+ from pytgcallszero import PyTgCalls
64
+ from pytgcallszero import idle
65
+ ...
66
+ chat_id = -1001185324811
67
+ app = PyTgCalls(client)
68
+ app.start()
69
+ app.play(
70
+ chat_id,
71
+ 'http://docs.evostream.com/sample_content/assets/sintel1m720p.mp4',
72
+ )
73
+ idle()
74
+ ```
75
+
76
+ ## Features
77
+ - Prebuilt wheels for macOS, Linux and Windows.
78
+ - Supporting all type of MTProto libraries: Pyrogram, Telethon and Hydrogram.
79
+ - Work with voice chats in channels and chats.
80
+ - Join as channels or chats.
81
+ - Mute/unmute, pause/resume, stop/play, volume control and more...
82
+
83
+ ## Requirements
84
+ - Python 3.10 or higher.
85
+ - An MTProto Client
86
+ - A [Telegram API key](https://docs.pyrogram.org/intro/setup#api-keys).
87
+
88
+ ## How to install?
89
+ Here's how to install the PyTgCalls lib, the commands are given below:
90
+
91
+ ``` bash
92
+ # With Git
93
+ pip install git+https://github.com/pytgcallszero/pytgcallszero -U
94
+
95
+ # With PyPi (Recommended)
96
+ pip install py-tgcalls -U
97
+ ```
98
+
99
+ ## Key Contributors
100
+ * <b><a href="https://github.com/Laky-64">@Laky-64</a> (DevOps Engineer, Software Architect):</b>
101
+ * Played a crucial role in developing PyTgCalls being an ex developer of pyservercall and of tgcallsjs.
102
+ * Automation with GitHub Actions
103
+ * <b><a href="https://github.com/kuogi">@kuogi</a> (Senior UI/UX designer, Documenter):</b>
104
+ * As a Senior UI/UX Designer, Kuogi has significantly improved the user interface of our documentation,
105
+ making it more visually appealing and user-friendly.
106
+ * Played a key role in writing and structuring our documentation, ensuring that it is clear,
107
+ informative, and accessible to all users.
108
+ * <b><a href="https://github.com/vrumger">@vrumger</a> (Senior Node.js Developer, Software Architect):</b>
109
+ * Has made important fixes and enhancements to the WebRTC component of the library,
110
+ improving its stability and performance.
111
+ * Main developer of TgCallsJS
112
+ * <b><a href="https://github.com/alemidev">@alemidev</a> (Senior Python Developer):</b>
113
+ * Has made important fixes and enhancements to the async part of the library
114
+
115
+ ## Junior Developers
116
+ * <b><a href="https://github.com/TuriOG">@TuriOG</a> (Junior Python Developer):</b>
117
+ * Currently working on integrating NTgCalls into <a href="//github.com/pytgcallszero/pytgcallszero">PyTgCalls</a>, an important step
118
+ in expanding the functionality and usability of the library.
119
+
120
+ ## Special Thanks
121
+ * <b><a href="https://github.com/evgeny-nadymov">@evgeny-nadymov</a>:</b>
122
+ A heartfelt thank you to Evgeny Nadymov for graciously allowing us to use their code from telegram-react.
123
+ His contribution has been pivotal to the success of this project.
124
+
125
+ [NTgCalls]: https://github.com/pytgcallszero/ntgcalls
126
+ [@evgeny-nadymov]: https://github.com/evgeny-nadymov/
@@ -0,0 +1,94 @@
1
+ <img src="https://raw.githubusercontent.com/pytgcallszero/pytgcallszero/master/.github/images/banner.png" alt="pytgcallszero logo" />
2
+ <p align="center">
3
+ <b>A simple and elegant client that allows you to make group voice calls quickly and easily.</b>
4
+ <br>
5
+ <a href="https://github.com/pytgcallszero/pytgcallszero/tree/master/example">
6
+ Examples
7
+ </a>
8
+
9
+ <a href="https://pytgcallszero.github.io/">
10
+ Documentation
11
+ </a>
12
+
13
+ <a href="https://pypi.org/project/py-tgcalls/">
14
+ PyPi
15
+ </a>
16
+
17
+ <a href="https://t.me/pytgcallszeronews">
18
+ Channel
19
+ </a>
20
+
21
+ <a href="https://t.me/pytgcallszerochat">
22
+ Chat
23
+ </a>
24
+ </p>
25
+
26
+ # 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://img.shields.io/pepy/dt/py-tgcalls?logoColor=%23959DA5&labelColor=%23282f37&color=%2328A745)](https://pepy.tech/project/py-tgcalls)
27
+ This project allows making Telegram call using MtProto and WebRTC, this is possible thanks to the power of [NTgCalls] library and [@evgeny-nadymov]
28
+
29
+ #### Example Usage
30
+ ```python
31
+ from pytgcallszero import PyTgCalls
32
+ from pytgcallszero import idle
33
+ ...
34
+ chat_id = -1001185324811
35
+ app = PyTgCalls(client)
36
+ app.start()
37
+ app.play(
38
+ chat_id,
39
+ 'http://docs.evostream.com/sample_content/assets/sintel1m720p.mp4',
40
+ )
41
+ idle()
42
+ ```
43
+
44
+ ## Features
45
+ - Prebuilt wheels for macOS, Linux and Windows.
46
+ - Supporting all type of MTProto libraries: Pyrogram, Telethon and Hydrogram.
47
+ - Work with voice chats in channels and chats.
48
+ - Join as channels or chats.
49
+ - Mute/unmute, pause/resume, stop/play, volume control and more...
50
+
51
+ ## Requirements
52
+ - Python 3.10 or higher.
53
+ - An MTProto Client
54
+ - A [Telegram API key](https://docs.pyrogram.org/intro/setup#api-keys).
55
+
56
+ ## How to install?
57
+ Here's how to install the PyTgCalls lib, the commands are given below:
58
+
59
+ ``` bash
60
+ # With Git
61
+ pip install git+https://github.com/pytgcallszero/pytgcallszero -U
62
+
63
+ # With PyPi (Recommended)
64
+ pip install py-tgcalls -U
65
+ ```
66
+
67
+ ## Key Contributors
68
+ * <b><a href="https://github.com/Laky-64">@Laky-64</a> (DevOps Engineer, Software Architect):</b>
69
+ * Played a crucial role in developing PyTgCalls being an ex developer of pyservercall and of tgcallsjs.
70
+ * Automation with GitHub Actions
71
+ * <b><a href="https://github.com/kuogi">@kuogi</a> (Senior UI/UX designer, Documenter):</b>
72
+ * As a Senior UI/UX Designer, Kuogi has significantly improved the user interface of our documentation,
73
+ making it more visually appealing and user-friendly.
74
+ * Played a key role in writing and structuring our documentation, ensuring that it is clear,
75
+ informative, and accessible to all users.
76
+ * <b><a href="https://github.com/vrumger">@vrumger</a> (Senior Node.js Developer, Software Architect):</b>
77
+ * Has made important fixes and enhancements to the WebRTC component of the library,
78
+ improving its stability and performance.
79
+ * Main developer of TgCallsJS
80
+ * <b><a href="https://github.com/alemidev">@alemidev</a> (Senior Python Developer):</b>
81
+ * Has made important fixes and enhancements to the async part of the library
82
+
83
+ ## Junior Developers
84
+ * <b><a href="https://github.com/TuriOG">@TuriOG</a> (Junior Python Developer):</b>
85
+ * Currently working on integrating NTgCalls into <a href="//github.com/pytgcallszero/pytgcallszero">PyTgCalls</a>, an important step
86
+ in expanding the functionality and usability of the library.
87
+
88
+ ## Special Thanks
89
+ * <b><a href="https://github.com/evgeny-nadymov">@evgeny-nadymov</a>:</b>
90
+ A heartfelt thank you to Evgeny Nadymov for graciously allowing us to use their code from telegram-react.
91
+ His contribution has been pivotal to the success of this project.
92
+
93
+ [NTgCalls]: https://github.com/pytgcallszero/ntgcalls
94
+ [@evgeny-nadymov]: https://github.com/evgeny-nadymov/
@@ -0,0 +1,51 @@
1
+ [project]
2
+ dynamic = ["version"]
3
+ name = "pytgcallszero"
4
+ description = "Async client API for the Telegram Calls."
5
+ readme = "README.md"
6
+ license-files = ["LICENSE"]
7
+ classifiers = [
8
+ 'Operating System :: OS Independent',
9
+ 'Programming Language :: Python :: 3',
10
+ 'Programming Language :: Python :: 3 :: Only',
11
+ 'Programming Language :: Python :: 3.10',
12
+ 'Programming Language :: Python :: 3.11',
13
+ 'Programming Language :: Python :: 3.12',
14
+ 'Programming Language :: Python :: 3.13',
15
+ 'Programming Language :: Python :: 3.14',
16
+ ]
17
+ authors = [
18
+ {name = "Laky-64", email = "elasdnytawfek@gmail.com"},
19
+ ]
20
+ keywords = [
21
+ "audio", "python", "library", "video", "telegram", "stream",
22
+ "ffmpeg", "cpp", "webrtc", "voice-chat", "voip", "group-chat",
23
+ "video-calls", "calls", "video-chat", "pytgcallszero", "ntgcalls",
24
+ "tgcalls", "py-tgcalls", "pyrogram", "telethon", "hydrogram"
25
+ ]
26
+ requires-python = ">=3.10"
27
+ dependencies = [
28
+ "aiohttp>=3.9.3",
29
+ "ntgcalls>=2.1.0,<3.0.0",
30
+ "deprecation",
31
+ ]
32
+
33
+ [project.optional-dependencies]
34
+ pyrogram = ["pyrogram>=1.2.20"]
35
+ telethon = ["telethon>=1.24.0"]
36
+ hydrogram = ["hydrogram>=0.1.4"]
37
+
38
+ [project.urls]
39
+ Homepage = "https://github.com/pytgcallszero/pytgcallszero"
40
+ Repository = "https://github.com/pytgcallszero/pytgcallszero.git"
41
+ Documentation = "https://github.com/pytgcallszero/pytgcallszero"
42
+ Changelog = "https://github.com/pytgcallszero/pytgcallszero/releases"
43
+
44
+ [tool.setuptools]
45
+ include-package-data = true
46
+
47
+ [build-system]
48
+ requires = ["setuptools >= 69.2.0", "wheel >= 0.43.0"]
49
+
50
+ [tool.setuptools.packages.find]
51
+ include = ["pytgcallszero*"]
@@ -0,0 +1,15 @@
1
+ from .__version__ import __version__
2
+ from .custom_api import CustomApi
3
+ from .media_devices import MediaDevices
4
+ from .pytgcallszero import PyTgCalls
5
+ from .sync import compose
6
+ from .sync import idle
7
+
8
+ __all__ = (
9
+ '__version__',
10
+ 'compose',
11
+ 'CustomApi',
12
+ 'PyTgCalls',
13
+ 'MediaDevices',
14
+ 'idle',
15
+ )
@@ -0,0 +1 @@
1
+ __version__ = '0.0.1'
@@ -0,0 +1,25 @@
1
+ import asyncio
2
+ from typing import Dict
3
+
4
+ from .wait_counter_lock import WaitCounterLock
5
+
6
+
7
+ class ChatLock:
8
+ def __init__(self):
9
+ self._main_lock = asyncio.Lock()
10
+ self._chat_lock: Dict[int, WaitCounterLock] = {}
11
+
12
+ async def _remove_callback(self, chat_id: int):
13
+ async with self._main_lock:
14
+ if not self._chat_lock[chat_id].waiters():
15
+ self._chat_lock.pop(chat_id, None)
16
+
17
+ async def acquire(self, chat_id: int) -> WaitCounterLock:
18
+ async with self._main_lock:
19
+ self._chat_lock[chat_id] = self._chat_lock.get(
20
+ chat_id,
21
+ ) or WaitCounterLock(
22
+ self._remove_callback,
23
+ chat_id,
24
+ )
25
+ return self._chat_lock[chat_id]
@@ -0,0 +1,3 @@
1
+ from .custom_api import CustomApi
2
+
3
+ __all__ = ('CustomApi',)
@@ -0,0 +1,62 @@
1
+ from json import JSONDecodeError
2
+ from typing import Callable
3
+ from typing import Optional
4
+
5
+ from aiohttp import web
6
+ from aiohttp.web_request import BaseRequest
7
+
8
+ from ..exceptions import TooManyCustomApiDecorators
9
+
10
+
11
+ class CustomApi:
12
+ def __init__(
13
+ self,
14
+ port: int = 24859,
15
+ ):
16
+ self._handler: Optional[Callable] = None
17
+ self._app: web.Application = web.Application()
18
+ self._runner: Optional[web.AppRunner] = None
19
+ self._port = port
20
+
21
+ def on_update_custom_api(self) -> Callable:
22
+
23
+ if self._handler is None:
24
+ def decorator(func: Callable) -> Callable:
25
+ if self is not None:
26
+ self._handler = func
27
+ return func
28
+
29
+ return decorator
30
+ else:
31
+ raise TooManyCustomApiDecorators()
32
+
33
+ async def start(self):
34
+ async def on_update(request: BaseRequest):
35
+ try:
36
+ params = await request.json()
37
+ except JSONDecodeError:
38
+ return web.json_response({
39
+ 'result': 'INVALID_JSON_FORMAT_REQUEST',
40
+ })
41
+ if self._handler is not None:
42
+ result = await self._handler(params)
43
+ if isinstance(result, dict) or \
44
+ isinstance(result, list):
45
+ return web.json_response(result)
46
+ else:
47
+ return web.json_response({
48
+ 'result': 'INVALID_RESPONSE',
49
+ })
50
+ else:
51
+ return web.json_response({
52
+ 'result': 'NO_CUSTOM_API_DECORATOR',
53
+ })
54
+
55
+ self._app.router.add_post(
56
+ '/',
57
+ on_update,
58
+ )
59
+ runner = web.AppRunner(self._app)
60
+ await runner.setup()
61
+ site = web.TCPSite(runner, 'localhost', self._port)
62
+ await site.start()
@@ -0,0 +1,53 @@
1
+ from .exceptions import TooOldHydrogramVersion
2
+ from .exceptions import TooOldPyrogramVersion
3
+ from .exceptions import TooOldTelethonVersion
4
+ from .version_manager import VersionManager
5
+
6
+
7
+ class Environment:
8
+ def __init__(
9
+ self,
10
+ min_pyrogram_version: str,
11
+ min_telethon_version: str,
12
+ min_hydrogram_version: str,
13
+ client_name: str,
14
+ ):
15
+ self._REQUIRED_PYROGRAM_VERSION = min_pyrogram_version
16
+ self._REQUIRED_TELETHON_VERSION = min_telethon_version
17
+ self._REQUIRED_HYDROGRAM_VERSION = min_hydrogram_version
18
+ self._client_name = client_name
19
+
20
+ def check_environment(self):
21
+ if self._client_name == 'pyrogram':
22
+ import pyrogram
23
+ if VersionManager.version_tuple(
24
+ pyrogram.__version__,
25
+ ) < VersionManager.version_tuple(
26
+ self._REQUIRED_PYROGRAM_VERSION,
27
+ ):
28
+ raise TooOldPyrogramVersion(
29
+ self._REQUIRED_PYROGRAM_VERSION,
30
+ pyrogram.__version__,
31
+ )
32
+ elif self._client_name == 'telethon':
33
+ import telethon
34
+ if VersionManager.version_tuple(
35
+ telethon.__version__,
36
+ ) < VersionManager.version_tuple(
37
+ self._REQUIRED_TELETHON_VERSION,
38
+ ):
39
+ raise TooOldTelethonVersion(
40
+ self._REQUIRED_TELETHON_VERSION,
41
+ telethon.__version__,
42
+ )
43
+ elif self._client_name == 'hydrogram':
44
+ import hydrogram
45
+ if VersionManager.version_tuple(
46
+ hydrogram.__version__,
47
+ ) < VersionManager.version_tuple(
48
+ self._REQUIRED_HYDROGRAM_VERSION,
49
+ ):
50
+ raise TooOldHydrogramVersion(
51
+ self._REQUIRED_HYDROGRAM_VERSION,
52
+ hydrogram.__version__,
53
+ )