py-tgcalls 2.2.1__py3-none-any.whl → 2.2.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-tgcalls
3
- Version: 2.2.1
3
+ Version: 2.2.3
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<3.0.0,>=2.0.1
23
+ Requires-Dist: ntgcalls<3.0.0,>=2.0.3
24
24
  Requires-Dist: deprecation
25
25
  Provides-Extra: pyrogram
26
26
  Requires-Dist: pyrogram>=1.2.20; extra == "pyrogram"
@@ -1,6 +1,6 @@
1
- py_tgcalls-2.2.1.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
1
+ py_tgcalls-2.2.3.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
2
2
  pytgcalls/__init__.py,sha256=qbfwN7rYwIdCegMOzdcbvwazeNjDzgmowgcqLFNqKIM,308
3
- pytgcalls/__version__.py,sha256=-7agX4LcQ0956RU4mY0EYyxYQU9llH7JklZOsqoujdU,22
3
+ pytgcalls/__version__.py,sha256=imyOcBgptJng0fWUAVwWSHYVE3csDgLCIYFSbnvEA-U,22
4
4
  pytgcalls/environment.py,sha256=ctCHACvG6l8SdpPewSBhOvc70kbwpv18maC0TwLvZ08,1924
5
5
  pytgcalls/exceptions.py,sha256=Rijc-8T93WEWJxNW9jncU8_M6mYZZZcs8F2bqitEIeI,3787
6
6
  pytgcalls/ffmpeg.py,sha256=CZvSyuztc-TGKbKI9_2G7CLITe1ITf315YPyprWu_Pg,8645
@@ -34,15 +34,15 @@ pytgcalls/methods/calls/leave_call.py,sha256=XiaKrnSgaItbAIUpdGXCo1HgXY7V7FcDjRs
34
34
  pytgcalls/methods/decorators/__init__.py,sha256=TCGaEVZnHjtOwv-3PNfaCVm0kyFhJApUPUNntt6MwyM,78
35
35
  pytgcalls/methods/decorators/on_update.py,sha256=ZTL4YcQk0N4Ru56a5WItUvkSN5SAqr6_RDZvXmZMIHs,316
36
36
  pytgcalls/methods/internal/__init__.py,sha256=fcgIxUJKT6QJD30ltnOfzKsLhzTTTklD2qxKlwCvyv0,1057
37
- pytgcalls/methods/internal/clear_cache.py,sha256=qgG-oubmdtnefnXSiHSPHyBTyXypiLDC7G8l3FzjNw8,236
38
- pytgcalls/methods/internal/clear_call.py,sha256=yElvn3i6_j14Q7n9kcLSl-muYAGcaIZaEFHdp6MrN0g,549
39
- pytgcalls/methods/internal/connect_call.py,sha256=Py-sB_ImH839tK9GxNUCJDJUNizsZtlm5m6kuiUX3lE,5739
37
+ pytgcalls/methods/internal/clear_cache.py,sha256=IbcDOGiBJbmqOnGJWkIe8c6P_Y6e0YPkui4Hg4PAZlA,334
38
+ pytgcalls/methods/internal/clear_call.py,sha256=u84SdZb5z6lGRxf7dbrcAcf-xObGVgMsHqSmvdzoAbQ,487
39
+ pytgcalls/methods/internal/connect_call.py,sha256=fRQYfDzpwyCXHDOTDSxPdzFu8bmeNf9hvP6c6lpNS-k,5739
40
40
  pytgcalls/methods/internal/emit_sig_data.py,sha256=ucIsknhJHB-0x7lcymXvwQ647AJQ852zH2W6MdlC3ws,216
41
41
  pytgcalls/methods/internal/handle_connection_changed.py,sha256=_1u3J6_Pjl1Gs1u_WkhG2FAUl_hxlHUiflaMkKkJDsc,866
42
- pytgcalls/methods/internal/handle_mtproto_updates.py,sha256=ZPGvenIjWiNnTTTKdhQdapHsxwYn4pSKOgKm8bPcPOk,7415
42
+ pytgcalls/methods/internal/handle_mtproto_updates.py,sha256=mdj8N4GXX1J650dE7OThSAVCmtB4wwByqd95P6vmbU8,7461
43
43
  pytgcalls/methods/internal/handle_stream_ended.py,sha256=DllD1ZfGQbwVh-S0neocwnN-8lQtwwyrzWl9teSrZbY,561
44
44
  pytgcalls/methods/internal/handle_stream_frame.py,sha256=_FA782qlOT3tUqnySm7RBpjbgfEEzt1oEBDm-iADsbQ,1145
45
- pytgcalls/methods/internal/join_presentation.py,sha256=dLB2kolIIm2KQH8yBQbEPJi_y1_cVLWpE52_Rwjn_KE,2178
45
+ pytgcalls/methods/internal/join_presentation.py,sha256=sXhmzbLWwVFi3gFl1rv0OgJsRJBrvjzRcl60N6ydNW8,2184
46
46
  pytgcalls/methods/internal/log_retries.py,sha256=6nD9J3350t82I0PKzK1pVx3ZaCBHATReiXYMs3PuVhQ,342
47
47
  pytgcalls/methods/internal/request_broadcast_part.py,sha256=oh-SqMCuQQErpF9Gd8ubPDoZeaz4bKw0dK--JrjXK9s,1313
48
48
  pytgcalls/methods/internal/request_broadcast_timestamp.py,sha256=yEEmtyLR-EsEO1aXMcRAD34LRH63gY6ZQvn_Sw9quLk,642
@@ -52,7 +52,7 @@ pytgcalls/methods/internal/update_status.py,sha256=6zH7oMM_qPE-88mdC5CBhT07gPvay
52
52
  pytgcalls/methods/stream/__init__.py,sha256=mAcOih0-NT6T_Gspej6mySpJNPuEe46sUwgKV3vSvYM,336
53
53
  pytgcalls/methods/stream/mute.py,sha256=ZrZS_EeNUeUxb6UgbdhwXUdRX826u-qSjH5a6sg7LsE,557
54
54
  pytgcalls/methods/stream/pause.py,sha256=-kNvWQuv5VlssNcL-M6rkT5TKFmXlbOzJrDny95qsUc,560
55
- pytgcalls/methods/stream/play.py,sha256=XJB7o4Y5ImY1Qh_tHCkT70cUKOr9JlinWtVKwE8W5Rw,2951
55
+ pytgcalls/methods/stream/play.py,sha256=zJhWNCq2BKni1cCmPz6JVCTK2y-Pceh9ik4TYytR87I,3196
56
56
  pytgcalls/methods/stream/record.py,sha256=geYSVtSbp0yRIR1Nmj-L1s-6nqQAh0x0IcA1OuFvuyA,1306
57
57
  pytgcalls/methods/stream/resume.py,sha256=AUHU3AtpXO2rtp2V1EKSC_KAWTk2KHMiHaqHluYy31M,563
58
58
  pytgcalls/methods/stream/send_frame.py,sha256=Kj9R8OqUM-g7pt-FiWP-US7sCFkH5ciPr9S8v-WPtLg,1062
@@ -68,7 +68,7 @@ pytgcalls/methods/utilities/ping.py,sha256=hhIMSHk2BzMB-IKpwLdZFVrsEvGm2ftJwKLs1
68
68
  pytgcalls/methods/utilities/resolve_chat_id.py,sha256=92x2LHbUlnJMm-kS3fXOYmzYpY2TZbqtQD2rw3eBXDY,382
69
69
  pytgcalls/methods/utilities/run.py,sha256=cnYQd2xB5Cr_WS0Q2cXJZPGiN6JOCULzj1r4xXVyrlg,152
70
70
  pytgcalls/methods/utilities/start.py,sha256=mn0kQZhTUuc-9CCJDbFIVsEtJ8kfnfZOGbVC505qVRM,3232
71
- pytgcalls/methods/utilities/stream_params.py,sha256=fOSloo1A7WTxaZEtOiPXjdexMeoJjq8CZtfHuIFX7Ns,3325
71
+ pytgcalls/methods/utilities/stream_params.py,sha256=PUnctLhdCeBAg52v95vpxj-42Le5XzbnRtcfm71FDBM,3341
72
72
  pytgcalls/mtproto/__init__.py,sha256=X4zvzFG7km7qHyE0fdvA550WcOVO_xl_p__gvIfDGmw,130
73
73
  pytgcalls/mtproto/bridged_client.py,sha256=Qb9-9FrUdh3g_sx-JOcvkzv3kJtS_pz2Qaos85DgVPI,8280
74
74
  pytgcalls/mtproto/client_cache.py,sha256=5unu8sjLRaIKoEgJGaIRjhA4P3U2lFpfakTKFxKLzAM,5591
@@ -94,7 +94,7 @@ pytgcalls/types/calls/call_protocol.py,sha256=OVIQs1VgdY-DWbZbNr41hjLA4pGQvHx8Rg
94
94
  pytgcalls/types/calls/call_sources.py,sha256=sBhumPgEaN8uAKjBwb1Zf_Ag0qrceti2mURXqMhBusg,107
95
95
  pytgcalls/types/calls/group_call_config.py,sha256=auKH-hZJWj8PhTkyeQ_VK2z9NpNvNC7Scl_IhEUMnQM,353
96
96
  pytgcalls/types/calls/pending_connection.py,sha256=qRRmutInj70rtzbThM7CNznFhEPqTNZQc6LUWnqpZ9I,432
97
- pytgcalls/types/calls/raw_call_update.py,sha256=hpNw6HrTW8Z36Lh2HinS-wzprryRtsIxyIFbIfjGgeI,795
97
+ pytgcalls/types/calls/raw_call_update.py,sha256=pxcNY-spHXdATwdYu73HQuK2xUeoZ44naD10uoG_PtM,797
98
98
  pytgcalls/types/chats/__init__.py,sha256=v8pUp_vbr2kQpyHtAQc80N-YqzmXHe9SbllUsa6njkU,261
99
99
  pytgcalls/types/chats/chat_update.py,sha256=lzrqNDPv4a_yXpKIfUnhocXqZyIy8XgZladOQTYrrYA,730
100
100
  pytgcalls/types/chats/group_call_participant.py,sha256=aK7nvI0Jy93g9A_FVeFzk1BZFXzhFry06h8xR4VpqXY,1507
@@ -116,7 +116,7 @@ pytgcalls/types/stream/record_stream.py,sha256=f4VQ6MY8HtOxt7vz0hWBFmbbAIvTRHpAI
116
116
  pytgcalls/types/stream/stream_ended.py,sha256=xR_kZwFf03hA6rw_nvI7Be7GwoCKzQf_1MKaGpPDXqY,716
117
117
  pytgcalls/types/stream/stream_frames.py,sha256=028ZhNV-mN3BGqMlmxusAV1xDQpXRYCeM0WXBZhRUhA,446
118
118
  pytgcalls/types/stream/video_quality.py,sha256=eMCBFPwh5meX3UVEaozcGlwmgaujfpiTa3vBVSBBP_8,275
119
- py_tgcalls-2.2.1.dist-info/METADATA,sha256=7j-AgY6sI6uL623U_ZbjjXwbfu7_KymRphdpSLssPJE,5280
120
- py_tgcalls-2.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
121
- py_tgcalls-2.2.1.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
122
- py_tgcalls-2.2.1.dist-info/RECORD,,
119
+ py_tgcalls-2.2.3.dist-info/METADATA,sha256=F0k9s4eJBmRk4UcmwLMBwuEFx6UG-1Od7pJLf2KemCU,5280
120
+ py_tgcalls-2.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
121
+ py_tgcalls-2.2.3.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
122
+ py_tgcalls-2.2.3.dist-info/RECORD,,
pytgcalls/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '2.2.1'
1
+ __version__ = '2.2.3'
@@ -6,3 +6,5 @@ class ClearCache(Scaffold):
6
6
  self._p2p_configs.pop(chat_id, None)
7
7
  self._cache_user_peer.pop(chat_id)
8
8
  self._need_unmute.discard(chat_id)
9
+ self._presentations.discard(chat_id)
10
+ self._pending_connections.pop(chat_id, None)
@@ -6,15 +6,12 @@ from ...scaffold import Scaffold
6
6
 
7
7
  class ClearCall(Scaffold):
8
8
  async def _clear_call(self, chat_id: int):
9
- res = False
10
9
  if chat_id in self._wait_connect:
11
10
  self._wait_connect[chat_id].set_exception(
12
11
  TelegramServerError(),
13
12
  )
14
13
  try:
15
14
  await self._binding.stop(chat_id)
16
- res = True
17
15
  except ConnectionNotFound:
18
16
  pass
19
17
  self._clear_cache(chat_id)
20
- return res
@@ -42,8 +42,7 @@ class ConnectCall(Scaffold):
42
42
  chat_id,
43
43
  payload,
44
44
  config.invite_hash,
45
- media_description.camera is None and
46
- media_description.screen is None,
45
+ media_description.camera is None,
47
46
  self._cache_user_peer.get(chat_id),
48
47
  )
49
48
  await self._binding.connect(
@@ -140,3 +139,4 @@ class ConnectCall(Scaffold):
140
139
  raise
141
140
  finally:
142
141
  self._wait_connect.pop(chat_id, None)
142
+ self._pending_connections.pop(chat_id, None)
@@ -1,3 +1,5 @@
1
+ import logging
2
+
1
3
  from ntgcalls import ConnectionError
2
4
  from ntgcalls import ConnectionNotFound
3
5
 
@@ -13,9 +15,12 @@ from ...types import RawCallUpdate
13
15
  from ...types import Update
14
16
  from ...types import UpdatedGroupCallParticipant
15
17
 
18
+ py_logger = logging.getLogger('pytgcalls')
19
+
16
20
 
17
21
  class HandleMTProtoUpdates(Scaffold):
18
22
  async def _handle_mtproto_updates(self, update: Update):
23
+ py_logger.debug('Received: %s', update)
19
24
  chat_id = update.chat_id
20
25
  if update.chat_id in self._p2p_configs:
21
26
  p2p_config = self._p2p_configs[chat_id]
@@ -28,7 +33,6 @@ class HandleMTProtoUpdates(Scaffold):
28
33
  if isinstance(update, ChatUpdate) and \
29
34
  p2p_config.outgoing:
30
35
  if update.status & ChatUpdate.Status.DISCARDED_CALL:
31
- self._wait_connect.pop(chat_id, None)
32
36
  p2p_config.wait_data.set_exception(
33
37
  CallBusy(
34
38
  chat_id,
@@ -1,7 +1,7 @@
1
1
  from typing import Union
2
2
 
3
- from ntgcalls import ConnectionError
4
3
  from ntgcalls import ConnectionMode
4
+ from ntgcalls import ConnectionNotFound
5
5
  from ntgcalls import TelegramServerError
6
6
 
7
7
  from ...scaffold import Scaffold
@@ -53,6 +53,6 @@ class JoinPresentation(Scaffold):
53
53
  try:
54
54
  await self._binding.stop_presentation(chat_id)
55
55
  await self._app.leave_presentation(chat_id)
56
- except ConnectionError:
56
+ except ConnectionNotFound:
57
57
  pass
58
58
  self._presentations.discard(chat_id)
@@ -41,6 +41,7 @@ class Play(Scaffold):
41
41
  media_description = await StreamParams.get_stream_params(
42
42
  stream,
43
43
  )
44
+ is_presentation = media_description.screen is not None
44
45
 
45
46
  if chat_id in await self._binding.calls():
46
47
  try:
@@ -49,6 +50,11 @@ class Play(Scaffold):
49
50
  StreamMode.CAPTURE,
50
51
  media_description,
51
52
  )
53
+ if isinstance(config, GroupCallConfig):
54
+ await self._join_presentation(
55
+ chat_id,
56
+ is_presentation,
57
+ )
52
58
  return
53
59
  except FileError as e:
54
60
  raise FileNotFoundError(e)
@@ -81,7 +87,7 @@ class Play(Scaffold):
81
87
  if isinstance(config, GroupCallConfig):
82
88
  await self._join_presentation(
83
89
  chat_id,
84
- media_description.screen is not None,
90
+ is_presentation,
85
91
  )
86
92
  await self._update_sources(chat_id)
87
93
  except FileError as e:
@@ -31,7 +31,7 @@ class StreamParams:
31
31
  'MediaStream or a raw Stream',
32
32
  )
33
33
 
34
- return StreamParams._parse_stream_description(stream)
34
+ return StreamParams._parse_stream_description(stream) # type: ignore
35
35
 
36
36
  @staticmethod
37
37
  def _parse_media_description(
@@ -1,7 +1,7 @@
1
1
  from enum import auto
2
- from enum import Flag
3
2
  from typing import Optional
4
3
 
4
+ from ..flag import Flag
5
5
  from pytgcalls.types.update import Update
6
6
 
7
7