Commit 9726a49a authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files


#!/usr/bin/env python3
import argparse
import os.path
import xml.etree.ElementTree as ET
from pathlib import Path
import requests
from tqdm import tqdm
parser = argparse.ArgumentParser(description='Get video(s) from BBB')
parser.add_argument('--meeting', default='e95c2bd3e4e7ee81bd53eaae33f147b86f5c8384-1593758725366')
parser.add_argument('--server', default='')
'captions.json', 'cursor.xml', 'deskshare.xml', 'metadata.xml', 'panzooms.xml', 'presentation_text.json',
'shapes.svg', 'slides_new.xml', 'presentation/deskshare.png', 'presentation/logo.png', 'video/webcams.webm'
def download_from_url(url, dst):
file_size = int(requests.head(url).headers["Content-Length"])
first_byte = os.path.getsize(dst) if os.path.exists(dst) else 0
if first_byte >= file_size:
return file_size
header = {"Range": "bytes=%s-%s" % (first_byte, file_size)}
pbar = tqdm(total=file_size, initial=first_byte, unit='B', unit_scale=True, desc=url.split('/')[-1])
resp = requests.get(url, headers=header, stream=True)
with'ab') as fileh:
for chunk in resp.iter_content(chunk_size=1024**2):
if chunk:
return file_size
def download(server, meeting):
# playback = f'https://{server}/playback/presentation/2.0/playback.html'
path = Path('data') / meeting
if path.exists():
print('error: you already downloaded this one.')
for dirname in ['presentation', 'video']:
(path / dirname).mkdir(parents=True)
for filename in FILES:
download_from_url(f'https://{server}/presentation/{meeting}/{filename}', path / filename)
for child in ET.parse(f'data/{meeting}/shapes.svg').getroot():
if child.attrib['class'] == 'slide':
filename = child.attrib['{}href']
filepath = path / filename
if not filepath.parent.exists():
download_from_url(f'https://{server}/presentation/{meeting}/{filename}', filepath)
if __name__ == '__main__':
args = parser.parse_args()
download(server=args.server, meeting=args.meeting)
This diff is collapsed.
name = "bbb2vid"
version = "0.1.0"
description = "export a BBB presentation to a single video"
authors = ["Guilhem Saurel <>"]
license = "BSD-2-Clause"
python = "^3.6"
requests = "^2.24.0"
tqdm = "^4.49.0"
svglib = "^1.0.1"
ipython = "^7.16"
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment