Add scrape option

Signed-off-by: nathom <nathanthomas707@gmail.com>
This commit is contained in:
nathom 2021-07-09 14:19:13 -07:00
parent e6dfc3f507
commit 5cd3913976
2 changed files with 12 additions and 0 deletions

View file

@ -193,6 +193,9 @@ def search(ctx, **kwargs):
@cli.command()
@click.option("-l", "--list", default="ideal-discography")
@click.option(
"-s", "--scrape", is_flag=True, help="Download all of the items in a list."
)
@click.pass_context
def discover(ctx, **kwargs):
"""Search for albums in Qobuz's featured lists.
@ -228,6 +231,7 @@ def discover(ctx, **kwargs):
* universal-jeunesse
* universal-chanson
"""
from streamrip.constants import QOBUZ_FEATURED_KEYS
@ -235,6 +239,11 @@ def discover(ctx, **kwargs):
kwargs["list"] in QOBUZ_FEATURED_KEYS
), f"Invalid featured key {kwargs['list']}"
if kwargs["scrape"]:
core.scrape(kwargs["list"])
core.download()
return
if core.interactive_search(kwargs["list"], "qobuz", "featured"):
core.download()
else: