From f60271df2d4439f03856e3c9459ccbf3069dac06 Mon Sep 17 00:00:00 2001 From: Tarek Kalaji Date: Sat, 1 Jun 2019 12:54:36 +0300 Subject: [PATCH 1/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d3585a..b8d921b 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ print(b.get_api_version().get_version()) ``` ## Others Example -``` +```python from bigbluebutton_api_python import BigBlueButton b = BigBlueButton('your BBB server url', 'your server credential') From 91254b15a923f8504e79a083b204bc616808cb7f Mon Sep 17 00:00:00 2001 From: Augusto Destrero Date: Sun, 14 Jun 2020 23:57:29 +0200 Subject: [PATCH 2/6] Fix TypeError if there is only one meeting active If there was only one meeting active in the BBB server, an IndexError exception is raised: TypeError: string indices must be integers This patch fixes this error. --- bigbluebutton_api_python/responses/getmeetings.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bigbluebutton_api_python/responses/getmeetings.py b/bigbluebutton_api_python/responses/getmeetings.py index 37967ec..44cda6b 100644 --- a/bigbluebutton_api_python/responses/getmeetings.py +++ b/bigbluebutton_api_python/responses/getmeetings.py @@ -1,5 +1,6 @@ from .base import BaseResponse from ..core.meeting import Meeting +import jxmlease class GetMeetingsResponse(BaseResponse): def get_meetings(self): @@ -11,6 +12,10 @@ def get_meetings(self): except KeyError: pass - for meetingXml in self.get_field("meetings")["meeting"]: - meetings.append(Meeting(meetingXml)) - return meetings \ No newline at end of file + meetings_data = self.get_field("meetings")["meeting"] + if isinstance(meetings_data, jxmlease.dictnode.XMLDictNode): + meetings.append(Meeting(meetings_data)) + else: + for meetingXml in self.get_field("meetings")["meeting"]: + meetings.append(Meeting(meetingXml)) + return meetings From 2bcc9a514b231618c740c72d9fdc7e11fa4a226b Mon Sep 17 00:00:00 2001 From: Big Blue Meeting <64282788+bigbluemeeting@users.noreply.github.com> Date: Sat, 22 Aug 2020 03:41:01 +0500 Subject: [PATCH 3/6] Add timeout of 10 seconds This library does not have a timeout and python does not have a default timeout in the CPython implementation, hence if this gets stuck for some reason and in practice it does get stuck often enough... then it hangs there forever waiting. So we need to time it out eventually. --- bigbluebutton_api_python/bigbluebutton.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigbluebutton_api_python/bigbluebutton.py b/bigbluebutton_api_python/bigbluebutton.py index b300cbf..02b31a5 100644 --- a/bigbluebutton_api_python/bigbluebutton.py +++ b/bigbluebutton_api_python/bigbluebutton.py @@ -132,9 +132,9 @@ def __send_api_request(self, api_call, params={}, data=None): # if data is none, then we send a GET request, if not, then we send a POST request if data is None: - response = urlopen(url).read() + response = urlopen(url, timeout=10).read() else: - response = urlopen(url, data=urlencode(data).encode()).read() + response = urlopen(url, timeout=10, data=urlencode(data).encode()).read() try: rawXml = parse(response)["response"] From e0bbbae59a5661af9c1edb8867177de8aa67c08b Mon Sep 17 00:00:00 2001 From: "kevin.fritsch" Date: Fri, 4 Sep 2020 16:49:10 +0200 Subject: [PATCH 4/6] fixed bugs: - typo at bbbmodule.py - tag at bbbmodule.py - fixed problem, with sending slides --- bigbluebutton_api_python/bigbluebutton.py | 11 +++++++---- bigbluebutton_api_python/parameters/bbbmodule.py | 6 ++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/bigbluebutton_api_python/bigbluebutton.py b/bigbluebutton_api_python/bigbluebutton.py index 02b31a5..52d79f0 100644 --- a/bigbluebutton_api_python/bigbluebutton.py +++ b/bigbluebutton_api_python/bigbluebutton.py @@ -19,14 +19,13 @@ from jxmlease import parse from hashlib import sha1 if sys.version_info[0] == 2: - from urllib import urlencode, urlopen + from urllib import urlencode, urlopen, Request from urllib import quote else: - from urllib.request import urlopen + from urllib.request import Request, urlopen from urllib.parse import urlencode from urllib.request import quote - class BigBlueButton: def __init__(self, bbbServerBaseUrl, securitySalt): @@ -134,7 +133,11 @@ def __send_api_request(self, api_call, params={}, data=None): if data is None: response = urlopen(url, timeout=10).read() else: - response = urlopen(url, timeout=10, data=urlencode(data).encode()).read() + if isinstance(data, str): + request = Request(url, data=bytes(data, "utf8"), headers={'Content-Type': 'application/xml'}) + response = urlopen(request, timeout=10).read() + else: + response = urlopen(url, timeout=10, data=urlencode(data).encode()).read() try: rawXml = parse(response)["response"] diff --git a/bigbluebutton_api_python/parameters/bbbmodule.py b/bigbluebutton_api_python/parameters/bbbmodule.py index 20df5e2..489503e 100644 --- a/bigbluebutton_api_python/parameters/bbbmodule.py +++ b/bigbluebutton_api_python/parameters/bbbmodule.py @@ -14,7 +14,7 @@ def __init__(self): def add_slide(self, type, value, name = None): if type == self.URL: self.__urls.append(value) - elif type == self.files: + elif type == self.FILE: self.__files.append(value) elif type == self.base64s: self.__base64s.append([name, value]) @@ -45,5 +45,7 @@ def __slides_to_xml(self): with open(single_file, 'r') as f: xml += base64.encodestring(f.read()) xml += "" + + xml += "" - return xml \ No newline at end of file + return xml From eeb883b62ccbcb889b4fa923278bf2ba64159c68 Mon Sep 17 00:00:00 2001 From: "Ignacio J. Ortega" Date: Mon, 4 Jan 2021 11:51:07 +0100 Subject: [PATCH 5/6] [UPD] Added another way to install in README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index b8d921b..ea802ea 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,12 @@ The project has been uploaded to pypi, and you can view the library from [here]( pip install bigbluebutton_api_python ``` +You can also install the latest from this repo with +```shell +pip install git+git://github.com/101t/bigbluebutton-api-python.git +``` + + ## Example Example to use the library: ```python From a82436942f5c3dc783ee91e6fb34d962c6eab7a8 Mon Sep 17 00:00:00 2001 From: "Ignacio J. Ortega" Date: Mon, 4 Jan 2021 16:26:42 +0100 Subject: [PATCH 6/6] [BUG] wrong imports for 2.7 --- bigbluebutton_api_python/bigbluebutton.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigbluebutton_api_python/bigbluebutton.py b/bigbluebutton_api_python/bigbluebutton.py index 52d79f0..84eb212 100644 --- a/bigbluebutton_api_python/bigbluebutton.py +++ b/bigbluebutton_api_python/bigbluebutton.py @@ -19,8 +19,8 @@ from jxmlease import parse from hashlib import sha1 if sys.version_info[0] == 2: - from urllib import urlencode, urlopen, Request - from urllib import quote + from urllib2 import urlopen ,Request + from urllib import quote,urlencode else: from urllib.request import Request, urlopen from urllib.parse import urlencode