bbb-download icon indicating copy to clipboard operation
bbb-download copied to clipboard

Python3 Update and Notification Email

Open softpoint-consultores opened this issue 5 years ago • 3 comments

Hi,

With this pull request, you can use Python3 instead of Python2. The system is tested on BigBlueButton 2.2.19 Also now it uses the standard logging system (import logging).

Finally we added the option to send notification emails (configurable to the users), so they can receive the link whenever it is ready.

softpoint-consultores avatar Jul 02 '20 09:07 softpoint-consultores

@fernaper What are some example placeholder values for the following variables?

MAINTAINER = ''
API_GET_RECEIVERS = ''
API_USER = ''

alexanderlhk avatar Oct 13 '20 02:10 alexanderlhk

Hi @alexanderlhk Thank you for being interested.

MAINTAINER is an email, for example "[email protected]". It is usefull to capture exceptions and fix possible bugs. API_GET_RECEIVERS is an entrypoint to our custom API, we need it to know the email to send the recording. API_USER and API_PASS are the Basic Authentication credentials to connect our API_GET_RECEIVERS entrypoint.

To integrate that part, it will be necessary to change code from download.py from line 372 with the next code (or something similar):

        if config.SEND_EMAIL:
            try:
                url = 'https://{dns}/download/presentation/{meetingId}/{meetingId}.mp4 '.format(
                    dns=config.DNS,
                    meetingId=meetingId
                )

                language_to_users = {
                    config.LANGUAGE: config.ALERT_RECEIVERS
                }

                for language, users in language_to_users.items():
                    mail_header = get_mail_header(config.COMPANY, language=language)
                    mail_body = get_mail_body(url, language=language)

                    sendmail(mail_header, html_email('', mail_body), receivers=users)
            except Exception as e:
                mail_body = 'Exception: {}'.format(e)

                sendmail('[RECORDING EXCEPTION] {}'.format(config.COMPANY),
                            html_email('', mail_body),
                            receivers=[config.MAINTAINER]
                )

        if logger.level > logging.DEBUG:
            time.sleep(5)
            logger.info('Cleaning up temp files...')
            cleanup()
            logger.info('Done')


if __name__ == '__main__':
    main()

fernaper avatar Oct 13 '20 06:10 fernaper

I see, I would like to try it out and see what can be done to improve it as well.

So what do we pass in "API_GET_RECEIVERS"? @fernaper

Or are we leaving that blank so that the function can store the response?

Edit: I understood what it does. still trying to. configure it...

alexanderlhk avatar Oct 13 '20 08:10 alexanderlhk