Skip to content

Commit 7c63d31

Browse files
committed
Add meeting support
1 parent 5416008 commit 7c63d31

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed

videodb/_constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ class ApiPath:
8181
translate = "translate"
8282
dub = "dub"
8383
transcode = "transcode"
84+
meeting = "meeting"
85+
record = "record"
8486

8587

8688
class Status:

videodb/client.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,44 @@ def upload(
290290
return Audio(self, **upload_data)
291291
elif media_id.startswith("img-"):
292292
return Image(self, **upload_data)
293+
294+
def record_meeting(
295+
self,
296+
link: str,
297+
bot_name: str,
298+
meeting_name: str,
299+
callback_url: str,
300+
time_zone: str = "UTC",
301+
) -> dict:
302+
"""Record a meeting and upload it to the default collection.
303+
304+
:param str link: Meeting link
305+
:param str bot_name: Name of the recorder bot
306+
:param str meeting_name: Name of the meeting
307+
:param str callback_url: URL to receive callback once recording is done
308+
:param str time_zone: Time zone for the meeting (default ``UTC``)
309+
:return: Response data from the API
310+
:rtype: dict
311+
"""
312+
313+
response = self.post(
314+
path=f"{ApiPath.collection}/default/{ApiPath.meeting}/{ApiPath.record}",
315+
data={
316+
"link": link,
317+
"bot_name": bot_name,
318+
"meeting_name": meeting_name,
319+
"callback_url": callback_url,
320+
"time_zone": time_zone,
321+
},
322+
)
323+
return response
324+
325+
def get_meeting_info(self, bot_id: str) -> dict:
326+
"""Get the information of a given meeting bot.
327+
328+
:param str bot_id: ID returned when recording was initiated
329+
:return: Information of the meeting bot
330+
:rtype: dict
331+
"""
332+
333+
return self.get(path=f"{ApiPath.collection}/default/{ApiPath.meeting}/{bot_id}")

videodb/collection.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,3 +484,45 @@ def make_private(self):
484484
path=f"{ApiPath.collection}/{self.id}", data={"is_public": False}
485485
)
486486
self.is_public = False
487+
488+
def record_meeting(
489+
self,
490+
link: str,
491+
bot_name: str,
492+
meeting_name: str,
493+
callback_url: str,
494+
time_zone: str = "UTC",
495+
) -> dict:
496+
"""Record a meeting and upload it to this collection.
497+
498+
:param str link: Meeting link
499+
:param str bot_name: Name of the recorder bot
500+
:param str meeting_name: Name of the meeting
501+
:param str callback_url: URL to receive callback once recording is done
502+
:param str time_zone: Time zone for the meeting (default ``UTC``)
503+
:return: Response data from the API
504+
:rtype: dict
505+
"""
506+
507+
return self._connection.post(
508+
path=f"/collection/{self.id}/{ApiPath.meeting}/{ApiPath.record}",
509+
data={
510+
"link": link,
511+
"bot_name": bot_name,
512+
"meeting_name": meeting_name,
513+
"callback_url": callback_url,
514+
"time_zone": time_zone,
515+
},
516+
)
517+
518+
def get_meeting_info(self, bot_id: str) -> dict:
519+
"""Get the recording info for a meeting bot in this collection.
520+
521+
:param str bot_id: ID returned when recording was initiated
522+
:return: Information of the meeting bot
523+
:rtype: dict
524+
"""
525+
526+
return self._connection.get(
527+
path=f"{ApiPath.collection}/{self.id}/{ApiPath.meeting}/{bot_id}"
528+
)

0 commit comments

Comments
 (0)