From 17fb1f3aa32816bed63ba021db7a9769c6beaeac Mon Sep 17 00:00:00 2001 From: TheUltimateC0der Date: Wed, 2 Sep 2020 23:14:59 +0200 Subject: [PATCH 1/2] Update 'deemix/__main__.py' Added option for download path --- deemix/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deemix/__main__.py b/deemix/__main__.py index ed2533b..7e2fdfb 100644 --- a/deemix/__main__.py +++ b/deemix/__main__.py @@ -7,9 +7,10 @@ from os.path import isfile @click.command() @click.option('-b', '--bitrate', default=None, help='Overwrites the default bitrate selected') @click.option('-l', '--local', is_flag=True, help='Downloads in a local folder insted of using the default') +@click.option('-p', '--path', type=str, help='Downloads in the given folder') @click.argument('url', nargs=-1, required=True) -def download(bitrate, local, url): - app = cli(local) +def download(bitrate, local, url, path): + app = cli(local, path) app.login() url = list(url) if isfile(url[0]): From c45994f733c2480915e5891a9bad09e2a6013ba7 Mon Sep 17 00:00:00 2001 From: TheUltimateC0der Date: Wed, 2 Sep 2020 23:19:26 +0200 Subject: [PATCH 2/2] Update 'deemix/app/cli.py' Added path param for downloading the content to the given path --- deemix/app/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deemix/app/cli.py b/deemix/app/cli.py index f7d881d..4a4144e 100644 --- a/deemix/app/cli.py +++ b/deemix/app/cli.py @@ -11,8 +11,11 @@ def randomString(stringLength=8): return ''.join(random.choice(letters) for i in range(stringLength)) class cli(deemix): - def __init__(self, local, configFolder=None): + def __init__(self, local, path, configFolder=None): super().__init__(configFolder) + if path: + self.set.settings['downloadLocation'] = str(path) + print("Using folder: "+self.set.settings['downloadLocation']) if local: self.set.settings['downloadLocation'] = randomString(12) print("Using a local download folder: "+self.set.settings['downloadLocation'])