inspect_jitsi.sync package#
Submodules#
Module contents#
Synchronous, one-shot convenience functions built on inspect_jitsi.xmpp.
- inspect_jitsi.sync.diagnose_jitsi_access(conference_url, timeout=10)[source]
Probe a Jitsi deployment and report what's needed to read occupant counts.
See
inspect_jitsi.xmpp.JitsiConference.diagnose()for details.- Return type:
- inspect_jitsi.sync.get_participant_count(conference_url, nick=None, name=None, anonymous_domain=None, muc_domain=None, timeout=10)[source]
Return the number of participants currently in a Jitsi Meet room.
- Parameters:
conference_url (
str) – e.g. "https://meet.example.com/SomeRoomName".nick (
str|None) – the MUC nickname to join under. Random if not given.name (
str|None) – the display name (XEP-0172) to disclose when joining. No display name is disclosed if not given.anonymous_domain (
str|None) – override the XMPP domain used for stream/login. Auto-discovered from the site's /config.js if not given.muc_domain (
str|None) – override the MUC component domain (e.g. "muc.meet.jitsi" or "conference.example.com"). Auto-discovered if not given.timeout (
float) – seconds to wait for each network step.
- Return type:
- Returns:
Number of people already in the room, not counting this probe (0 if the room is empty).
- Raises:
inspect_jitsi.xmpp.JitsiConnectionError – the XMPP connection failed or was lost (refused, dropped, timed out, or an unparseable server response).
- inspect_jitsi.sync.get_participants(conference_url, nick=None, name=None, anonymous_domain=None, muc_domain=None, timeout=10)[source]
Return the participants currently in a Jitsi Meet room.
- Parameters:
conference_url (
str) – e.g. "https://meet.example.com/SomeRoomName".nick (
str|None) – the MUC nickname to join under. Random if not given.name (
str|None) – the display name (XEP-0172) to disclose when joining. No display name is disclosed if not given.anonymous_domain (
str|None) – override the XMPP domain used for stream/login. Auto-discovered from the site's /config.js if not given.muc_domain (
str|None) – override the MUC component domain (e.g. "muc.meet.jitsi" or "conference.example.com"). Auto-discovered if not given.timeout (
float) – seconds to wait for each network step.
- Return type:
- Returns:
The participants already in the room, not counting this probe (empty if the room is empty).
- Raises:
inspect_jitsi.xmpp.JitsiConnectionError – the XMPP connection failed or was lost (refused, dropped, timed out, or an unparseable server response).
- inspect_jitsi.sync.is_room_created(conference_url, anonymous_domain=None, muc_domain=None, timeout=10)[source]
Return whether a Jitsi Meet room currently exists, without joining it.
- Parameters:
conference_url (
str) – e.g. "https://meet.example.com/SomeRoomName".anonymous_domain (
str|None) – override the XMPP domain used for stream/login. Auto-discovered from the site's /config.js if not given.muc_domain (
str|None) – override the MUC component domain (e.g. "muc.meet.jitsi" or "conference.example.com"). Auto-discovered if not given.timeout (
float) – seconds to wait for each network step.
- Raises:
inspect_jitsi.xmpp.JitsiConnectionError – the XMPP connection failed or was lost (refused, dropped, timed out, or an unparseable server response) - not raised for a room that simply doesn't exist, which is reported as False.
- Return type:
- inspect_jitsi.sync.monitor_room(conference_url, nick=None, name=None, anonymous_domain=None, muc_domain=None, timeout=60, connect_timeout=10, create=False, stay=False)[source]
Yield the state of a Jitsi Meet room whenever it changes, until it is closed.
This is what
inspect-jitsi monitorprints, one dict per JSON line:for state in monitor_room("https://meet.example.com/SomeRoomName"): print(state["status"], len(state["participants"]))
Each dict has the keys
room,participants(a list, in the order they joined) andstatus(openandattempts). The first one is yielded once connected; the last one hasstatus["open"]false. Reconnecting after a lost connection only increasesstatus["attempts"].- Parameters:
conference_url (
str) – e.g. "https://meet.example.com/SomeRoomName".nick (
str|None) – the MUC nickname to join under. Random if not given.name (
str|None) – the display name (XEP-0172) to disclose when joining. No display name is disclosed if not given.anonymous_domain (
str|None) – override the XMPP domain used for stream/login. Auto-discovered from the site's /config.js if not given.muc_domain (
str|None) – override the MUC component domain. Auto-discovered if not given.timeout (
float) – seconds to keep trying to reconnect after the connection is lost, before giving up. 0 disables reconnecting.connect_timeout (
float) – seconds to wait for each network step.create (
bool) – join the room even if it does not exist, which creates it on deployments that let anyone create rooms. Otherwise a room that does not exist is reported as closed, without joining it.stay (
bool) – keep monitoring when nobody else is in the room. Otherwise the room counts as closed - and the monitor leaves it - as soon as the monitor is the only one left in it.
- Raises:
ValueError – the conference URL cannot be parsed.
inspect_jitsi.xmpp.JitsiConnectionError – the first connection failed, or the connection was lost and could not be re-established within
timeoutseconds.
- Return type: