From 393dd3ee690ef70cd9223fead75cb52196fbc43c Mon Sep 17 00:00:00 2001 From: nathom Date: Sat, 27 Mar 2021 13:34:02 -0700 Subject: [PATCH] Fixed bug where os.path.isfile(None) is called --- streamrip/cli.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/streamrip/cli.py b/streamrip/cli.py index 86c2eee..623df0c 100644 --- a/streamrip/cli.py +++ b/streamrip/cli.py @@ -53,11 +53,12 @@ def cli(ctx, **kwargs): logger.debug(f"handling {kwargs['urls']}") core.handle_urls(kwargs["urls"]) - if os.path.isfile(kwargs['text']): - logger.debug(f"Handling {kwargs['text']}") - core.handle_txt(kwargs['text']) - elif kwargs['txt'] is not None: - click.secho(f"Text file {kwargs['text']} does not exist.") + if kwargs['text'] is not None: + if os.path.isfile(kwargs['text']): + logger.debug(f"Handling {kwargs['text']}") + core.handle_txt(kwargs['text']) + else: + click.secho(f"Text file {kwargs['text']} does not exist.") if ctx.invoked_subcommand is None: core.download()