Skip to content
Snippets Groups Projects
Commit dd7d7801 authored by Martin Schrott's avatar Martin Schrott
Browse files

fixed bug in getMeetings when more than one meeting was running

parent ce71ea56
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
### to use this script you will need to ###
# apt install pip3
# pip3 install bigbluebutton_api_python
# pip3 install pyyaml
import argparse, sys, os, logging, yaml, urllib, json import argparse, sys, os, logging, yaml, urllib, json
from bigbluebutton_api_python import BigBlueButton from bigbluebutton_api_python import BigBlueButton
...@@ -8,7 +13,7 @@ logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO")) ...@@ -8,7 +13,7 @@ logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO"))
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("-s","--server", help="Big Blue Button Server URL") parser.add_argument("-s","--server", help="Big Blue Button Server URL")
parser.add_argument("-c","--config", help="path to config file in yaml format e.g. your docker-compose.yml", default="../docker-compose.yml") parser.add_argument("-c","--config", help="path to config file in yaml format e.g. your docker-compose.yml", default="./docker-compose.yml")
parser.add_argument("-p","--secret", help="Big Blue Button Secret") parser.add_argument("-p","--secret", help="Big Blue Button Secret")
args = parser.parse_args() args = parser.parse_args()
...@@ -41,10 +46,17 @@ if not args.server and not args.secret: ...@@ -41,10 +46,17 @@ if not args.server and not args.secret:
sys.exit() sys.exit()
bbb = BigBlueButton(args.server,args.secret) bbb = BigBlueButton(args.server,args.secret)
meetings = get_meetings() meetingsXML = get_meetings()
for meeting in meetings['xml']['meetings']: rawMeetings = meetingsXML['xml']['meetings']['meeting']
print(meetings['xml']['meetings'][meeting]['meetingName']) meetings = []
print("ID: {}".format(meetings['xml']['meetings'][meeting]['meetingID'])) if isinstance(rawMeetings, list):
print("ATTENDEE_PASSWORD: {}".format(meetings['xml']['meetings'][meeting]['attendeePW'])) meetings = rawMeetings
print("MODERATOR_PASSWORD: {}".format(meetings['xml']['meetings'][meeting]['moderatorPW'])) else:
meetings.append(rawMeetings)
for meeting in meetings:
print(meeting['meetingName'])
print("ID: {}".format(meeting['meetingID']))
print("ATTENDEE_PASSWORD: {}".format(meeting['attendeePW']))
print("MODERATOR_PASSWORD: {}".format(meeting['moderatorPW']))
print("") print("")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment