1
0
Fork 0
mirror of https://github.com/Findus23/BBBtoVideo.git synced 2024-09-19 14:03:44 +02:00
BBBtoVideo/metadata.py

15 lines
457 B
Python
Raw Permalink Normal View History

2020-11-05 19:49:59 +01:00
from datetime import datetime
from pathlib import Path
from xml.etree import ElementTree
class Metadata:
def __init__(self, xml_file: Path):
tree = ElementTree.parse(xml_file)
root = tree.getroot()
self.meetingName = root.find("./meta/meetingName").text
self.starttime = datetime.fromtimestamp(int(root.find("./start_time").text) / 1000)
self.duration = int(int(root.find("./playback/duration").text)) / 1000