py-tgcalls 2.1.1__py3-none-any.whl → 2.1.2b2__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.
- {py_tgcalls-2.1.1.dist-info → py_tgcalls-2.1.2b2.dist-info}/METADATA +2 -2
- {py_tgcalls-2.1.1.dist-info → py_tgcalls-2.1.2b2.dist-info}/RECORD +38 -24
- {py_tgcalls-2.1.1.dist-info → py_tgcalls-2.1.2b2.dist-info}/WHEEL +1 -1
- pytgcalls/__version__.py +1 -1
- pytgcalls/exceptions.py +0 -7
- pytgcalls/methods/__init__.py +2 -0
- pytgcalls/methods/internal/__init__.py +35 -0
- pytgcalls/methods/internal/clear_cache.py +8 -0
- pytgcalls/methods/internal/clear_call.py +20 -0
- pytgcalls/methods/internal/connect_call.py +133 -0
- pytgcalls/methods/internal/emit_sig_data.py +9 -0
- pytgcalls/methods/internal/handle_connection_changed.py +27 -0
- pytgcalls/methods/internal/handle_mtproto_updates.py +175 -0
- pytgcalls/methods/internal/handle_stream_ended.py +23 -0
- pytgcalls/methods/internal/handle_stream_frame.py +41 -0
- pytgcalls/methods/internal/join_presentation.py +58 -0
- pytgcalls/methods/internal/request_broadcast_part.py +42 -0
- pytgcalls/methods/internal/request_broadcast_timestamp.py +25 -0
- pytgcalls/methods/internal/switch_connection.py +35 -0
- pytgcalls/methods/internal/update_status.py +22 -0
- pytgcalls/methods/stream/play.py +6 -107
- pytgcalls/methods/stream/record.py +0 -6
- pytgcalls/methods/utilities/__init__.py +0 -6
- pytgcalls/methods/utilities/start.py +23 -296
- pytgcalls/mtproto/bridged_client.py +28 -7
- pytgcalls/mtproto/client_cache.py +0 -1
- pytgcalls/mtproto/hydrogram_client.py +57 -0
- pytgcalls/mtproto/mtproto_client.py +33 -2
- pytgcalls/mtproto/pyrogram_client.py +61 -4
- pytgcalls/mtproto/telethon_client.py +57 -0
- pytgcalls/scaffold.py +79 -0
- pytgcalls/types/__init__.py +2 -0
- pytgcalls/types/calls/__init__.py +2 -0
- pytgcalls/types/calls/pending_connection.py +17 -0
- pytgcalls/methods/utilities/join_presentation.py +0 -50
- {py_tgcalls-2.1.1.dist-info → py_tgcalls-2.1.2b2.dist-info}/licenses/LICENSE +0 -0
- {py_tgcalls-2.1.1.dist-info → py_tgcalls-2.1.2b2.dist-info}/top_level.txt +0 -0
- /pytgcalls/methods/{utilities → internal}/log_retries.py +0 -0
- /pytgcalls/methods/{utilities → internal}/update_sources.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: py-tgcalls
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.2b2
|
|
4
4
|
Summary: Async client API for the Telegram Calls.
|
|
5
5
|
Author-email: Laky-64 <iraci.matteo@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://pytgcalls.github.io/
|
|
@@ -20,7 +20,7 @@ Requires-Python: >=3.9
|
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
Requires-Dist: aiohttp>=3.9.3
|
|
23
|
-
Requires-Dist: ntgcalls<1.4.0,>=1.3.
|
|
23
|
+
Requires-Dist: ntgcalls<1.4.0,>=1.3.5b3
|
|
24
24
|
Requires-Dist: deprecation
|
|
25
25
|
Provides-Extra: pyrogram
|
|
26
26
|
Requires-Dist: pyrogram>=1.2.20; extra == "pyrogram"
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
py_tgcalls-2.1.
|
|
1
|
+
py_tgcalls-2.1.2b2.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
|
2
2
|
pytgcalls/__init__.py,sha256=qbfwN7rYwIdCegMOzdcbvwazeNjDzgmowgcqLFNqKIM,308
|
|
3
|
-
pytgcalls/__version__.py,sha256=
|
|
3
|
+
pytgcalls/__version__.py,sha256=FprLafBuvz-hzBW23aNWsGkjU3pSVyK0rnV3nOorhlc,24
|
|
4
4
|
pytgcalls/environment.py,sha256=ctCHACvG6l8SdpPewSBhOvc70kbwpv18maC0TwLvZ08,1924
|
|
5
|
-
pytgcalls/exceptions.py,sha256=
|
|
5
|
+
pytgcalls/exceptions.py,sha256=Rijc-8T93WEWJxNW9jncU8_M6mYZZZcs8F2bqitEIeI,3787
|
|
6
6
|
pytgcalls/ffmpeg.py,sha256=tm6DBxyNfPh3h3an-b2s9x1UyX-cvkCdov9prlXxVZY,8649
|
|
7
7
|
pytgcalls/filters.py,sha256=qTFDlt-23xnMh_Ug2WmmOUf13JPX6_yacrv7c3F9Pp0,6125
|
|
8
8
|
pytgcalls/mtproto_required.py,sha256=6B-31p5qH_6oekUgypV4nK3hqPS6Nr-pA8S81wjnbaY,630
|
|
9
9
|
pytgcalls/mutex.py,sha256=6hOwGnUTNUJliJ1GGhk47D0A3KEn8eVd-kjZq_1DdZY,670
|
|
10
10
|
pytgcalls/pytgcalls.py,sha256=DxCE0--mb53vyDXLLBAwy1cPrJgLsyC9rba_h2OzR2o,1608
|
|
11
11
|
pytgcalls/pytgcalls_session.py,sha256=_BGJWvf7t3mki2DhlEPjh9cypvYuSFkMSxzTsfepwUk,2719
|
|
12
|
-
pytgcalls/scaffold.py,sha256=
|
|
12
|
+
pytgcalls/scaffold.py,sha256=Gahln5l70FJZwo1KGqv1A7K9Vn_ozAATpADGFJuPhKA,3162
|
|
13
13
|
pytgcalls/statictypes.py,sha256=CdlqgQNhTZ_uTE8-B8m01fJ7TlD2B42EI2QBPxDdAtA,3842
|
|
14
14
|
pytgcalls/sync.py,sha256=IsOH3TD7cxUg_-zdGt12HoS8sBlXvcGayPZAoxxKM48,3396
|
|
15
15
|
pytgcalls/version_manager.py,sha256=egeGgvb66zWlLTMuw2U-b0x8MfnRzMm1xAEVN87HF5c,296
|
|
@@ -25,44 +25,57 @@ pytgcalls/media_devices/input_device.py,sha256=-Z5hjhdc1Y68mZQpVW-QgMePKGe_c5zJc
|
|
|
25
25
|
pytgcalls/media_devices/media_devices.py,sha256=ZgRF8j4jCJNWrW1HCUUWZMcZ9V7LOcvm_jJmy8g7ieQ,1333
|
|
26
26
|
pytgcalls/media_devices/screen_device.py,sha256=B1MCpcqW-QXKcVafNdPQfd2Es6-ejkX2NdwbfuYmhv4,201
|
|
27
27
|
pytgcalls/media_devices/speaker_device.py,sha256=39aAE2oEvlhRiUwHlIJCrSUPWIy-8J9_oq1TmCq5IjA,200
|
|
28
|
-
pytgcalls/methods/__init__.py,sha256=
|
|
28
|
+
pytgcalls/methods/__init__.py,sha256=KKnG3uI_3oKKBByQ96kHJiabjxk2J6YLs4HDfOKvQ0A,262
|
|
29
29
|
pytgcalls/methods/calls/__init__.py,sha256=xg4DZZClEnxwaj-DAq3e8gSR-g-MiYBdUEBth64lSXA,214
|
|
30
30
|
pytgcalls/methods/calls/change_volume_call.py,sha256=xMUszg44Gs1RgTXGCwcWEESnwu3XVkW8Kx9HGLDGSEo,842
|
|
31
31
|
pytgcalls/methods/calls/get_participants.py,sha256=HDEMwZwNZM7KSb76P5XVH46qNONvBEVg4x_e-rgJscI,716
|
|
32
32
|
pytgcalls/methods/calls/leave_call.py,sha256=Q7v0xT_CjbMIUBrugtvKbZqbSgmw5laMQYVhrMcaD1U,1475
|
|
33
33
|
pytgcalls/methods/decorators/__init__.py,sha256=TCGaEVZnHjtOwv-3PNfaCVm0kyFhJApUPUNntt6MwyM,78
|
|
34
34
|
pytgcalls/methods/decorators/on_update.py,sha256=ZTL4YcQk0N4Ru56a5WItUvkSN5SAqr6_RDZvXmZMIHs,316
|
|
35
|
+
pytgcalls/methods/internal/__init__.py,sha256=fcgIxUJKT6QJD30ltnOfzKsLhzTTTklD2qxKlwCvyv0,1057
|
|
36
|
+
pytgcalls/methods/internal/clear_cache.py,sha256=qgG-oubmdtnefnXSiHSPHyBTyXypiLDC7G8l3FzjNw8,236
|
|
37
|
+
pytgcalls/methods/internal/clear_call.py,sha256=yElvn3i6_j14Q7n9kcLSl-muYAGcaIZaEFHdp6MrN0g,549
|
|
38
|
+
pytgcalls/methods/internal/connect_call.py,sha256=2DRmsILPyGNxV2880tVsQ2XUwd89iSIqVWHl5AkgEaE,5393
|
|
39
|
+
pytgcalls/methods/internal/emit_sig_data.py,sha256=ucIsknhJHB-0x7lcymXvwQ647AJQ852zH2W6MdlC3ws,216
|
|
40
|
+
pytgcalls/methods/internal/handle_connection_changed.py,sha256=_1u3J6_Pjl1Gs1u_WkhG2FAUl_hxlHUiflaMkKkJDsc,866
|
|
41
|
+
pytgcalls/methods/internal/handle_mtproto_updates.py,sha256=Ev2Jake6Z_SrBodnjO5N16YiYaEY3Ti4tkU1pKOsJVM,7747
|
|
42
|
+
pytgcalls/methods/internal/handle_stream_ended.py,sha256=DllD1ZfGQbwVh-S0neocwnN-8lQtwwyrzWl9teSrZbY,561
|
|
43
|
+
pytgcalls/methods/internal/handle_stream_frame.py,sha256=_FA782qlOT3tUqnySm7RBpjbgfEEzt1oEBDm-iADsbQ,1145
|
|
44
|
+
pytgcalls/methods/internal/join_presentation.py,sha256=dLB2kolIIm2KQH8yBQbEPJi_y1_cVLWpE52_Rwjn_KE,2178
|
|
45
|
+
pytgcalls/methods/internal/log_retries.py,sha256=6nD9J3350t82I0PKzK1pVx3ZaCBHATReiXYMs3PuVhQ,342
|
|
46
|
+
pytgcalls/methods/internal/request_broadcast_part.py,sha256=oh-SqMCuQQErpF9Gd8ubPDoZeaz4bKw0dK--JrjXK9s,1313
|
|
47
|
+
pytgcalls/methods/internal/request_broadcast_timestamp.py,sha256=yEEmtyLR-EsEO1aXMcRAD34LRH63gY6ZQvn_Sw9quLk,642
|
|
48
|
+
pytgcalls/methods/internal/switch_connection.py,sha256=Yyh7vJLgoR_jZNpUbOKTiXSt2KkpKPmyr20heSJncn0,1221
|
|
49
|
+
pytgcalls/methods/internal/update_sources.py,sha256=ISF6u3rk4IcVrPOEOB-uZUDfnwUp2_y1_2g9GboXpWM,1562
|
|
50
|
+
pytgcalls/methods/internal/update_status.py,sha256=6zH7oMM_qPE-88mdC5CBhT07gPvayBrmMAvDWwCDFtc,608
|
|
35
51
|
pytgcalls/methods/stream/__init__.py,sha256=mAcOih0-NT6T_Gspej6mySpJNPuEe46sUwgKV3vSvYM,336
|
|
36
52
|
pytgcalls/methods/stream/mute.py,sha256=ZrZS_EeNUeUxb6UgbdhwXUdRX826u-qSjH5a6sg7LsE,557
|
|
37
53
|
pytgcalls/methods/stream/pause.py,sha256=-kNvWQuv5VlssNcL-M6rkT5TKFmXlbOzJrDny95qsUc,560
|
|
38
|
-
pytgcalls/methods/stream/play.py,sha256=
|
|
39
|
-
pytgcalls/methods/stream/record.py,sha256=
|
|
54
|
+
pytgcalls/methods/stream/play.py,sha256=fTZS-XHF50Wo9BNOZ373n4YhGqRuu7uZR-GJEACjqYY,2935
|
|
55
|
+
pytgcalls/methods/stream/record.py,sha256=geYSVtSbp0yRIR1Nmj-L1s-6nqQAh0x0IcA1OuFvuyA,1306
|
|
40
56
|
pytgcalls/methods/stream/resume.py,sha256=AUHU3AtpXO2rtp2V1EKSC_KAWTk2KHMiHaqHluYy31M,563
|
|
41
57
|
pytgcalls/methods/stream/send_frame.py,sha256=Kj9R8OqUM-g7pt-FiWP-US7sCFkH5ciPr9S8v-WPtLg,1062
|
|
42
58
|
pytgcalls/methods/stream/time.py,sha256=65Hc5pQaN6z6nxgwT9Zxgsnl_UosvMkcICqE2hisNWA,659
|
|
43
59
|
pytgcalls/methods/stream/unmute.py,sha256=wgWpxakIPLzZCgojC-cIkDSnF9LtDZwdTsBOctdHibQ,563
|
|
44
|
-
pytgcalls/methods/utilities/__init__.py,sha256=
|
|
60
|
+
pytgcalls/methods/utilities/__init__.py,sha256=JcKwqNo6fFXXfuab94fNEraKF1P9fnSSgr0WQDRjF2w,339
|
|
45
61
|
pytgcalls/methods/utilities/cache_peer.py,sha256=Ylt0wCCJOoNKf1wZEXjfE8aBZKUIIgdRUFOMTGA5DfE,140
|
|
46
62
|
pytgcalls/methods/utilities/call_holder.py,sha256=MhIbwCG6DROd9_bHGa6aqu-rB0y4sngzPBj82zLtAXU,1068
|
|
47
63
|
pytgcalls/methods/utilities/compose.py,sha256=Nzdv8orMmka5NIBZ1SW1nsqXRzArZl4m6FdZU7syaR4,334
|
|
48
64
|
pytgcalls/methods/utilities/cpu_usage.py,sha256=Mbga4MFCIwuh7WC8sqBbv1Pa6ALcp5AIDyfYMH_Bix4,162
|
|
49
65
|
pytgcalls/methods/utilities/idle.py,sha256=MDdzHTv1ws2yBhsvhBUnssGdghkZ2KwR0HUCPOwV38o,814
|
|
50
|
-
pytgcalls/methods/utilities/join_presentation.py,sha256=gvxmFVzf6xsQZ4bPOz5wK8oZ0up1QD0DB2HpO5JcpGw,1671
|
|
51
|
-
pytgcalls/methods/utilities/log_retries.py,sha256=6nD9J3350t82I0PKzK1pVx3ZaCBHATReiXYMs3PuVhQ,342
|
|
52
66
|
pytgcalls/methods/utilities/ping.py,sha256=hhIMSHk2BzMB-IKpwLdZFVrsEvGm2ftJwKLs1k4anh8,244
|
|
53
67
|
pytgcalls/methods/utilities/resolve_chat_id.py,sha256=92x2LHbUlnJMm-kS3fXOYmzYpY2TZbqtQD2rw3eBXDY,382
|
|
54
68
|
pytgcalls/methods/utilities/run.py,sha256=cnYQd2xB5Cr_WS0Q2cXJZPGiN6JOCULzj1r4xXVyrlg,152
|
|
55
|
-
pytgcalls/methods/utilities/start.py,sha256=
|
|
69
|
+
pytgcalls/methods/utilities/start.py,sha256=mn0kQZhTUuc-9CCJDbFIVsEtJ8kfnfZOGbVC505qVRM,3232
|
|
56
70
|
pytgcalls/methods/utilities/stream_params.py,sha256=fOSloo1A7WTxaZEtOiPXjdexMeoJjq8CZtfHuIFX7Ns,3325
|
|
57
|
-
pytgcalls/methods/utilities/update_sources.py,sha256=ISF6u3rk4IcVrPOEOB-uZUDfnwUp2_y1_2g9GboXpWM,1562
|
|
58
71
|
pytgcalls/mtproto/__init__.py,sha256=X4zvzFG7km7qHyE0fdvA550WcOVO_xl_p__gvIfDGmw,130
|
|
59
|
-
pytgcalls/mtproto/bridged_client.py,sha256=
|
|
60
|
-
pytgcalls/mtproto/client_cache.py,sha256=
|
|
61
|
-
pytgcalls/mtproto/hydrogram_client.py,sha256=
|
|
62
|
-
pytgcalls/mtproto/mtproto_client.py,sha256=
|
|
63
|
-
pytgcalls/mtproto/pyrogram_client.py,sha256=
|
|
64
|
-
pytgcalls/mtproto/telethon_client.py,sha256=
|
|
65
|
-
pytgcalls/types/__init__.py,sha256=
|
|
72
|
+
pytgcalls/mtproto/bridged_client.py,sha256=svXufZkCj7WM9XOWkuk5oJVQxgL1Bg_8rz7w_ZKWlQg,6451
|
|
73
|
+
pytgcalls/mtproto/client_cache.py,sha256=fpmZhRUGD3G2t2LjEK0z4OPLmWVhJQZUvDW6bgr6StI,5907
|
|
74
|
+
pytgcalls/mtproto/hydrogram_client.py,sha256=pSEtHowL833-vD5ppm78eBe7_Ik0pumChbDTMLsyP5Y,25553
|
|
75
|
+
pytgcalls/mtproto/mtproto_client.py,sha256=95A13HsNJfpNslsY_gWiqYXj_Vvo-pl3rVrsJGxftgg,8517
|
|
76
|
+
pytgcalls/mtproto/pyrogram_client.py,sha256=linvRHAxZCb4PenJEN9-OtjQm7Go9OONyDotZcMydNY,25710
|
|
77
|
+
pytgcalls/mtproto/telethon_client.py,sha256=iDMAAKvvFVigOrLPusG9ytiswxM2UCp4KZZuwtT-vKo,24987
|
|
78
|
+
pytgcalls/types/__init__.py,sha256=GlgBBXAwbNopXSeTTmiXktrEJhhN_rMBtuAllTBbN3k,1189
|
|
66
79
|
pytgcalls/types/browsers.py,sha256=47Kr5q96n4Q4WvVhA6IUlS2egEcA9GRLlDeFcQYyc9M,9545
|
|
67
80
|
pytgcalls/types/cache.py,sha256=FfsOcmYnsBGPlJoTPIXXYcUSpGE3rhx6cjIH77hyUL0,1059
|
|
68
81
|
pytgcalls/types/dict.py,sha256=lAo9hu4VlVJa9S7P8Y81BYmKtvz0rH7hwpGcH3ynHUw,78
|
|
@@ -72,13 +85,14 @@ pytgcalls/types/participant_list.py,sha256=LmGjU63MK1v3SS2_4xNbk04OOjmukNdAXYLRn
|
|
|
72
85
|
pytgcalls/types/py_object.py,sha256=__GNXgffGK4jhdF4QPqIknd0k2myObJf_7fW3pNGpbU,836
|
|
73
86
|
pytgcalls/types/update.py,sha256=wPCzWLhrsScZ3ksRTyt8IuDaaG5YI-ItG_Yw-OqzK2Y,157
|
|
74
87
|
pytgcalls/types/user_agent.py,sha256=sSfeGqUe0v0wqBgdVszNFK0iOC_0Tdyto9CglBXlY4U,1086
|
|
75
|
-
pytgcalls/types/calls/__init__.py,sha256=
|
|
88
|
+
pytgcalls/types/calls/__init__.py,sha256=lgFG89_NGhWHOQqhfw3adPaQZMzsMKI1f-MyZW3TBBU,478
|
|
76
89
|
pytgcalls/types/calls/call.py,sha256=n7LW7FRNT2qJzbYC3D312judOlVUuocQ1eW9l9scGCo,546
|
|
77
90
|
pytgcalls/types/calls/call_config.py,sha256=b6P43YTGF2t7E2CyD1mSYPJDUBvYYeHoxB3hSbTVyOY,120
|
|
78
91
|
pytgcalls/types/calls/call_data.py,sha256=-qPj2QhWv32Xs7LyFQY4hiWDqJ21B8VBvdzREK8bDvY,544
|
|
79
92
|
pytgcalls/types/calls/call_protocol.py,sha256=OVIQs1VgdY-DWbZbNr41hjLA4pGQvHx8Rgom1_NhJxQ,408
|
|
80
93
|
pytgcalls/types/calls/call_sources.py,sha256=sBhumPgEaN8uAKjBwb1Zf_Ag0qrceti2mURXqMhBusg,107
|
|
81
94
|
pytgcalls/types/calls/group_call_config.py,sha256=auKH-hZJWj8PhTkyeQ_VK2z9NpNvNC7Scl_IhEUMnQM,353
|
|
95
|
+
pytgcalls/types/calls/pending_connection.py,sha256=qRRmutInj70rtzbThM7CNznFhEPqTNZQc6LUWnqpZ9I,432
|
|
82
96
|
pytgcalls/types/calls/raw_call_update.py,sha256=hpNw6HrTW8Z36Lh2HinS-wzprryRtsIxyIFbIfjGgeI,795
|
|
83
97
|
pytgcalls/types/chats/__init__.py,sha256=v8pUp_vbr2kQpyHtAQc80N-YqzmXHe9SbllUsa6njkU,261
|
|
84
98
|
pytgcalls/types/chats/chat_update.py,sha256=lzrqNDPv4a_yXpKIfUnhocXqZyIy8XgZladOQTYrrYA,730
|
|
@@ -101,7 +115,7 @@ pytgcalls/types/stream/record_stream.py,sha256=RWeD9U-sqUmb_PuZQxYnExZyoibepU_8o
|
|
|
101
115
|
pytgcalls/types/stream/stream_ended.py,sha256=xR_kZwFf03hA6rw_nvI7Be7GwoCKzQf_1MKaGpPDXqY,716
|
|
102
116
|
pytgcalls/types/stream/stream_frames.py,sha256=028ZhNV-mN3BGqMlmxusAV1xDQpXRYCeM0WXBZhRUhA,446
|
|
103
117
|
pytgcalls/types/stream/video_quality.py,sha256=HBfWq005kh-D19MaVE9VzVdnODzrXf4IJUimCfslfiU,231
|
|
104
|
-
py_tgcalls-2.1.
|
|
105
|
-
py_tgcalls-2.1.
|
|
106
|
-
py_tgcalls-2.1.
|
|
107
|
-
py_tgcalls-2.1.
|
|
118
|
+
py_tgcalls-2.1.2b2.dist-info/METADATA,sha256=GxtcdfoQ7YJZWo5rwwvc1IDUdK4dR7teugIeXM80NLQ,5284
|
|
119
|
+
py_tgcalls-2.1.2b2.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
|
|
120
|
+
py_tgcalls-2.1.2b2.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
|
|
121
|
+
py_tgcalls-2.1.2b2.dist-info/RECORD,,
|
pytgcalls/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '2.1.
|
|
1
|
+
__version__ = '2.1.2b2'
|
pytgcalls/exceptions.py
CHANGED
|
@@ -157,13 +157,6 @@ class YtDlpError(Exception):
|
|
|
157
157
|
)
|
|
158
158
|
|
|
159
159
|
|
|
160
|
-
class UnMuteNeeded(Exception):
|
|
161
|
-
def __init__(self):
|
|
162
|
-
super().__init__(
|
|
163
|
-
'Needed to unmute the userbot',
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
|
|
167
160
|
class MTProtoClientNotConnected(Exception):
|
|
168
161
|
def __init__(self):
|
|
169
162
|
super().__init__(
|
pytgcalls/methods/__init__.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from .calls import Calls
|
|
2
2
|
from .decorators import Decorators
|
|
3
|
+
from .internal import Internal
|
|
3
4
|
from .stream import StreamMethods
|
|
4
5
|
from .utilities import Utilities
|
|
5
6
|
|
|
@@ -7,6 +8,7 @@ from .utilities import Utilities
|
|
|
7
8
|
class Methods(
|
|
8
9
|
Calls,
|
|
9
10
|
Decorators,
|
|
11
|
+
Internal,
|
|
10
12
|
StreamMethods,
|
|
11
13
|
Utilities,
|
|
12
14
|
):
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from .clear_cache import ClearCache
|
|
2
|
+
from .clear_call import ClearCall
|
|
3
|
+
from .connect_call import ConnectCall
|
|
4
|
+
from .emit_sig_data import EmitSigData
|
|
5
|
+
from .handle_connection_changed import HandleConnectionChanged
|
|
6
|
+
from .handle_mtproto_updates import HandleMTProtoUpdates
|
|
7
|
+
from .handle_stream_ended import HandleStreamEnded
|
|
8
|
+
from .handle_stream_frame import HandleStreamFrame
|
|
9
|
+
from .join_presentation import JoinPresentation
|
|
10
|
+
from .log_retries import LogRetries
|
|
11
|
+
from .request_broadcast_part import RequestBroadcastPart
|
|
12
|
+
from .request_broadcast_timestamp import RequestBroadcastTimestamp
|
|
13
|
+
from .switch_connection import SwitchConnection
|
|
14
|
+
from .update_sources import UpdateSources
|
|
15
|
+
from .update_status import UpdateStatus
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Internal(
|
|
19
|
+
ClearCache,
|
|
20
|
+
ClearCall,
|
|
21
|
+
ConnectCall,
|
|
22
|
+
EmitSigData,
|
|
23
|
+
HandleConnectionChanged,
|
|
24
|
+
HandleMTProtoUpdates,
|
|
25
|
+
HandleStreamEnded,
|
|
26
|
+
HandleStreamFrame,
|
|
27
|
+
JoinPresentation,
|
|
28
|
+
LogRetries,
|
|
29
|
+
RequestBroadcastPart,
|
|
30
|
+
RequestBroadcastTimestamp,
|
|
31
|
+
SwitchConnection,
|
|
32
|
+
UpdateSources,
|
|
33
|
+
UpdateStatus,
|
|
34
|
+
):
|
|
35
|
+
pass
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from ntgcalls import ConnectionNotFound
|
|
2
|
+
from ntgcalls import TelegramServerError
|
|
3
|
+
|
|
4
|
+
from ...scaffold import Scaffold
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ClearCall(Scaffold):
|
|
8
|
+
async def _clear_call(self, chat_id: int):
|
|
9
|
+
res = False
|
|
10
|
+
if chat_id in self._wait_connect:
|
|
11
|
+
self._wait_connect[chat_id].set_exception(
|
|
12
|
+
TelegramServerError(),
|
|
13
|
+
)
|
|
14
|
+
try:
|
|
15
|
+
await self._binding.stop(chat_id)
|
|
16
|
+
res = True
|
|
17
|
+
except ConnectionNotFound:
|
|
18
|
+
pass
|
|
19
|
+
self._clear_cache(chat_id)
|
|
20
|
+
return res
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
from typing import Optional
|
|
3
|
+
from typing import Union
|
|
4
|
+
|
|
5
|
+
from ntgcalls import ConnectionMode
|
|
6
|
+
from ntgcalls import ConnectionNotFound
|
|
7
|
+
from ntgcalls import MediaDescription
|
|
8
|
+
from ntgcalls import TelegramServerError
|
|
9
|
+
|
|
10
|
+
from ...exceptions import TimedOutAnswer
|
|
11
|
+
from ...scaffold import Scaffold
|
|
12
|
+
from ...types import CallConfig
|
|
13
|
+
from ...types import CallData
|
|
14
|
+
from ...types import GroupCallConfig
|
|
15
|
+
from ...types import PendingConnection
|
|
16
|
+
from ...types import RawCallUpdate
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ConnectCall(Scaffold):
|
|
20
|
+
async def _connect_call(
|
|
21
|
+
self,
|
|
22
|
+
chat_id: int,
|
|
23
|
+
media_description: MediaDescription,
|
|
24
|
+
config: Union[CallConfig, GroupCallConfig],
|
|
25
|
+
payload: Optional[str],
|
|
26
|
+
):
|
|
27
|
+
for retries in range(4):
|
|
28
|
+
try:
|
|
29
|
+
self._wait_connect[chat_id] = self.loop.create_future()
|
|
30
|
+
if isinstance(config, GroupCallConfig):
|
|
31
|
+
if not payload:
|
|
32
|
+
payload = await self._binding.create_call(
|
|
33
|
+
chat_id,
|
|
34
|
+
media_description,
|
|
35
|
+
)
|
|
36
|
+
result_params = await self._app.join_group_call(
|
|
37
|
+
chat_id,
|
|
38
|
+
payload,
|
|
39
|
+
config.invite_hash,
|
|
40
|
+
media_description.camera is None and
|
|
41
|
+
media_description.screen is None,
|
|
42
|
+
self._cache_user_peer.get(chat_id),
|
|
43
|
+
)
|
|
44
|
+
await self._binding.connect(
|
|
45
|
+
chat_id,
|
|
46
|
+
result_params,
|
|
47
|
+
False,
|
|
48
|
+
)
|
|
49
|
+
connection_mode = await self._binding.get_connection_mode(
|
|
50
|
+
chat_id,
|
|
51
|
+
)
|
|
52
|
+
if connection_mode == ConnectionMode.STREAM and payload:
|
|
53
|
+
self._pending_connections[chat_id] = PendingConnection(
|
|
54
|
+
media_description,
|
|
55
|
+
config,
|
|
56
|
+
payload,
|
|
57
|
+
False,
|
|
58
|
+
)
|
|
59
|
+
else:
|
|
60
|
+
data = self._p2p_configs.setdefault(
|
|
61
|
+
chat_id,
|
|
62
|
+
CallData(await self._app.get_dhc(), self.loop),
|
|
63
|
+
)
|
|
64
|
+
await self._binding.create_p2p_call(
|
|
65
|
+
chat_id,
|
|
66
|
+
media_description,
|
|
67
|
+
)
|
|
68
|
+
data.g_a_or_b = await self._binding.init_exchange(
|
|
69
|
+
chat_id,
|
|
70
|
+
data.dh_config,
|
|
71
|
+
data.g_a_or_b,
|
|
72
|
+
)
|
|
73
|
+
if not data.outgoing:
|
|
74
|
+
await self._app.accept_call(
|
|
75
|
+
chat_id,
|
|
76
|
+
data.g_a_or_b,
|
|
77
|
+
self._binding.get_protocol(),
|
|
78
|
+
)
|
|
79
|
+
else:
|
|
80
|
+
await self._app.request_call(
|
|
81
|
+
chat_id,
|
|
82
|
+
data.g_a_or_b,
|
|
83
|
+
self._binding.get_protocol(),
|
|
84
|
+
media_description.camera is not None or
|
|
85
|
+
media_description.screen is not None,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
try:
|
|
89
|
+
result: RawCallUpdate = await asyncio.wait_for(
|
|
90
|
+
data.wait_data,
|
|
91
|
+
timeout=config.timeout,
|
|
92
|
+
)
|
|
93
|
+
auth_params = await self._binding.exchange_keys(
|
|
94
|
+
chat_id,
|
|
95
|
+
result.g_a_or_b,
|
|
96
|
+
result.fingerprint,
|
|
97
|
+
)
|
|
98
|
+
if result.status & RawCallUpdate.Type.ACCEPTED:
|
|
99
|
+
result.protocol = await self._app.confirm_call(
|
|
100
|
+
chat_id,
|
|
101
|
+
auth_params.g_a_or_b,
|
|
102
|
+
auth_params.key_fingerprint,
|
|
103
|
+
self._binding.get_protocol(),
|
|
104
|
+
)
|
|
105
|
+
await self._binding.connect_p2p(
|
|
106
|
+
chat_id,
|
|
107
|
+
result.protocol.rtc_servers,
|
|
108
|
+
result.protocol.library_versions,
|
|
109
|
+
result.protocol.p2p_allowed,
|
|
110
|
+
)
|
|
111
|
+
except asyncio.TimeoutError:
|
|
112
|
+
try:
|
|
113
|
+
await self._binding.stop(chat_id)
|
|
114
|
+
except ConnectionNotFound:
|
|
115
|
+
pass
|
|
116
|
+
await self._app.discard_call(chat_id, True)
|
|
117
|
+
raise TimedOutAnswer()
|
|
118
|
+
finally:
|
|
119
|
+
self._p2p_configs.pop(chat_id, None)
|
|
120
|
+
await self._wait_connect[chat_id]
|
|
121
|
+
break
|
|
122
|
+
except TelegramServerError:
|
|
123
|
+
if retries == 3 or chat_id > 0:
|
|
124
|
+
raise
|
|
125
|
+
self._log_retries(retries)
|
|
126
|
+
except Exception:
|
|
127
|
+
try:
|
|
128
|
+
await self._binding.stop(chat_id)
|
|
129
|
+
except ConnectionNotFound:
|
|
130
|
+
pass
|
|
131
|
+
raise
|
|
132
|
+
finally:
|
|
133
|
+
self._wait_connect.pop(chat_id, None)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from ntgcalls import ConnectionState
|
|
2
|
+
from ntgcalls import NetworkInfo
|
|
3
|
+
from ntgcalls import TelegramServerError
|
|
4
|
+
|
|
5
|
+
from ...scaffold import Scaffold
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class HandleConnectionChanged(Scaffold):
|
|
9
|
+
async def _handle_connection_changed(
|
|
10
|
+
self,
|
|
11
|
+
chat_id: int,
|
|
12
|
+
net_state: NetworkInfo,
|
|
13
|
+
):
|
|
14
|
+
state = net_state.state
|
|
15
|
+
if state == ConnectionState.CONNECTING:
|
|
16
|
+
return
|
|
17
|
+
if chat_id in self._wait_connect:
|
|
18
|
+
if state == ConnectionState.CONNECTED:
|
|
19
|
+
self._wait_connect[chat_id].set_result(None)
|
|
20
|
+
else:
|
|
21
|
+
self._wait_connect[chat_id].set_exception(
|
|
22
|
+
TelegramServerError(),
|
|
23
|
+
)
|
|
24
|
+
elif state != ConnectionState.CONNECTED:
|
|
25
|
+
if chat_id > 0:
|
|
26
|
+
await self._app.discard_call(chat_id)
|
|
27
|
+
self._clear_cache(chat_id)
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
from ntgcalls import ConnectionError
|
|
2
|
+
from ntgcalls import ConnectionNotFound
|
|
3
|
+
|
|
4
|
+
from ...exceptions import CallBusy
|
|
5
|
+
from ...exceptions import CallDeclined
|
|
6
|
+
from ...exceptions import CallDiscarded
|
|
7
|
+
from ...mtproto import BridgedClient
|
|
8
|
+
from ...scaffold import Scaffold
|
|
9
|
+
from ...types import CallData
|
|
10
|
+
from ...types import ChatUpdate
|
|
11
|
+
from ...types import GroupCallParticipant
|
|
12
|
+
from ...types import RawCallUpdate
|
|
13
|
+
from ...types import Update
|
|
14
|
+
from ...types import UpdatedGroupCallParticipant
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class HandleMTProtoUpdates(Scaffold):
|
|
18
|
+
async def _handle_mtproto_updates(self, update: Update):
|
|
19
|
+
chat_id = update.chat_id
|
|
20
|
+
if update.chat_id in self._p2p_configs:
|
|
21
|
+
p2p_config = self._p2p_configs[chat_id]
|
|
22
|
+
if not p2p_config.wait_data.done():
|
|
23
|
+
if isinstance(update, RawCallUpdate):
|
|
24
|
+
if update.status & RawCallUpdate.Type.UPDATED_CALL:
|
|
25
|
+
p2p_config.wait_data.set_result(
|
|
26
|
+
update,
|
|
27
|
+
)
|
|
28
|
+
if isinstance(update, ChatUpdate) and \
|
|
29
|
+
p2p_config.outgoing:
|
|
30
|
+
if update.status & ChatUpdate.Status.DISCARDED_CALL:
|
|
31
|
+
self._wait_connect.pop(chat_id, None)
|
|
32
|
+
p2p_config.wait_data.set_exception(
|
|
33
|
+
CallBusy(
|
|
34
|
+
chat_id,
|
|
35
|
+
) if update.status &
|
|
36
|
+
ChatUpdate.Status.BUSY_CALL else
|
|
37
|
+
CallDeclined(
|
|
38
|
+
chat_id,
|
|
39
|
+
),
|
|
40
|
+
)
|
|
41
|
+
if chat_id in self._wait_connect and \
|
|
42
|
+
not self._wait_connect[chat_id].done():
|
|
43
|
+
if isinstance(update, ChatUpdate):
|
|
44
|
+
if update.status & ChatUpdate.Status.DISCARDED_CALL:
|
|
45
|
+
self._wait_connect[chat_id].set_exception(
|
|
46
|
+
CallDiscarded(
|
|
47
|
+
chat_id,
|
|
48
|
+
),
|
|
49
|
+
)
|
|
50
|
+
if isinstance(update, RawCallUpdate):
|
|
51
|
+
if update.status & RawCallUpdate.Type.REQUESTED:
|
|
52
|
+
self._p2p_configs[chat_id] = CallData(
|
|
53
|
+
await self._app.get_dhc(),
|
|
54
|
+
self.loop,
|
|
55
|
+
update.g_a_or_b,
|
|
56
|
+
)
|
|
57
|
+
update = ChatUpdate(
|
|
58
|
+
chat_id,
|
|
59
|
+
ChatUpdate.Status.INCOMING_CALL,
|
|
60
|
+
)
|
|
61
|
+
if isinstance(update, RawCallUpdate):
|
|
62
|
+
if update.status & RawCallUpdate.Type.SIGNALING_DATA:
|
|
63
|
+
try:
|
|
64
|
+
await self._binding.send_signaling(
|
|
65
|
+
update.chat_id,
|
|
66
|
+
update.signaling_data,
|
|
67
|
+
)
|
|
68
|
+
except (ConnectionNotFound, ConnectionError):
|
|
69
|
+
pass
|
|
70
|
+
if isinstance(update, ChatUpdate):
|
|
71
|
+
if update.status & ChatUpdate.Status.LEFT_CALL:
|
|
72
|
+
await self._clear_call(chat_id)
|
|
73
|
+
if isinstance(update, UpdatedGroupCallParticipant):
|
|
74
|
+
participant = update.participant
|
|
75
|
+
action = participant.action
|
|
76
|
+
chat_peer = self._cache_user_peer.get(chat_id)
|
|
77
|
+
user_id = participant.user_id
|
|
78
|
+
if chat_id in self._call_sources:
|
|
79
|
+
call_sources = self._call_sources[chat_id]
|
|
80
|
+
was_camera = user_id in call_sources.camera
|
|
81
|
+
was_screen = user_id in call_sources.presentation
|
|
82
|
+
|
|
83
|
+
if was_camera != participant.video_camera:
|
|
84
|
+
if participant.video_info:
|
|
85
|
+
self._call_sources[chat_id].camera[
|
|
86
|
+
user_id
|
|
87
|
+
] = participant.video_info.endpoint
|
|
88
|
+
try:
|
|
89
|
+
await self._binding.add_incoming_video(
|
|
90
|
+
chat_id,
|
|
91
|
+
participant.video_info.endpoint,
|
|
92
|
+
participant.video_info.sources,
|
|
93
|
+
)
|
|
94
|
+
except (ConnectionNotFound, ConnectionError):
|
|
95
|
+
pass
|
|
96
|
+
elif user_id in self._call_sources[chat_id].camera:
|
|
97
|
+
try:
|
|
98
|
+
await self._binding.remove_incoming_video(
|
|
99
|
+
chat_id,
|
|
100
|
+
self._call_sources[
|
|
101
|
+
chat_id
|
|
102
|
+
].camera[user_id],
|
|
103
|
+
)
|
|
104
|
+
except (ConnectionNotFound, ConnectionError):
|
|
105
|
+
pass
|
|
106
|
+
self._call_sources[chat_id].camera.pop(
|
|
107
|
+
user_id, None,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
if was_screen != participant.screen_sharing:
|
|
111
|
+
if participant.presentation_info:
|
|
112
|
+
self._call_sources[chat_id].presentation[
|
|
113
|
+
user_id
|
|
114
|
+
] = participant.presentation_info.endpoint
|
|
115
|
+
try:
|
|
116
|
+
await self._binding.add_incoming_video(
|
|
117
|
+
chat_id,
|
|
118
|
+
participant.presentation_info.endpoint,
|
|
119
|
+
participant.presentation_info.sources,
|
|
120
|
+
)
|
|
121
|
+
except (ConnectionNotFound, ConnectionError):
|
|
122
|
+
pass
|
|
123
|
+
elif user_id in self._call_sources[
|
|
124
|
+
chat_id
|
|
125
|
+
].presentation:
|
|
126
|
+
try:
|
|
127
|
+
await self._binding.remove_incoming_video(
|
|
128
|
+
chat_id,
|
|
129
|
+
self._call_sources[
|
|
130
|
+
chat_id
|
|
131
|
+
].presentation[user_id],
|
|
132
|
+
)
|
|
133
|
+
except (ConnectionNotFound, ConnectionError):
|
|
134
|
+
pass
|
|
135
|
+
self._call_sources[chat_id].presentation.pop(
|
|
136
|
+
user_id, None,
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
if chat_peer:
|
|
140
|
+
is_self = BridgedClient.chat_id(
|
|
141
|
+
chat_peer,
|
|
142
|
+
) == participant.user_id if chat_peer else False
|
|
143
|
+
if is_self:
|
|
144
|
+
if action == GroupCallParticipant.Action.LEFT:
|
|
145
|
+
if await self._clear_call(chat_id):
|
|
146
|
+
await self._propagate(
|
|
147
|
+
ChatUpdate(
|
|
148
|
+
chat_id,
|
|
149
|
+
ChatUpdate.Status.KICKED,
|
|
150
|
+
),
|
|
151
|
+
self,
|
|
152
|
+
)
|
|
153
|
+
if (
|
|
154
|
+
chat_id in self._need_unmute and
|
|
155
|
+
action == GroupCallParticipant.Action.UPDATED and
|
|
156
|
+
not participant.muted_by_admin
|
|
157
|
+
):
|
|
158
|
+
await self._update_status(
|
|
159
|
+
chat_id,
|
|
160
|
+
await self._binding.get_state(chat_id),
|
|
161
|
+
)
|
|
162
|
+
await self._switch_connection(chat_id)
|
|
163
|
+
|
|
164
|
+
if (
|
|
165
|
+
participant.muted_by_admin and
|
|
166
|
+
action != GroupCallParticipant.Action.LEFT
|
|
167
|
+
):
|
|
168
|
+
self._need_unmute.add(chat_id)
|
|
169
|
+
else:
|
|
170
|
+
self._need_unmute.discard(chat_id)
|
|
171
|
+
if not isinstance(update, RawCallUpdate):
|
|
172
|
+
await self._propagate(
|
|
173
|
+
update,
|
|
174
|
+
self,
|
|
175
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from ntgcalls import StreamDevice
|
|
2
|
+
from ntgcalls import StreamType
|
|
3
|
+
|
|
4
|
+
from ...scaffold import Scaffold
|
|
5
|
+
from ...types import Device
|
|
6
|
+
from ...types import StreamEnded
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class HandleStreamEnded(Scaffold):
|
|
10
|
+
async def _handle_stream_ended(
|
|
11
|
+
self,
|
|
12
|
+
chat_id: int,
|
|
13
|
+
stream_type: StreamType,
|
|
14
|
+
device: StreamDevice,
|
|
15
|
+
):
|
|
16
|
+
await self._propagate(
|
|
17
|
+
StreamEnded(
|
|
18
|
+
chat_id,
|
|
19
|
+
StreamEnded.Type.from_raw(stream_type),
|
|
20
|
+
Device.from_raw(device),
|
|
21
|
+
),
|
|
22
|
+
self,
|
|
23
|
+
)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from ntgcalls import Frame as RawFrame
|
|
4
|
+
from ntgcalls import StreamDevice
|
|
5
|
+
from ntgcalls import StreamMode
|
|
6
|
+
|
|
7
|
+
from ...scaffold import Scaffold
|
|
8
|
+
from ...types import Device
|
|
9
|
+
from ...types import Direction
|
|
10
|
+
from ...types import Frame
|
|
11
|
+
from ...types import StreamFrames
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class HandleStreamFrame(Scaffold):
|
|
15
|
+
async def _handle_stream_frame(
|
|
16
|
+
self,
|
|
17
|
+
chat_id: int,
|
|
18
|
+
mode: StreamMode,
|
|
19
|
+
device: StreamDevice,
|
|
20
|
+
frames: List[RawFrame],
|
|
21
|
+
):
|
|
22
|
+
await self._propagate(
|
|
23
|
+
StreamFrames(
|
|
24
|
+
chat_id,
|
|
25
|
+
Direction.from_raw(mode),
|
|
26
|
+
Device.from_raw(device),
|
|
27
|
+
[
|
|
28
|
+
Frame(
|
|
29
|
+
x.ssrc,
|
|
30
|
+
x.data,
|
|
31
|
+
Frame.Info(
|
|
32
|
+
x.frame_data.absolute_capture_timestamp_ms,
|
|
33
|
+
x.frame_data.width,
|
|
34
|
+
x.frame_data.height,
|
|
35
|
+
x.frame_data.rotation,
|
|
36
|
+
),
|
|
37
|
+
) for x in frames
|
|
38
|
+
],
|
|
39
|
+
),
|
|
40
|
+
self,
|
|
41
|
+
)
|