py-tgcalls 2.1.0rc3__py3-none-any.whl → 2.1.0rc4__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.2
2
2
  Name: py-tgcalls
3
- Version: 2.1.0rc3
3
+ Version: 2.1.0rc4
4
4
  Summary: Async client API for the Telegram Calls.
5
5
  Author-email: Laky-64 <iraci.matteo@gmail.com>
6
6
  License: GNU LESSER GENERAL PUBLIC LICENSE
@@ -187,7 +187,7 @@ Requires-Python: >=3.9
187
187
  Description-Content-Type: text/markdown
188
188
  License-File: LICENSE
189
189
  Requires-Dist: aiohttp>=3.9.3
190
- Requires-Dist: ntgcalls<1.4.0,>=1.3.0b11
190
+ Requires-Dist: ntgcalls<1.4.0,>=1.3.0b14
191
191
  Requires-Dist: deprecation
192
192
  Provides-Extra: pyrogram
193
193
  Requires-Dist: pyrogram>=1.2.20; extra == "pyrogram"
@@ -1,5 +1,5 @@
1
1
  pytgcalls/__init__.py,sha256=qbfwN7rYwIdCegMOzdcbvwazeNjDzgmowgcqLFNqKIM,308
2
- pytgcalls/__version__.py,sha256=8dypARODWNROuA9RKrQu-qhkBvB_huvNnTfSYM2smV4,26
2
+ pytgcalls/__version__.py,sha256=bQyjq0CUvIVmXyMKMECcV2-QIaZZRwtmrdC0uwmXqC4,26
3
3
  pytgcalls/environment.py,sha256=ctCHACvG6l8SdpPewSBhOvc70kbwpv18maC0TwLvZ08,1924
4
4
  pytgcalls/exceptions.py,sha256=0MmAktc53ajYAc7ThjD2tJ9PDyibUi0iHZMfUy2IoKs,4109
5
5
  pytgcalls/ffmpeg.py,sha256=tm6DBxyNfPh3h3an-b2s9x1UyX-cvkCdov9prlXxVZY,8649
@@ -27,13 +27,13 @@ pytgcalls/methods/__init__.py,sha256=hk1blAT5u_Isemdrg0nqInLsdRzTTZnak5NdAfkBPAk
27
27
  pytgcalls/methods/calls/__init__.py,sha256=xg4DZZClEnxwaj-DAq3e8gSR-g-MiYBdUEBth64lSXA,214
28
28
  pytgcalls/methods/calls/change_volume_call.py,sha256=viA3yHVxPJ421yE1dfFTh-kNEFTxMlaVFxVjC-PeX-0,719
29
29
  pytgcalls/methods/calls/get_participants.py,sha256=gKUAzvha1RpvbtSI_n-GlBQkOONxzibCaCr4aA17Mag,567
30
- pytgcalls/methods/calls/leave_call.py,sha256=TcUD0UL3VFS_ynmKIeOTw1k1jmJXTBAHQDJRT-OoGck,1426
30
+ pytgcalls/methods/calls/leave_call.py,sha256=ay07za5mNKmXGzmpeU6gJJmHVrLeXRtRmFT4QP94pGA,1475
31
31
  pytgcalls/methods/decorators/__init__.py,sha256=TCGaEVZnHjtOwv-3PNfaCVm0kyFhJApUPUNntt6MwyM,78
32
32
  pytgcalls/methods/decorators/on_update.py,sha256=ZTL4YcQk0N4Ru56a5WItUvkSN5SAqr6_RDZvXmZMIHs,316
33
33
  pytgcalls/methods/stream/__init__.py,sha256=dBx5cqvVyvhqykIuT_2rYCAvIzuPM1J4Hh4sZ083UXU,412
34
34
  pytgcalls/methods/stream/mute_stream.py,sha256=auo2aAazfEC90Ab6MzaiPdddiJ1w4fN_9HaORkAeOBY,570
35
35
  pytgcalls/methods/stream/pause_stream.py,sha256=z_AIWABrQMHmTwvlah_PrH9EjXbro8gKxZni4Km5ICg,573
36
- pytgcalls/methods/stream/play.py,sha256=hcoCCUQBs1_QBIReGxkRKtD48l6RWusJI0DRAOVRaXU,7414
36
+ pytgcalls/methods/stream/play.py,sha256=-Ld5TQWLhU_ktKrb7q1Xrym36UGrWhaenIbjj-3mM3k,7524
37
37
  pytgcalls/methods/stream/record.py,sha256=28mFK2azDv6gUziwcj4ybvrYka9P9VXnUXnuAa1aQ5w,1466
38
38
  pytgcalls/methods/stream/resume_stream.py,sha256=z_DgP4cDExjEqEeX_ZL--50MXQ9lrATK876SIwE71PQ,576
39
39
  pytgcalls/methods/stream/send_frame.py,sha256=Kj9R8OqUM-g7pt-FiWP-US7sCFkH5ciPr9S8v-WPtLg,1062
@@ -45,13 +45,13 @@ pytgcalls/methods/utilities/call_holder.py,sha256=MhIbwCG6DROd9_bHGa6aqu-rB0y4sn
45
45
  pytgcalls/methods/utilities/compose.py,sha256=Nzdv8orMmka5NIBZ1SW1nsqXRzArZl4m6FdZU7syaR4,334
46
46
  pytgcalls/methods/utilities/cpu_usage.py,sha256=Mbga4MFCIwuh7WC8sqBbv1Pa6ALcp5AIDyfYMH_Bix4,162
47
47
  pytgcalls/methods/utilities/idle.py,sha256=MDdzHTv1ws2yBhsvhBUnssGdghkZ2KwR0HUCPOwV38o,814
48
- pytgcalls/methods/utilities/join_presentation.py,sha256=Egh1RpXevzvilKMNEa5Z5Gym9I6WQ7LDeAyLHPuReT4,1448
48
+ pytgcalls/methods/utilities/join_presentation.py,sha256=HLpVjhDkbMB6mIsCwdaGy-Ct7IaV44fM5-zOQ9M7bLU,1551
49
49
  pytgcalls/methods/utilities/log_retries.py,sha256=6nD9J3350t82I0PKzK1pVx3ZaCBHATReiXYMs3PuVhQ,342
50
50
  pytgcalls/methods/utilities/ping.py,sha256=hhIMSHk2BzMB-IKpwLdZFVrsEvGm2ftJwKLs1k4anh8,244
51
51
  pytgcalls/methods/utilities/resolve_chat_id.py,sha256=92x2LHbUlnJMm-kS3fXOYmzYpY2TZbqtQD2rw3eBXDY,382
52
52
  pytgcalls/methods/utilities/run.py,sha256=cnYQd2xB5Cr_WS0Q2cXJZPGiN6JOCULzj1r4xXVyrlg,152
53
53
  pytgcalls/methods/utilities/start.py,sha256=unc-O5XsUztJY7t7wu40F0uSthgq9YutcXRqcTTzhhA,14393
54
- pytgcalls/methods/utilities/stream_params.py,sha256=aQwY8_3ccW0QREQFzVqD0XRkfuAb1wnhkvqFTC9FA7o,2893
54
+ pytgcalls/methods/utilities/stream_params.py,sha256=OE673Bt1CiyCBFQGMPtC05zv3nObP3zirrh4OD9USdg,3109
55
55
  pytgcalls/methods/utilities/update_sources.py,sha256=ISF6u3rk4IcVrPOEOB-uZUDfnwUp2_y1_2g9GboXpWM,1562
56
56
  pytgcalls/mtproto/__init__.py,sha256=X4zvzFG7km7qHyE0fdvA550WcOVO_xl_p__gvIfDGmw,130
57
57
  pytgcalls/mtproto/bridged_client.py,sha256=hktnfpfBK7PEL2n7Y0kBZzI7dkLlsdrDwkYliZki8zQ,5915
@@ -75,7 +75,7 @@ pytgcalls/types/calls/call.py,sha256=n7LW7FRNT2qJzbYC3D312judOlVUuocQ1eW9l9scGCo
75
75
  pytgcalls/types/calls/call_config.py,sha256=b6P43YTGF2t7E2CyD1mSYPJDUBvYYeHoxB3hSbTVyOY,120
76
76
  pytgcalls/types/calls/call_data.py,sha256=-qPj2QhWv32Xs7LyFQY4hiWDqJ21B8VBvdzREK8bDvY,544
77
77
  pytgcalls/types/calls/call_protocol.py,sha256=OVIQs1VgdY-DWbZbNr41hjLA4pGQvHx8Rgom1_NhJxQ,408
78
- pytgcalls/types/calls/call_sources.py,sha256=WVoESOkmCubcMJydbTvIkGmMdrMrsYlhF9aBogKgI40,106
78
+ pytgcalls/types/calls/call_sources.py,sha256=sBhumPgEaN8uAKjBwb1Zf_Ag0qrceti2mURXqMhBusg,107
79
79
  pytgcalls/types/calls/group_call_config.py,sha256=auKH-hZJWj8PhTkyeQ_VK2z9NpNvNC7Scl_IhEUMnQM,353
80
80
  pytgcalls/types/calls/raw_call_update.py,sha256=hpNw6HrTW8Z36Lh2HinS-wzprryRtsIxyIFbIfjGgeI,795
81
81
  pytgcalls/types/chats/__init__.py,sha256=v8pUp_vbr2kQpyHtAQc80N-YqzmXHe9SbllUsa6njkU,261
@@ -99,8 +99,8 @@ pytgcalls/types/stream/record_stream.py,sha256=VEKB2rSnb4U1EyoPdNteWxJ65feV58EGu
99
99
  pytgcalls/types/stream/stream_ended.py,sha256=xR_kZwFf03hA6rw_nvI7Be7GwoCKzQf_1MKaGpPDXqY,716
100
100
  pytgcalls/types/stream/stream_frames.py,sha256=028ZhNV-mN3BGqMlmxusAV1xDQpXRYCeM0WXBZhRUhA,446
101
101
  pytgcalls/types/stream/video_quality.py,sha256=HBfWq005kh-D19MaVE9VzVdnODzrXf4IJUimCfslfiU,231
102
- py_tgcalls-2.1.0rc3.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
103
- py_tgcalls-2.1.0rc3.dist-info/METADATA,sha256=yW3LEGzmHdIhu4iT3WUYcZ-s4oPsyKvP0aSwq1d9eLg,14398
104
- py_tgcalls-2.1.0rc3.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
105
- py_tgcalls-2.1.0rc3.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
106
- py_tgcalls-2.1.0rc3.dist-info/RECORD,,
102
+ py_tgcalls-2.1.0rc4.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
103
+ py_tgcalls-2.1.0rc4.dist-info/METADATA,sha256=H6X5VamKCIuV6ApcU3YNwt8ADVD9FIdBKDxO7-VQA6M,14398
104
+ py_tgcalls-2.1.0rc4.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
105
+ py_tgcalls-2.1.0rc4.dist-info/top_level.txt,sha256=IUDUwn0KkcbUYZbCe9R5AUb2Ob-lmllNUGQqyeXXd8A,10
106
+ py_tgcalls-2.1.0rc4.dist-info/RECORD,,
pytgcalls/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '2.1.0.rc3'
1
+ __version__ = '2.1.0.rc4'
@@ -46,4 +46,5 @@ class LeaveCall(Scaffold):
46
46
  return
47
47
  if chat_id < 0: # type: ignore
48
48
  self._need_unmute.discard(chat_id)
49
+ self._presentations.discard(chat_id)
49
50
  self._call_sources.pop(chat_id, None)
@@ -1,5 +1,6 @@
1
1
  import asyncio
2
2
  import logging
3
+ from pathlib import Path
3
4
  from typing import Optional
4
5
  from typing import Union
5
6
 
@@ -12,6 +13,7 @@ from ntgcalls import TransportParseException
12
13
  from ...exceptions import NoActiveGroupCall
13
14
  from ...exceptions import TimedOutAnswer
14
15
  from ...exceptions import UnMuteNeeded
16
+ from ...media_devices.input_device import InputDevice
15
17
  from ...mtproto_required import mtproto_required
16
18
  from ...mutex import mutex
17
19
  from ...scaffold import Scaffold
@@ -33,7 +35,7 @@ class Play(Scaffold):
33
35
  async def play(
34
36
  self,
35
37
  chat_id: Union[int, str],
36
- stream: Optional[Stream] = None,
38
+ stream: Optional[Union[str, Path, InputDevice, Stream]] = None,
37
39
  config: Optional[Union[CallConfig, GroupCallConfig]] = None,
38
40
  ):
39
41
  chat_id = await self.resolve_chat_id(chat_id)
@@ -12,7 +12,7 @@ class JoinPresentation(Scaffold):
12
12
  join: bool,
13
13
  ):
14
14
  if join:
15
- if chat_id in self._call_sources:
15
+ if chat_id in self._presentations:
16
16
  return
17
17
  for retries in range(4):
18
18
  try:
@@ -32,6 +32,7 @@ class JoinPresentation(Scaffold):
32
32
  True,
33
33
  )
34
34
  await self._wait_connect[chat_id]
35
+ self._presentations.add(chat_id)
35
36
  break
36
37
  except TelegramServerError:
37
38
  if retries == 3:
@@ -42,3 +43,4 @@ class JoinPresentation(Scaffold):
42
43
  elif chat_id in self._call_sources:
43
44
  await self._binding.stop_presentation(chat_id)
44
45
  await self._app.leave_presentation(chat_id)
46
+ self._presentations.discard(chat_id)
@@ -1,3 +1,4 @@
1
+ from pathlib import Path
1
2
  from typing import Optional
2
3
  from typing import Union
3
4
 
@@ -5,6 +6,7 @@ from ntgcalls import AudioDescription
5
6
  from ntgcalls import MediaDescription
6
7
  from ntgcalls import VideoDescription
7
8
 
9
+ from ...media_devices.input_device import InputDevice
8
10
  from ...types import RecordStream
9
11
  from ...types.raw import AudioStream
10
12
  from ...types.raw import Stream
@@ -15,9 +17,11 @@ from ...types.stream.media_stream import MediaStream
15
17
  class StreamParams:
16
18
  @staticmethod
17
19
  async def get_stream_params(
18
- stream: Optional[Stream],
20
+ stream: Optional[Union[str, Path, InputDevice, Stream]],
19
21
  ) -> MediaDescription:
20
22
  if stream is not None:
23
+ if isinstance(stream, (str, Path, InputDevice)):
24
+ stream = MediaStream(stream)
21
25
  if isinstance(stream, MediaStream):
22
26
  await stream.check_stream()
23
27
  elif isinstance(stream, RecordStream):
@@ -1,4 +1,4 @@
1
1
  class CallSources:
2
2
  def __init__(self):
3
3
  self.camera = dict()
4
- self.presentation = dict()
4
+ self.presentation = dict()