mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-17 08:35:08 -04:00
Added support for txt files as input
This commit is contained in:
parent
3182660338
commit
b3eb914e60
3 changed files with 18 additions and 12 deletions
|
@ -21,6 +21,7 @@ if not os.path.isdir(CACHE_DIR):
|
|||
@click.group(invoke_without_command=True)
|
||||
@click.option("-c", "--convert", metavar="CODEC")
|
||||
@click.option("-u", "--urls", metavar="URLS")
|
||||
@click.option("-t", "--text", metavar='PATH')
|
||||
@click.option("-nd", "--no-db", is_flag=True)
|
||||
@click.option("--debug", is_flag=True)
|
||||
@click.option("--reset-config", is_flag=True)
|
||||
|
@ -52,6 +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 ctx.invoked_subcommand is None:
|
||||
core.download()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue