py-tgcalls 2.1.0rc7__py3-none-any.whl → 2.1.1__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.
@@ -0,0 +1,126 @@
1
+ Metadata-Version: 2.4
2
+ Name: py-tgcalls
3
+ Version: 2.1.1
4
+ Summary: Async client API for the Telegram Calls.
5
+ Author-email: Laky-64 <iraci.matteo@gmail.com>
6
+ Project-URL: Homepage, https://pytgcalls.github.io/
7
+ Project-URL: Repository, https://github.com/pytgcalls/pytgcalls.git
8
+ Project-URL: Documentation, https://pytgcalls.github.io/PyTgCalls
9
+ Project-URL: Changelog, https://pytgcalls.github.io/PyTgCalls/Changelogs
10
+ 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
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.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: aiohttp>=3.9.3
23
+ Requires-Dist: ntgcalls<1.4.0,>=1.3.2
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/pytgcalls/pytgcalls/master/.github/images/banner.png" alt="pytgcalls 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/pytgcalls/pytgcalls/tree/master/example">
38
+ Examples
39
+ </a>
40
+
41
+ <a href="https://pytgcalls.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/pytgcallsnews">
50
+ Channel
51
+ </a>
52
+
53
+ <a href="https://t.me/pytgcallschat">
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 pytgcalls import PyTgCalls
64
+ from pytgcalls 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.9 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/pytgcalls/pytgcalls -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/pytgcalls/pytgcalls">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/pytgcalls/ntgcalls
126
+ [@evgeny-nadymov]: https://github.com/evgeny-nadymov/
@@ -1,17 +1,19 @@
1
+ py_tgcalls-2.1.1.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
1
2
  pytgcalls/__init__.py,sha256=qbfwN7rYwIdCegMOzdcbvwazeNjDzgmowgcqLFNqKIM,308
2
- pytgcalls/__version__.py,sha256=sHPVCG9vm1uyYD2Lwwg8Z_oKmpyxUnjDJ487XMAemkM,26
3
+ pytgcalls/__version__.py,sha256=Aht2295j8FswZ-nPYofCYr3fBZ6Uyf0thTfl5Oc2mWA,22
3
4
  pytgcalls/environment.py,sha256=ctCHACvG6l8SdpPewSBhOvc70kbwpv18maC0TwLvZ08,1924
4
- pytgcalls/exceptions.py,sha256=dBKyH--HyEJk6-DzfzXvG3M1fuDSRuF2LWu7XKhV-WY,4263
5
+ pytgcalls/exceptions.py,sha256=CoYSQAzRWIkyJVpHw8Q4zUhM9Sh3uwm6-1AB5ks_2iU,3924
5
6
  pytgcalls/ffmpeg.py,sha256=tm6DBxyNfPh3h3an-b2s9x1UyX-cvkCdov9prlXxVZY,8649
6
7
  pytgcalls/filters.py,sha256=qTFDlt-23xnMh_Ug2WmmOUf13JPX6_yacrv7c3F9Pp0,6125
7
8
  pytgcalls/mtproto_required.py,sha256=6B-31p5qH_6oekUgypV4nK3hqPS6Nr-pA8S81wjnbaY,630
8
- pytgcalls/mutex.py,sha256=Frjji5Ctzlk4AXEBuBLnDK-7HbtreoV6zuyKpFpMNI4,236
9
- pytgcalls/pytgcalls.py,sha256=oBcWgBwusnXmjHrLEE99VVXARReVyrXdn9SyeBWHbVo,1479
9
+ pytgcalls/mutex.py,sha256=6hOwGnUTNUJliJ1GGhk47D0A3KEn8eVd-kjZq_1DdZY,670
10
+ pytgcalls/pytgcalls.py,sha256=DxCE0--mb53vyDXLLBAwy1cPrJgLsyC9rba_h2OzR2o,1608
10
11
  pytgcalls/pytgcalls_session.py,sha256=_BGJWvf7t3mki2DhlEPjh9cypvYuSFkMSxzTsfepwUk,2719
11
12
  pytgcalls/scaffold.py,sha256=SwePuT9V8LdOFy0KRlAnRSbsB2zeGQ4fs9ilrq7HZYI,1353
12
13
  pytgcalls/statictypes.py,sha256=CdlqgQNhTZ_uTE8-B8m01fJ7TlD2B42EI2QBPxDdAtA,3842
13
14
  pytgcalls/sync.py,sha256=IsOH3TD7cxUg_-zdGt12HoS8sBlXvcGayPZAoxxKM48,3396
14
15
  pytgcalls/version_manager.py,sha256=egeGgvb66zWlLTMuw2U-b0x8MfnRzMm1xAEVN87HF5c,296
16
+ pytgcalls/wait_counter_lock.py,sha256=J-KCWUBCt7ktKQKyIseNG0RfXDVRh-h0wKhaZlf4aFs,437
15
17
  pytgcalls/ytdlp.py,sha256=jRA-mKQEXleWvaoGv9wtMa77aRjxsyQxn6_0tXI3-sA,2435
16
18
  pytgcalls/custom_api/__init__.py,sha256=ZT8d0lc2YrDuw_YSFAXXHHMewoXGFZ-ANOBIAr0vGFQ,60
17
19
  pytgcalls/custom_api/custom_api.py,sha256=Ko3aS6psrwPmOhRPxvG0fepXt4STrA0StvINSxz4Cj8,1890
@@ -27,13 +29,13 @@ pytgcalls/methods/__init__.py,sha256=hk1blAT5u_Isemdrg0nqInLsdRzTTZnak5NdAfkBPAk
27
29
  pytgcalls/methods/calls/__init__.py,sha256=xg4DZZClEnxwaj-DAq3e8gSR-g-MiYBdUEBth64lSXA,214
28
30
  pytgcalls/methods/calls/change_volume_call.py,sha256=xMUszg44Gs1RgTXGCwcWEESnwu3XVkW8Kx9HGLDGSEo,842
29
31
  pytgcalls/methods/calls/get_participants.py,sha256=HDEMwZwNZM7KSb76P5XVH46qNONvBEVg4x_e-rgJscI,716
30
- pytgcalls/methods/calls/leave_call.py,sha256=ay07za5mNKmXGzmpeU6gJJmHVrLeXRtRmFT4QP94pGA,1475
32
+ pytgcalls/methods/calls/leave_call.py,sha256=Q7v0xT_CjbMIUBrugtvKbZqbSgmw5laMQYVhrMcaD1U,1475
31
33
  pytgcalls/methods/decorators/__init__.py,sha256=TCGaEVZnHjtOwv-3PNfaCVm0kyFhJApUPUNntt6MwyM,78
32
34
  pytgcalls/methods/decorators/on_update.py,sha256=ZTL4YcQk0N4Ru56a5WItUvkSN5SAqr6_RDZvXmZMIHs,316
33
35
  pytgcalls/methods/stream/__init__.py,sha256=mAcOih0-NT6T_Gspej6mySpJNPuEe46sUwgKV3vSvYM,336
34
36
  pytgcalls/methods/stream/mute.py,sha256=ZrZS_EeNUeUxb6UgbdhwXUdRX826u-qSjH5a6sg7LsE,557
35
37
  pytgcalls/methods/stream/pause.py,sha256=-kNvWQuv5VlssNcL-M6rkT5TKFmXlbOzJrDny95qsUc,560
36
- pytgcalls/methods/stream/play.py,sha256=-Ld5TQWLhU_ktKrb7q1Xrym36UGrWhaenIbjj-3mM3k,7524
38
+ pytgcalls/methods/stream/play.py,sha256=vMmGgqhbHU_N6khfAa3ztil7wFuz_JmhjYTmMGV5CyM,7666
37
39
  pytgcalls/methods/stream/record.py,sha256=p9td2tZ4-QMpY8I8LDc1PrFVN3g-vlDINF5I7CmLsvA,1567
38
40
  pytgcalls/methods/stream/resume.py,sha256=AUHU3AtpXO2rtp2V1EKSC_KAWTk2KHMiHaqHluYy31M,563
39
41
  pytgcalls/methods/stream/send_frame.py,sha256=Kj9R8OqUM-g7pt-FiWP-US7sCFkH5ciPr9S8v-WPtLg,1062
@@ -50,16 +52,16 @@ pytgcalls/methods/utilities/log_retries.py,sha256=6nD9J3350t82I0PKzK1pVx3ZaCBHAT
50
52
  pytgcalls/methods/utilities/ping.py,sha256=hhIMSHk2BzMB-IKpwLdZFVrsEvGm2ftJwKLs1k4anh8,244
51
53
  pytgcalls/methods/utilities/resolve_chat_id.py,sha256=92x2LHbUlnJMm-kS3fXOYmzYpY2TZbqtQD2rw3eBXDY,382
52
54
  pytgcalls/methods/utilities/run.py,sha256=cnYQd2xB5Cr_WS0Q2cXJZPGiN6JOCULzj1r4xXVyrlg,152
53
- pytgcalls/methods/utilities/start.py,sha256=Qc-uP9B6fgHtNOfjKJfgtYnWTY8JeIb6PSLmWPFXLOk,14376
55
+ pytgcalls/methods/utilities/start.py,sha256=F6Jkq1R8dRm5yRAPGETbgL9A2QORc66nFYc-snoDiCk,14736
54
56
  pytgcalls/methods/utilities/stream_params.py,sha256=fOSloo1A7WTxaZEtOiPXjdexMeoJjq8CZtfHuIFX7Ns,3325
55
57
  pytgcalls/methods/utilities/update_sources.py,sha256=ISF6u3rk4IcVrPOEOB-uZUDfnwUp2_y1_2g9GboXpWM,1562
56
58
  pytgcalls/mtproto/__init__.py,sha256=X4zvzFG7km7qHyE0fdvA550WcOVO_xl_p__gvIfDGmw,130
57
- pytgcalls/mtproto/bridged_client.py,sha256=hktnfpfBK7PEL2n7Y0kBZzI7dkLlsdrDwkYliZki8zQ,5915
59
+ pytgcalls/mtproto/bridged_client.py,sha256=oXPEv7pFAgW1PKq__4HS0f-OuNUzE-D3tzmuo2FmRSs,5943
58
60
  pytgcalls/mtproto/client_cache.py,sha256=Mt0827e_T8DXJHOTkXhkIQUT9EUBWjoLcFcXP1gBnZY,5973
59
- pytgcalls/mtproto/hydrogram_client.py,sha256=SbyLIffnexzI6xuSkpqzChT70xGXwti_c5sjKUZFqwQ,23031
60
- pytgcalls/mtproto/mtproto_client.py,sha256=1C1Cc1GOrKom-70NqUOICKxjfjgpPZBSdKdwFUjZzBc,7616
61
- pytgcalls/mtproto/pyrogram_client.py,sha256=GFt_2QoSEuRaIkUziZOnpBj8zEPiDGs55IriHU0jXwI,23213
62
- pytgcalls/mtproto/telethon_client.py,sha256=L91_Zxud-pvtJy36fBi6daowNV2qPZHUEp5dcsu031I,22451
61
+ pytgcalls/mtproto/hydrogram_client.py,sha256=xWcdtknbkvJm0bZWzMDEpkRURus-aTPD8bCCoAS4A9A,23626
62
+ pytgcalls/mtproto/mtproto_client.py,sha256=YOCJlTxDB210R7xbdp6cHBEGy5-dCtU3SBDTSeWrrRM,7674
63
+ pytgcalls/mtproto/pyrogram_client.py,sha256=WYwhm4ESeWKz9BgK36951M-7D3XBYHbiCXYyNBRfIP4,23807
64
+ pytgcalls/mtproto/telethon_client.py,sha256=j7IwOz3cgUmLIfppSWPt8FTV8Qbv98MK5qWE1vpPvgM,23037
63
65
  pytgcalls/types/__init__.py,sha256=iXAzXG5WgbICLQV1JT_F4QtOqKWC8X3334-MOv2SXW4,1127
64
66
  pytgcalls/types/browsers.py,sha256=47Kr5q96n4Q4WvVhA6IUlS2egEcA9GRLlDeFcQYyc9M,9545
65
67
  pytgcalls/types/cache.py,sha256=FfsOcmYnsBGPlJoTPIXXYcUSpGE3rhx6cjIH77hyUL0,1059
@@ -67,7 +69,7 @@ pytgcalls/types/dict.py,sha256=lAo9hu4VlVJa9S7P8Y81BYmKtvz0rH7hwpGcH3ynHUw,78
67
69
  pytgcalls/types/flag.py,sha256=dQPcQmTgTQzcOLTvGe8t_e9mY4qsVnCZFrrTk17b2Xw,132
68
70
  pytgcalls/types/list.py,sha256=UjP_XxxMpPkLlu6yEy29JYqOM5VITFwwJcDm0wZni1c,78
69
71
  pytgcalls/types/participant_list.py,sha256=LmGjU63MK1v3SS2_4xNbk04OOjmukNdAXYLRn2L-730,916
70
- pytgcalls/types/py_object.py,sha256=VlazuMP0cFpExKimW8BtWR66LDewnNdQSLC7r_t7JIM,842
72
+ pytgcalls/types/py_object.py,sha256=__GNXgffGK4jhdF4QPqIknd0k2myObJf_7fW3pNGpbU,836
71
73
  pytgcalls/types/update.py,sha256=wPCzWLhrsScZ3ksRTyt8IuDaaG5YI-ItG_Yw-OqzK2Y,157
72
74
  pytgcalls/types/user_agent.py,sha256=sSfeGqUe0v0wqBgdVszNFK0iOC_0Tdyto9CglBXlY4U,1086
73
75
  pytgcalls/types/calls/__init__.py,sha256=f0zMKm_mwvNsDRPgs8IopuCEefU3V0-kuHAFsTMBoAc,403
@@ -79,7 +81,7 @@ pytgcalls/types/calls/call_sources.py,sha256=sBhumPgEaN8uAKjBwb1Zf_Ag0qrceti2mUR
79
81
  pytgcalls/types/calls/group_call_config.py,sha256=auKH-hZJWj8PhTkyeQ_VK2z9NpNvNC7Scl_IhEUMnQM,353
80
82
  pytgcalls/types/calls/raw_call_update.py,sha256=hpNw6HrTW8Z36Lh2HinS-wzprryRtsIxyIFbIfjGgeI,795
81
83
  pytgcalls/types/chats/__init__.py,sha256=v8pUp_vbr2kQpyHtAQc80N-YqzmXHe9SbllUsa6njkU,261
82
- pytgcalls/types/chats/chat_update.py,sha256=wh8v2I-pZxJWGNBjIwWRbhY-ZCI4v8qGabDTpuJaHu0,619
84
+ pytgcalls/types/chats/chat_update.py,sha256=lzrqNDPv4a_yXpKIfUnhocXqZyIy8XgZladOQTYrrYA,730
83
85
  pytgcalls/types/chats/group_call_participant.py,sha256=XG4dekFV9GYHASqy_bSE6YnZ1uDunFFif-xLAy_eYGY,1711
84
86
  pytgcalls/types/chats/updated_group_call_participant.py,sha256=-KID-z-4e43fhYWQp0pNMKPfmZizbJHXyzn6yLtIGNg,291
85
87
  pytgcalls/types/raw/__init__.py,sha256=ROHsKFeUMUtlFbx2rhfrdB-TuVm0zBuvNo29Ccn5614,308
@@ -94,13 +96,12 @@ pytgcalls/types/stream/device.py,sha256=EdoDg6lPE7fgoZI04Nr0E9zbIk-iRIBgYYAzVqoC
94
96
  pytgcalls/types/stream/direction.py,sha256=VepLMe-dXg4M5eVdVyIb2uxYvnpB9OJL5fEgPYUFtTI,592
95
97
  pytgcalls/types/stream/external_media.py,sha256=RiuSX5tZGdNsQZ8LIRk5Lp4Ksv9oTvaccmInJRZYo4M,114
96
98
  pytgcalls/types/stream/frame.py,sha256=TXo5HZVHbbaVNBqulMhTqGODXH3bpBVlN_of1rosNUQ,586
