From 934ff8ee3442fe94a923fcbb2d4dd87238676f80 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 24 Jun 2021 19:46:18 +0200 Subject: [PATCH 1/2] Don't crash if RTMP is not passed Because we use it also just for recording and not only streaming. Right now we pass something like https://fakeurl as workaround but is not so good to get printed this in the BBB chat. --- stream.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/stream.py b/stream.py index dafd7bf..19f2778 100644 --- a/stream.py +++ b/stream.py @@ -149,12 +149,17 @@ def bbb_browser(): if element.is_enabled() and chat_send.is_enabled(): tmp_chatMsg = os.environ.get('BBB_CHAT_MESSAGE', "This meeting is streamed to") if not tmp_chatMsg in [ 'false', 'False', 'FALSE' ]: - tmp_chatUrl = args.target.partition('//')[2].partition('/')[0] - if args.chatUrl: - tmp_chatUrl = args.chatUrl - if args.chatMsg: - tmp_chatMsg = ' '.join(args.chatMsg).strip('"') - element.send_keys("{0}: {1}".format(tmp_chatMsg, tmp_chatUrl)) + if args.target is not None: + tmp_chatUrl = args.target.partition('//')[2].partition('/')[0] + if args.chatUrl: + tmp_chatUrl = args.chatUrl + if args.chatMsg: + tmp_chatMsg = ' '.join(args.chatMsg).strip('"') + element.send_keys("{0}: {1}".format(tmp_chatMsg, tmp_chatUrl)) + else: + tmp_chatMsg = "Recording in progress!" + element.send_keys(tmp_chatMsg) + chat_send.click() if args.chat: From 3d333687b6a20a8d3f09ef6acd786e96b305123f Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Mon, 28 Jun 2021 13:03:42 +0200 Subject: [PATCH 2/2] custom message in chat on recording --- stream.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stream.py b/stream.py index 19f2778..6ff1efb 100644 --- a/stream.py +++ b/stream.py @@ -148,6 +148,7 @@ def bbb_browser(): # ensure chat is enabled (might be locked by moderator) if element.is_enabled() and chat_send.is_enabled(): tmp_chatMsg = os.environ.get('BBB_CHAT_MESSAGE', "This meeting is streamed to") + tmp_chatCustomMsg = os.environ.get('BBB_CHAT_CUSTOM_MESSAGE', "This meeting is streamed to") if not tmp_chatMsg in [ 'false', 'False', 'FALSE' ]: if args.target is not None: tmp_chatUrl = args.target.partition('//')[2].partition('/')[0] @@ -155,11 +156,13 @@ def bbb_browser(): tmp_chatUrl = args.chatUrl if args.chatMsg: tmp_chatMsg = ' '.join(args.chatMsg).strip('"') - element.send_keys("{0}: {1}".format(tmp_chatMsg, tmp_chatUrl)) + tmp_chatMsg = "{0}: {1}".format(tmp_chatMsg, tmp_chatUrl) + else if tmp_chatCustomMsg != '': + tmp_chatMsg = tmp_chatCustomMsg else: tmp_chatMsg = "Recording in progress!" - element.send_keys(tmp_chatMsg) + element.send_keys(tmp_chatMsg) chat_send.click() if args.chat: