Loading lostmediafinder/__main__.py +6 −8 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ None of this is public API! import asyncio import click from switch import Switch from . import YouTubeResponse Loading @@ -32,10 +31,9 @@ def youtube(ctx, id: str, format: str) -> int: response = asyncio.run(YouTubeResponse.generate(id)) if response.status == "bad.id": raise ValueError("Bad video ID - does not match regex") with Switch(format) as case: if case("json"): if format == "json": click.echo(response.json()) elif case("text"): elif format == "text": click.echo(str(response).strip()) else: raise AssertionError("This should never occur!") Loading Loading
lostmediafinder/__main__.py +6 −8 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ None of this is public API! import asyncio import click from switch import Switch from . import YouTubeResponse Loading @@ -32,10 +31,9 @@ def youtube(ctx, id: str, format: str) -> int: response = asyncio.run(YouTubeResponse.generate(id)) if response.status == "bad.id": raise ValueError("Bad video ID - does not match regex") with Switch(format) as case: if case("json"): if format == "json": click.echo(response.json()) elif case("text"): elif format == "text": click.echo(str(response).strip()) else: raise AssertionError("This should never occur!") Loading