Added file option instead of an URL in the CLI
Depending what you give it it will download accordingly
This commit is contained in:
parent
4c80b73433
commit
36316e69e5
|
@ -3,6 +3,7 @@ import click
|
||||||
|
|
||||||
import deemix.app.cli as app
|
import deemix.app.cli as app
|
||||||
from deemix.app.settings import initSettings
|
from deemix.app.settings import initSettings
|
||||||
|
from os.path import isfile
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
|
@ -11,6 +12,10 @@ from deemix.app.settings import initSettings
|
||||||
def download(bitrate, url):
|
def download(bitrate, url):
|
||||||
settings = initSettings()
|
settings = initSettings()
|
||||||
app.login()
|
app.login()
|
||||||
|
if isfile(url[0]):
|
||||||
|
filename = url[0]
|
||||||
|
with open(filename) as f:
|
||||||
|
url = f.readlines()
|
||||||
for u in url:
|
for u in url:
|
||||||
app.downloadLink(u, settings, bitrate)
|
app.downloadLink(u, settings, bitrate)
|
||||||
click.echo("All done!")
|
click.echo("All done!")
|
||||||
|
|
|
@ -35,4 +35,5 @@ def login():
|
||||||
|
|
||||||
|
|
||||||
def downloadLink(url, settings, bitrate=None):
|
def downloadLink(url, settings, bitrate=None):
|
||||||
|
url = url.strip()
|
||||||
addToQueue(dz, sp, url, settings, bitrate)
|
addToQueue(dz, sp, url, settings, bitrate)
|
||||||
|
|
Loading…
Reference in New Issue