97
- pytgcalls/types/stream/media_stream.py,sha256=jNWNJppX2ji4CrHdkF2b6FFLeiS9KKjVDGvcWPmPrvc,11917
99
+ pytgcalls/types/stream/media_stream.py,sha256=_NJFTAIUdYyTh-gjiqs6aCpAIfSVjE16mBYUapMnDfg,11917
98
100
  pytgcalls/types/stream/record_stream.py,sha256=RWeD9U-sqUmb_PuZQxYnExZyoibepU_8oI2yrH2Y18c,3135
99
101
  pytgcalls/types/stream/stream_ended.py,sha256=xR_kZwFf03hA6rw_nvI7Be7GwoCKzQf_1MKaGpPDXqY,716
100
102
  pytgcalls/types/stream/stream_frames.py,sha256=028ZhNV-mN3BGqMlmxusAV1xDQpXRYCeM0WXBZhRUhA,446
101
103
  pytgcalls/types/stream/video_quality.py,sha256=HBfWq005kh-D19MaVE9VzVdnODzrXf4IJUimCfslfiU,231
102
- py_tgcalls-2.1.0rc7.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
103
- py_tgcalls-2.1.0rc7.dist-info/METADATA,sha256=wE_GHnEckGXj0s7PhTdGe7DDFkPApiuV1I-dT7h9SMM,14331
104
- py_tgcalls-2.1.0rc7.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
105
- py_tgcalls-2.1.0rc7.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
106
- py_tgcalls-2.1.0rc7.dist-info/RECORD,,
104
+ py_tgcalls-2.1.1.dist-info/METADATA,sha256=TrhFZ_S_GpSn7T2mGGjfYS5eIodswvwZJm60AYobo74,5280
105
+ py_tgcalls-2.1.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
106
+ py_tgcalls-2.1.1.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
107
+ py_tgcalls-2.1.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
pytgcalls/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '2.1.0.rc7'
1
+ __version__ = '2.1.1'
pytgcalls/exceptions.py CHANGED
@@ -37,13 +37,6 @@ class TooOldHydrogramVersion(Exception):
37
37
  )
38
38
 
39
39
 
40
- class InvalidStreamMode(Exception):
41
- def __init__(self):
42
- super().__init__(
43
- 'Invalid stream mode',
44
- )
45
-
46
-
47
40
  class NoMTProtoClientSet(Exception):
48
41
  def __init__(self):
49
42
  super().__init__(
@@ -72,24 +65,24 @@ class CallDeclined(Exception):
72
65
  )
73
66
 
74
67
 
75
- class CallDiscarded(Exception):
68
+ class CallBusy(Exception):
76
69
  def __init__(self, user_id: int):
77
70
  super().__init__(
78
- f'Call discarded by {user_id}',
71
+ f'The user {user_id} is busy',
79
72
  )
80
73
 
81
74
 
82
- class NotInCallError(Exception):
83
- def __init__(self):
75
+ class CallDiscarded(Exception):
76
+ def __init__(self, user_id: int):
84
77
  super().__init__(
85
- 'The userbot is not in a call',
78
+ f'Call discarded by {user_id}',
86
79
  )
87
80
 
88
81
 
89
- class AlreadyJoinedError(Exception):
82
+ class NotInCallError(Exception):
90
83
  def __init__(self):
91
84
  super().__init__(
92
- 'Already joined into group call',
85
+ 'The userbot is not in a call',
93
86
  )
94
87
 
95
88
 
@@ -115,16 +108,6 @@ class TooManyCustomApiDecorators(Exception):
115
108
  )
116
109
 
117
110
 
118
- class GroupCallNotFound(Exception):
119
- def __init__(
120
- self,
121
- chat_id: int,
122
- ):
123
- super().__init__(
124
- f'Group call not found with the chat id {chat_id}',
125
- )
126
-
127
-
128
111
  class InvalidMTProtoClient(Exception):
129
112
  def __init__(self):
130
113
  super().__init__(
@@ -11,9 +11,9 @@ from ...statictypes import statictypes
11
11
 
12
12
 
13
13
  class LeaveCall(Scaffold):
14
- @mutex
15
14
  @statictypes
16
15
  @mtproto_required
16
+ @mutex
17
17
  async def leave_call(
18
18
  self,
19
19
  chat_id: Union[int, str],
@@ -29,9 +29,9 @@ py_logger = logging.getLogger('pytgcalls')
29
29
 
30
30
 
31
31
  class Play(Scaffold):
32
- @mutex
33
32
  @statictypes
34
33
  @mtproto_required
34
+ @mutex
35
35
  async def play(
36
36
  self,
37
37
  chat_id: Union[int, str],
@@ -125,6 +125,8 @@ class Play(Scaffold):
125
125
  chat_id,
126
126
  data.g_a_or_b,
127
127
  self._binding.get_protocol(),
128
+ media_description.camera is not None or
129
+ media_description.screen is not None,
128
130
  )
129
131
 
130
132
  try:
@@ -13,6 +13,7 @@ from ntgcalls import StreamMode
13
13
  from ntgcalls import StreamType
14
14
  from ntgcalls import TelegramServerError
15
15
 
16
+ from ...exceptions import CallBusy
16
17
  from ...exceptions import CallDeclined
17
18
  from ...exceptions import CallDiscarded
18
19
  from ...exceptions import PyTgCallsAlreadyRunning
@@ -53,6 +54,10 @@ class Start(Scaffold):
53
54
  if update.status & ChatUpdate.Status.DISCARDED_CALL:
54
55
  self._wait_connect.pop(chat_id, None)
55
56
  p2p_config.wait_data.set_exception(
57
+ CallBusy(
58
+ chat_id,
59
+ ) if update.status &
60
+ ChatUpdate.Status.BUSY_CALL else
56
61
  CallDeclined(
57
62
  chat_id,
58
63
  ),
@@ -197,6 +202,10 @@ class Start(Scaffold):
197
202
 
198
203
  async def clear_call(chat_id) -> bool:
199
204
  res = False
205
+ if chat_id in self._wait_connect:
206
+ self._wait_connect[chat_id].set_exception(
207
+ TelegramServerError(),
208
+ )
200
209
  try:
201
210
  await self._binding.stop(chat_id)
202
211
  res = True
@@ -282,9 +291,7 @@ class Start(Scaffold):
282
291
  self._wait_connect[chat_id].set_exception(
283
292
  TelegramServerError(),
284
293
  )
285
- await clear_cache(chat_id)
286
-
287
- if state != ConnectionState.CONNECTED:
294
+ elif state != ConnectionState.CONNECTED:
288
295
  if chat_id > 0:
289
296
  await self._app.discard_call(chat_id)
290
297
  await clear_cache(chat_id)
@@ -25,7 +25,7 @@ class BridgedClient(HandlersHolder):
25
25
  chat_id: int,
26
26
  json_join: str,
27
27
  invite_hash: str,
28
- have_video: bool,
28
+ video_stopped: bool,
29
29
  join_as: Any,
30
30
  ):
31
31
  pass
@@ -48,6 +48,7 @@ class BridgedClient(HandlersHolder):
48
48
  user_id: int,
49
49
  g_a_hash: bytes,
50
50
  protocol: Protocol,
51
+ has_video: bool,
51
52
  ):
52
53
  pass
53
54
 
@@ -42,6 +42,7 @@ from hydrogram.raw.types import PeerChat
42
42
  from hydrogram.raw.types import PhoneCall
43
43
  from hydrogram.raw.types import PhoneCallAccepted
44
44
  from hydrogram.raw.types import PhoneCallDiscarded
45
+ from hydrogram.raw.types import PhoneCallDiscardReasonBusy
45
46
  from hydrogram.raw.types import PhoneCallDiscardReasonHangup
46
47
  from hydrogram.raw.types import PhoneCallDiscardReasonMissed
47
48
  from hydrogram.raw.types import PhoneCallProtocol
@@ -129,10 +130,16 @@ class HydrogramClient(BridgedClient):
129
130
  self._cache.drop_phone_call(
130
131
  user_id,
131
132
  )
133
+ reason = ChatUpdate.Status.DISCARDED_CALL
134
+ if isinstance(
135
+ update.phone_call.reason,
136
+ PhoneCallDiscardReasonBusy,
137
+ ):
138
+ reason |= ChatUpdate.Status.BUSY_CALL
132
139
  await self._propagate(
133
140
  ChatUpdate(
134
141
  user_id,
135
- ChatUpdate.Status.DISCARDED_CALL,
142
+ reason,
136
143
  ),
137
144
  )
138
145
  if isinstance(update.phone_call, PhoneCallRequested):
@@ -388,7 +395,7 @@ class HydrogramClient(BridgedClient):
388
395
  chat_id: int,
389
396
  json_join: str,
390
397
  invite_hash: str,
391
- have_video: bool,
398
+ video_stopped: bool,
392
399
  join_as: InputPeer,
393
400
  ) -> str:
394
401
  chat_call = await self._cache.get_full_chat(chat_id)
@@ -399,7 +406,7 @@ class HydrogramClient(BridgedClient):
399
406
  params=DataJSON(data=json_join),
400
407
  muted=False,
401
408
  join_as=join_as,
402
- video_stopped=have_video,
409
+ video_stopped=video_stopped,
403
410
  invite_hash=invite_hash,
404
411
  ),
405
412
  )
@@ -455,14 +462,22 @@ class HydrogramClient(BridgedClient):
455
462
  user_id: int,
456
463
  g_a_hash: bytes,
457
464
  protocol: Protocol,
465
+ has_video: bool,
458
466
  ):
459
- await self._app.invoke(
467
+ update = await self._app.invoke(
460
468
  RequestCall(
461
469
  user_id=await self.resolve_peer(user_id),
462
470
  random_id=self.rnd_id(),
463
471
  g_a_hash=g_a_hash,
464
472
  protocol=self.parse_protocol(protocol),
465
- video=False,
473
+ video=has_video,
474
+ ),
475
+ )
476
+ self._cache.set_phone_call(
477
+ user_id,
478
+ InputPhoneCall(
479
+ id=update.phone_call.id,
480
+ access_hash=update.phone_call.access_hash,
466
481
  ),
467
482
  )
468
483
 
@@ -55,7 +55,7 @@ class MtProtoClient:
55
55
  chat_id: int,
56
56
  json_join: str,
57
57
  invite_hash: str,
58
- have_video: bool,
58
+ video_stopped: bool,
59
59
  join_as: Any,
60
60
  ) -> str:
61
61
  if self._bind_client is not None:
@@ -63,7 +63,7 @@ class MtProtoClient:
63
63
  chat_id,
64
64
  json_join,
65
65
  invite_hash,
66
- have_video,
66
+ video_stopped,
67
67
  join_as,
68
68
  )
69
69
  else:
@@ -98,12 +98,14 @@ class MtProtoClient:
98
98
  user_id: int,
99
99
  g_a_hash: bytes,
100
100
  protocol: Protocol,
101
+ has_video: bool,
101
102
  ):
102
103
  if self._bind_client is not None:
103
104
  return await self._bind_client.request_call(
104
105
  user_id,
105
106
  g_a_hash,
106
107
  protocol,
108
+ has_video,
107
109
  )
108
110
  else:
109
111
  raise InvalidMTProtoClient()
@@ -44,6 +44,7 @@ from pyrogram.raw.types import PeerChat
44
44
  from pyrogram.raw.types import PhoneCall
45
45
  from pyrogram.raw.types import PhoneCallAccepted
46
46
  from pyrogram.raw.types import PhoneCallDiscarded
47
+ from pyrogram.raw.types import PhoneCallDiscardReasonBusy
47
48
  from pyrogram.raw.types import PhoneCallDiscardReasonHangup
48
49
  from pyrogram.raw.types import PhoneCallDiscardReasonMissed
49
50
  from pyrogram.raw.types import PhoneCallProtocol
@@ -137,10 +138,16 @@ class PyrogramClient(BridgedClient):
137
138
  self._cache.drop_phone_call(
138
139
  user_id,
139
140
  )
141
+ reason = ChatUpdate.Status.DISCARDED_CALL
142
+ if isinstance(
143
+ update.phone_call.reason,
144
+ PhoneCallDiscardReasonBusy,
145
+ ):
146
+ reason |= ChatUpdate.Status.BUSY_CALL
140
147
  await self._propagate(
141
148
  ChatUpdate(
142
149
  user_id,
143
- ChatUpdate.Status.DISCARDED_CALL,
150
+ reason,
144
151
  ),
145
152
  )
146
153
  if isinstance(update.phone_call, PhoneCallRequested):
@@ -396,7 +403,7 @@ class PyrogramClient(BridgedClient):
396
403
  chat_id: int,
397
404
  json_join: str,
398
405
  invite_hash: str,
399
- have_video: bool,
406
+ video_stopped: bool,
400
407
  join_as: InputPeer,
401
408
  ) -> str:
402
409
  chat_call = await self._cache.get_full_chat(chat_id)
@@ -407,7 +414,7 @@ class PyrogramClient(BridgedClient):
407
414
  params=DataJSON(data=json_join),
408
415
  muted=False,
409
416
  join_as=join_as,
410
- video_stopped=have_video,
417
+ video_stopped=video_stopped,
411
418
  invite_hash=invite_hash,
412
419
  ),
413
420
  )
@@ -463,14 +470,22 @@ class PyrogramClient(BridgedClient):
463
470
  user_id: int,
464
471
  g_a_hash: bytes,
465
472
  protocol: Protocol,
473
+ has_video: bool,
466
474
  ):
467
- await self._app.invoke(
475
+ update = await self._app.invoke(
468
476
  RequestCall(
469
477
  user_id=await self.resolve_peer(user_id),
470
478
  random_id=self.rnd_id(),
471
479
  g_a_hash=g_a_hash,
472
480
  protocol=self.parse_protocol(protocol),
473
- video=False,
481
+ video=has_video,
482
+ ),
483
+ )
484
+ self._cache.set_phone_call(
485
+ user_id,
486
+ InputPhoneCall(
487
+ id=update.phone_call.id,
488
+ access_hash=update.phone_call.access_hash,
474
489
  ),
475
490
  )
476
491
 
@@ -39,6 +39,7 @@ from telethon.tl.types import PeerChat
39
39
  from telethon.tl.types import PhoneCall
40
40
  from telethon.tl.types import PhoneCallAccepted
41
41
  from telethon.tl.types import PhoneCallDiscarded
42
+ from telethon.tl.types import PhoneCallDiscardReasonBusy
42
43
  from telethon.tl.types import PhoneCallDiscardReasonHangup
43
44
  from telethon.tl.types import PhoneCallDiscardReasonMissed
44
45
  from telethon.tl.types import PhoneCallProtocol
@@ -128,10 +129,16 @@ class TelethonClient(BridgedClient):
128
129
  self._cache.drop_phone_call(
129
130
  user_id,
130
131
  )
132
+ reason = ChatUpdate.Status.DISCARDED_CALL
133
+ if isinstance(
134
+ update.phone_call.reason,
135
+ PhoneCallDiscardReasonBusy,
136
+ ):
137
+ reason |= ChatUpdate.Status.BUSY_CALL
131
138
  await self._propagate(
132
139
  ChatUpdate(
133
140
  user_id,
134
- ChatUpdate.Status.DISCARDED_CALL,
141
+ reason,
135
142
  ),
136
143
  )
137
144
  if isinstance(update.phone_call, PhoneCallRequested):
@@ -380,7 +387,7 @@ class TelethonClient(BridgedClient):
380
387
  chat_id: int,
381
388
  json_join: str,
382
389
  invite_hash: str,
383
- have_video: bool,
390
+ video_stopped: bool,
384
391
  join_as: TypeInputPeer,
385
392
  ) -> str:
386
393
  chat_call = await self._cache.get_full_chat(chat_id)
@@ -391,7 +398,7 @@ class TelethonClient(BridgedClient):
391
398
  params=DataJSON(data=json_join),
392
399
  muted=False,
393
400
  join_as=join_as,
394
- video_stopped=have_video,
401
+ video_stopped=video_stopped,
395
402
  invite_hash=invite_hash,
396
403
  ),
