deemix-py/deemix/__main__.py

29 lines
801 B
Python
Raw Normal View History

2020-02-17 15:46:18 +00:00
#!/usr/bin/env python3
import click
2020-04-07 22:19:27 +00:00
import deemix.app.cli as app
from deemix.app.settings import initSettings
from os.path import isfile
@click.command()
@click.option('-b', '--bitrate', default=None, help='Overwrites the default bitrate selected')
2020-05-20 14:36:01 +00:00
@click.option('-bot', '--botmode', is_flag=True, help='Enables bot mode')
@click.argument('url', nargs=-1, required=True)
2020-05-20 14:36:01 +00:00
def download(bitrate, botmode, url):
settings = initSettings(botmode)
app.login()
if isfile(url[0]):
filename = url[0]
with open(filename) as f:
url = f.readlines()
for u in url:
app.downloadLink(u, settings, bitrate)
click.echo("All done!")
2020-05-20 14:36:01 +00:00
if botmode:
click.echo(settings['downloadLocation']) #folder name output
2020-02-17 15:46:18 +00:00
if __name__ == '__main__':
download()