mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-15 07:34:48 -04:00
Add scrape option
Signed-off-by: nathom <nathanthomas707@gmail.com>
This commit is contained in:
parent
e6dfc3f507
commit
5cd3913976
2 changed files with 12 additions and 0 deletions
|
@ -193,6 +193,9 @@ def search(ctx, **kwargs):
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.option("-l", "--list", default="ideal-discography")
|
@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
|
@click.pass_context
|
||||||
def discover(ctx, **kwargs):
|
def discover(ctx, **kwargs):
|
||||||
"""Search for albums in Qobuz's featured lists.
|
"""Search for albums in Qobuz's featured lists.
|
||||||
|
@ -228,6 +231,7 @@ def discover(ctx, **kwargs):
|
||||||
* universal-jeunesse
|
* universal-jeunesse
|
||||||
|
|
||||||
* universal-chanson
|
* universal-chanson
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from streamrip.constants import QOBUZ_FEATURED_KEYS
|
from streamrip.constants import QOBUZ_FEATURED_KEYS
|
||||||
|
|
||||||
|
@ -235,6 +239,11 @@ def discover(ctx, **kwargs):
|
||||||
kwargs["list"] in QOBUZ_FEATURED_KEYS
|
kwargs["list"] in QOBUZ_FEATURED_KEYS
|
||||||
), f"Invalid featured key {kwargs['list']}"
|
), f"Invalid featured key {kwargs['list']}"
|
||||||
|
|
||||||
|
if kwargs["scrape"]:
|
||||||
|
core.scrape(kwargs["list"])
|
||||||
|
core.download()
|
||||||
|
return
|
||||||
|
|
||||||
if core.interactive_search(kwargs["list"], "qobuz", "featured"):
|
if core.interactive_search(kwargs["list"], "qobuz", "featured"):
|
||||||
core.download()
|
core.download()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -316,6 +316,9 @@ class MusicDL(list):
|
||||||
if arguments["conversion"]["enabled"]:
|
if arguments["conversion"]["enabled"]:
|
||||||
item.convert(**arguments["conversion"])
|
item.convert(**arguments["conversion"])
|
||||||
|
|
||||||
|
def scrape(self, featured_list: str):
|
||||||
|
self.extend(self.search("qobuz", featured_list, "featured", limit=500))
|
||||||
|
|
||||||
def get_client(self, source: str) -> Client:
|
def get_client(self, source: str) -> Client:
|
||||||
"""Get a client given the source and log in.
|
"""Get a client given the source and log in.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue