From f9e37a49bf401df02a03430e4cd6ee3b08a6e6f1 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 4 Nov 2020 00:20:08 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Skip=20unavailable=20video?= =?UTF-8?q?s=20in=20sync=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbbdl/__main__.py | 2 ++ bbbdl/resources.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/bbbdl/__main__.py b/bbbdl/__main__.py index 6dc7013..a3278d6 100644 --- a/bbbdl/__main__.py +++ b/bbbdl/__main__.py @@ -59,6 +59,8 @@ def sync(ctx: click.Context, file=None, remote_file=None, overwrite=False, verbo ctx.invoke(download, input_url=input_url, output_file=output_file, overwrite=overwrite, verbose_ffmpeg=verbose_ffmpeg) except click.ClickException: click.echo(f"Skipped: {input_url} -> {output_file}", err=True) + except requests.HTTPError as e: + click.echo(f"Not available: {input_url} -> HTTP {e.response.status_code}") if __name__ == "__main__": diff --git a/bbbdl/resources.py b/bbbdl/resources.py index b147aa2..f2410fe 100644 --- a/bbbdl/resources.py +++ b/bbbdl/resources.py @@ -46,6 +46,9 @@ class Meeting: @classmethod def from_base_url(cls, base_url: str, meeting_id: str) -> Meeting: + r = requests.get(f"{base_url}/presentation/{meeting_id}/metadata.xml") + r.raise_for_status() + deskshare = Resource(href=f"{base_url}/presentation/{meeting_id}/deskshare/deskshare.webm") webcams = Resource(href=f"{base_url}/presentation/{meeting_id}/video/webcams.mp4")