mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-13 06:34:45 -04:00
Specify downloads directory and config path in args
This commit is contained in:
parent
69ba9f6aa6
commit
6719676b6e
1 changed files with 10 additions and 3 deletions
13
rip/cli.py
13
rip/cli.py
|
@ -62,7 +62,8 @@ class DownloadCommand(Command):
|
||||||
"-i",
|
"-i",
|
||||||
description="Download items even if they have been logged in the database.",
|
description="Download items even if they have been logged in the database.",
|
||||||
),
|
),
|
||||||
option("config.*", description="Change configuration options"),
|
option("config", description="Path to config file.", flag=False),
|
||||||
|
option("directory", "-d", "Directory to download items into.", flag=False),
|
||||||
]
|
]
|
||||||
|
|
||||||
help = (
|
help = (
|
||||||
|
@ -82,14 +83,20 @@ class DownloadCommand(Command):
|
||||||
update_check = threading.Thread(target=is_outdated, daemon=True)
|
update_check = threading.Thread(target=is_outdated, daemon=True)
|
||||||
update_check.start()
|
update_check.start()
|
||||||
|
|
||||||
config = Config()
|
path, codec, quality, no_db, directory, config = clean_options(
|
||||||
path, codec, quality, no_db = clean_options(
|
|
||||||
self.option("file"),
|
self.option("file"),
|
||||||
self.option("codec"),
|
self.option("codec"),
|
||||||
self.option("max-quality"),
|
self.option("max-quality"),
|
||||||
self.option("ignore-db"),
|
self.option("ignore-db"),
|
||||||
|
self.option("directory"),
|
||||||
|
self.option("config"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
config = Config(config)
|
||||||
|
|
||||||
|
if directory is not None:
|
||||||
|
config.session["downloads"]["folder"] = directory
|
||||||
|
|
||||||
if no_db:
|
if no_db:
|
||||||
config.session["database"]["enabled"] = False
|
config.session["database"]["enabled"] = False
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue