initial commit

This commit is contained in:
Frank de Lange 2022-02-13 14:05:30 +00:00
commit f59b9683f7
15 changed files with 1542 additions and 0 deletions

38
spodcast/__main__.py Normal file
View file

@ -0,0 +1,38 @@
import argparse
from spodcast.app import client
from spodcast.config import CONFIG_VALUES
def main():
parser = argparse.ArgumentParser(prog='spodcast',
description='A caching Spotify podcast to RSS proxy.')
parser.add_argument('-c', '--config-location',
type=str,
help='Specify the spodcast.json location')
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('urls',
type=str,
# action='extend',
default='',
nargs='*',
help='Download podcast episode(s) from a url. Can take multiple urls.')
group.add_argument('-l', '--login',
type=str,
help='Reads username and password from file passed as argument and stores credentials for later use.')
for configkey in CONFIG_VALUES:
parser.add_argument(CONFIG_VALUES[configkey]['arg'],
type=str,
default=None,
help=CONFIG_VALUES[configkey]['help'])
parser.set_defaults(func=client)
args = parser.parse_args()
args.func(args)
if __name__ == '__main__':
main()