Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature : Choose which Recordings to be exported (bbb-origin-server) #69

Open
gpallaris opened this issue Jan 14, 2022 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@gpallaris
Copy link

gpallaris commented Jan 14, 2022

I am trying to add an option to choose which Recordings to be exported as mp4.

The idea is to read "events.xml" file,check its origin eg. Greenlight, Moodle1, Moodle2, Wordpress1 etc and export mp4 for all the origins except ones from "Greenlight". Please advise.

My Edits at "presentation.rb" :

require File.expand_path('../../../lib/recordandplayback', FILE)
require File.expand_path('../../../lib/recordandplayback/interval_tree', FILE)

include IntervalTree

opts = Optimist.options do
opt :meeting_id, 'Meeting id to archive', type: String
opt :format, 'Playback format name', type: String
opt :log_stdout, 'Log to STDOUT', type: :flag
end

meeting_id = opts[:meeting_id]
playback = opts[:format]

exit(0) if playback != 'presentation'

#####BEGIN OF CHECK XXXXXXXX#####
meeting_metadata = BigBlueButton::Events.get_meeting_metadata("/var/bigbluebutton/recording/raw/#{meeting_id}/events.xml")

File.open("/var/bigbluebutton/recording/raw/#{meeting_id}/events.xml") do |f|
f.each_line do |line|
if line =~ /greenlight/
exit(0)
end
#####END OF CHECK XXXXXXXX#####

REST OF THE CODE

@hostbbb
Copy link

hostbbb commented Jan 14, 2022

https://github.com/danielpetri1/bbb-recording-exporter/blob/main/presentation.rb#L839

look a few lines below. you can get the origin without looping thru the raw events.
look for origin in metadata
meeting_name = metadata.xpath('recording/meta/meetingName').inner_text

example of getting the name, just need to modify and get the bb-origin-server

@gpallaris
Copy link
Author

thanks a lot @hostbbb .

For anyone is interested to execute @danielpetri1 script for specific recordings only (based on server origin) add the following code in presentation.rb below [exit(0) if playback != 'presentation']

########################################################################
@published_files_origin_check = "/var/bigbluebutton/published/presentation/#{meeting_id}"

metadata = Nokogiri::XML(File.open("#{@published_files_origin_check}/metadata.xml"))
origin_server = metadata.xpath('recording/meta/bbb-origin-server-name').inner_text

exit(0) if origin_server != 'SERVER ORIGIN'
########################################################################

@danielpetri1 danielpetri1 added the enhancement New feature or request label Jan 14, 2022
@danielpetri1
Copy link
Owner

Hi @gpallaris, thanks for the suggestion. Thanks @hostbbb for suggesting a solution.

I'll leave it open since this could potentially be introduced as a CLI option.

Cheers!

@gpallaris
Copy link
Author

Excellent work @danielpetri1 ! Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants