plugorgau / bbb-render

Scripts to convert a BigBlueButton recording into a single video file
MIT License
64 stars 26 forks source link

make-xges fails - 'NoneType' object has no attribute 'text' #1

Closed mayeulk closed 4 years ago

mayeulk commented 4 years ago

Hi, I'm launching this on ubuntu 20.04 and python 3.8.2:

 mkdir -p /home/mk/temp/video_conf_cybis/7ter_fr_10juillet; ./download.py http://scalelite.univ-grenoble-alpes.fr/playback/presentation/2.0/playback.html?meetingId=faf5e-hidden_ID  /home/mk/temp/video_conf_cybis/7ter_fr_10juillet
./make-xges.py /home/mk/temp/video_conf_cybis/7ter_fr_10juillet presentation_7ter_fr_10juillet.xges

The download works fine. However, make-xges.py fails with:

Traceback (most recent call last):
  File "./make-xges.py", line 248, in <module>
    sys.exit(main(sys.argv))
  File "./make-xges.py", line 243, in main
    p = Presentation(opts)
  File "./make-xges.py", line 38, in __init__
    self.set_project_metadata()
  File "./make-xges.py", line 140, in set_project_metadata
    GES.MetaFlag.READWRITE, 'name', name.text.strip())
AttributeError: 'NoneType' object has no attribute 'text'

Thanks for any help. Mayeul

mayeulk commented 4 years ago

Hi, A workaround to this bug in my case is to replace in file "./make-xges.py", line 140, the following:

GES.MetaFlag.READWRITE, 'name', name.text.strip()) By this: GES.MetaFlag.READWRITE, 'name', 'test') Here, I use 'test' to understand where it goes. In the output, the top of the file becomes:

<ges version='0.1'>
  <project properties='properties;' metadatas='metadatas, name=(string)test;'>

I'm not sure but maybe the code was meant to get some metadatas, and when this task fails (maybe because the BBB server is configured differently), the script breaks. If this is correct, I'd suggest adding a test here; in the absence of metadata, a placeholder text or an empty string such as "" would be save. Additional note, I'm a bit surprised by the xml output; I'd guess something like this is expected:

<ges version='0.1'>
  <project properties='properties;' metadatas='metadatas', name='test;'>

Mayeul

jhenstridge commented 4 years ago

Thanks for the bug report. The code in question is purely cosmetic: it affects some defaults in Pitivi, but isn't really relevant if you just want to render a video. So substituting in a dummy value is absolutely okay.

The code is looking for the a <name> element within the <meta> section of the metadata.xml file downloaded by the first script. While I see it in the recordings from the PLUG server, it looks like it isn't always present. I'm not sure if this is down to BBB versions, or the actions of the room owner.

I'll update the script to skip setting the project name if the element is missing.