Main program

def main():
    """ Main program """
    parse, options = parser(__version__)

    if options.flexibleq and not options.quality:
        logging.error("flexible-quality requires a quality")

    if len(options.urls) == 0:
        parse.print_help()
        sys.exit(0)
    urls = options.urls
    config = parsertoconfig(setup_defaults(), options)
    if len(urls) < 1:
        parse.error("Incorrect number of arguments")
    setup_log(config.get("silent"), config.get("verbose"))

    if options.cmoreoperatorlist:
        config = parsertoconfig(setup_defaults(), options)
        c = Cmore(config, urls)
        c.operatorlist()
        sys.exit(0)

    try:
        if len(urls) == 1:
            get_media(urls[0], config, __version__)
        else:
            get_multiple_media(urls, config)
    except KeyboardInterrupt:
        print("")
    except (yaml.YAMLError, yaml.MarkedYAMLError) as e:
        logging.error('Your settings file(s) contain invalid YAML syntax! Please fix and restart!, {}'.format(str(e)))
        sys.exit(2)