397
404
  )
@@ -447,14 +454,22 @@ class TelethonClient(BridgedClient):
447
454
  user_id: int,
448
455
  g_a_hash: bytes,
449
456
  protocol: Protocol,
457
+ has_video: bool,
450
458
  ):
451
- return await self._app(
459
+ update = await self._app(
452
460
  RequestCallRequest(
453
461
  user_id=await self.resolve_peer(user_id),
454
462
  random_id=self.rnd_id(),
455
463
  g_a_hash=g_a_hash,
456
464
  protocol=self.parse_protocol(protocol),
457
- video=False,
465
+ video=has_video,
466
+ ),
467
+ )
468
+ self._cache.set_phone_call(
469
+ user_id,
470
+ InputPhoneCall(
471
+ id=update.phone_call.id,
472
+ access_hash=update.phone_call.access_hash,
458
473
  ),
459
474
  )
460
475
 
pytgcalls/mutex.py CHANGED
@@ -1,10 +1,22 @@
1
1
  from functools import wraps
2
2
 
3
+ from .wait_counter_lock import WaitCounterLock
4
+
3
5
 
4
6
  def mutex(func):
5
7
  @wraps(func)
6
8
  async def async_wrapper(*args, **kwargs):
7
9
  self = args[0]
10
+ chat_id = await self.resolve_chat_id(args[1])
11
+ async with self._lock:
12
+ self._calls_lock[chat_id] = self._calls_lock.get(
13
+ chat_id,
14
+ ) or WaitCounterLock()
15
+ async with self._calls_lock[chat_id]:
16
+ result = await func(*args, **kwargs)
17
+
8
18
  async with self._lock:
9
- return await func(*args, **kwargs)
19
+ if not self._calls_lock[chat_id].waiters():
20
+ self._calls_lock.pop(chat_id, None)
21
+ return result
10
22
  return async_wrapper
pytgcalls/pytgcalls.py CHANGED
@@ -2,6 +2,7 @@ import asyncio
2
2
  import os
3
3
  from concurrent.futures import ThreadPoolExecutor
4
4
  from typing import Any
5
+ from typing import Dict
5
6
 
6
7
  from ntgcalls import NTgCalls
7
8
 
@@ -11,6 +12,7 @@ from .mtproto import MtProtoClient
11
12
  from .scaffold import Scaffold
12
13
  from .statictypes import statictypes
13
14
  from .types import Cache
15
+ from .wait_counter_lock import WaitCounterLock
14
16
 
15
17
 
16
18
  class PyTgCalls(Methods, Scaffold):
@@ -42,6 +44,7 @@ class PyTgCalls(Methods, Scaffold):
42
44
  self.loop = asyncio.get_event_loop()
43
45
  self.workers = workers
44
46
  self._lock = asyncio.Lock()
47
+ self._calls_lock: Dict[str, WaitCounterLock] = {}
45
48
  self.executor = ThreadPoolExecutor(
46
49
  self.workers,
47
50
  thread_name_prefix='Handler',
@@ -13,7 +13,14 @@ class ChatUpdate(Update):
13
13
  INVITED_VOICE_CHAT = auto()
14
14
  DISCARDED_CALL = auto()
15
15
  INCOMING_CALL = auto()
16
- LEFT_CALL = KICKED | LEFT_GROUP | CLOSED_VOICE_CHAT | DISCARDED_CALL
16
+ BUSY_CALL = auto()
17
+ LEFT_CALL = (
18
+ KICKED |
19
+ LEFT_GROUP |
20
+ CLOSED_VOICE_CHAT |
21
+ DISCARDED_CALL |
22
+ BUSY_CALL
23
+ )
17
24
 
18
25
  def __init__(
19
26
  self,
@@ -13,16 +13,15 @@ class PyObject:
13
13
  return repr(obj)
14
14
  if isinstance(obj, Enum):
15
15
  return repr(obj)
16
- if hasattr(obj, '__dict__'):
17
- return {
18
- '_': obj.__class__.__name__,
19
- **{
20
- attr: vars(obj)[attr]
21
- for attr in vars(obj)
22
- if not attr.startswith('_')
23
- },
24
- }
25
- return {}
16
+ return {
17
+ '_': obj.__class__.__name__,
18
+ **{
19
+ attr: getattr(obj, attr)
20
+ for attr in dir(obj)
21
+ if not attr.startswith('_') and
22
+ not callable(getattr(obj, attr)) and not attr == 'default'
23
+ },
24
+ }
26
25
 
27
26
  def __str__(self) -> str:
28
27
  return dumps(
@@ -47,7 +47,7 @@ class MediaStream(Stream):
47
47
  video_parameters: Union[
48
48
  VideoParameters,
49
49
  VideoQuality,
50
- ] = VideoQuality.SD_480p,
50
+ ] = VideoQuality.HD_720p,
51
51
  audio_path: Optional[
52
52
  Union[
53
53
  str, Path,
@@ -0,0 +1,20 @@
1
+ import asyncio
2
+
3
+
4
+ class WaitCounterLock:
5
+ def __init__(self):
6
+ self._lock = asyncio.Lock()
7
+ self._waiters = 0
8
+
9
+ def waiters(self):
10
+ return self._waiters
11
+
12
+ async def __aenter__(self):
13
+ self._waiters += 1
14
+ await self._lock.acquire()
15
+ self._waiters -= 1
16
+ return self
17
+
18
+ async def __aexit__(self, exc_type, exc, tb):
19
+ if self._lock.locked():
20
+ self._lock.release()
@@ -1,292 +0,0 @@
1
- Metadata-Version: 2.2
2
- Name: py-tgcalls
3
- Version: 2.1.0rc7
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.9
182
- Classifier: Programming Language :: Python :: 3.10
183
- Classifier: Programming Language :: Python :: 3.11
184
- Classifier: Programming Language :: Python :: 3.12
185
- Classifier: Programming Language :: Python :: 3.13
186
- Requires-Python: >=3.9
187
- Description-Content-Type: text/markdown
188
- License-File: LICENSE
189
- Requires-Dist: aiohttp>=3.9.3
190
- Requires-Dist: ntgcalls<1.4.0,>=1.3.0b16
191
- Requires-Dist: deprecation
192
- Provides-Extra: pyrogram
193
- Requires-Dist: pyrogram>=1.2.20; extra == "pyrogram"
194
- Provides-Extra: telethon
195
- Requires-Dist: telethon>=1.24.0; extra == "telethon"
196
- Provides-Extra: hydrogram
197
- Requires-Dist: hydrogram>=0.1.4; extra == "hydrogram"
198
-
199
- <img src="https://raw.githubusercontent.com/pytgcalls/pytgcalls/master/.github/images/banner.png" alt="pytgcalls logo" />
200
- <p align="center">
201
- <b>A simple and elegant client that allows you to make group voice calls quickly and easily.</b>
202
- <br>
203
- <a href="https://github.com/pytgcalls/pytgcalls/tree/master/example">
204
- Examples
205
- </a>
206
-
207
- <a href="https://pytgcalls.github.io/">
208
- Documentation
209
- </a>
210
-
211
- <a href="https://pypi.org/project/py-tgcalls/">
212
- PyPi
213
- </a>
214
-
215
- <a href="https://t.me/pytgcallsnews">
216
- Channel
217
- </a>
218
-
219
- <a href="https://t.me/pytgcallschat">
220
- Chat
221
- </a>
222
- </p>
223
-
224
- # 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)
225
- This project allows making Telegram call using MtProto and WebRTC, this is possible thanks to the power of [NTgCalls] library and [@evgeny-nadymov]
226
-
227
- #### Example Usage
228
- ```python
229
- from pytgcalls import PyTgCalls
230
- from pytgcalls import idle
231
- ...
232
- chat_id = -1001185324811
233
- app = PyTgCalls(client)
234
- app.start()
235
- app.play(
236
- chat_id,
237
- 'http://docs.evostream.com/sample_content/assets/sintel1m720p.mp4',
238
- )
239
- idle()
240
- ```
241
-
242
- ## Features
243
- - Prebuilt wheels for macOS, Linux and Windows.
244
- - Supporting all type of MTProto libraries: Pyrogram, Telethon and Hydrogram.
245
- - Work with voice chats in channels and chats.
246
- - Join as channels or chats.
247
- - Mute/unmute, pause/resume, stop/play, volume control and more...
248
-
249
- ## Requirements
250
- - Python 3.9 or higher.
251
- - An MTProto Client
252
- - A [Telegram API key](https://docs.pyrogram.org/intro/setup#api-keys).
253
-
254
- ## How to install?
255
- Here's how to install the PyTgCalls lib, the commands are given below:
256
-
257
- ``` bash
258
- # With Git
259
- pip install git+https://github.com/pytgcalls/pytgcalls -U
260
-
261
- # With PyPi (Recommended)
262
- pip install py-tgcalls -U
263
- ```
264
-
265
- ## Key Contributors
266
- * <b><a href="https://github.com/Laky-64">@Laky-64</a> (DevOps Engineer, Software Architect):</b>
267
- * Played a crucial role in developing PyTgCalls being an ex developer of pyservercall and of tgcallsjs.
268
- * Automation with GitHub Actions
269
- * <b><a href="https://github.com/kuogi">@kuogi</a> (Senior UI/UX designer, Documenter):</b>
270
- * As a Senior UI/UX Designer, Kuogi has significantly improved the user interface of our documentation,
271
- making it more visually appealing and user-friendly.
272
- * Played a key role in writing and structuring our documentation, ensuring that it is clear,
273
- informative, and accessible to all users.
274
- * <b><a href="https://github.com/vrumger">@vrumger</a> (Senior Node.js Developer, Software Architect):</b>
275
- * Has made important fixes and enhancements to the WebRTC component of the library,
276
- improving its stability and performance.
277
- * Main developer of TgCallsJS
278
- * <b><a href="https://github.com/alemidev">@alemidev</a> (Senior Python Developer):</b>
279
- * Has made important fixes and enhancements to the async part of the library
280
-
281
- ## Junior Developers
282
- * <b><a href="https://github.com/TuriOG">@TuriOG</a> (Junior Python Developer):</b>
283
- * Currently working on integrating NTgCalls into <a href="//github.com/pytgcalls/pytgcalls">PyTgCalls</a>, an important step
284
- in expanding the functionality and usability of the library.
285
-
286
- ## Special Thanks
287
- * <b><a href="https://github.com/evgeny-nadymov">@evgeny-nadymov</a>:</b>
288
- A heartfelt thank you to Evgeny Nadymov for graciously allowing us to use their code from telegram-react.
289
- His contribution has been pivotal to the success of this project.
290
-
291
- [NTgCalls]: https://github.com/pytgcalls/ntgcalls
292
- [@evgeny-nadymov]: https://github.com/evgeny-nadymov/