Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load_defaults():
const.args = handle.get_arguments(raw_args="", to_group=False, to_merge=False)
const.args.overwrite = "skip"
spotdl.args = const.args
spotdl.log = const.logzero.setup_logger(
formatter=const._formatter, level=const.args.log_level
)
def test_error_m3u_without_list():
with pytest.raises(SystemExit):
handle.get_arguments(raw_args=("-s cool song", "--write-m3u"), to_group=True)
def test_grouped_arguments(tmpdir):
sys.path[0] = str(tmpdir)
with pytest.raises(SystemExit):
handle.get_arguments(to_group=True, to_merge=True)
def test_m3u_with_list():
handle.get_arguments(raw_args=("-l cool_list.txt", "--write-m3u"), to_group=True)
def main():
const.args = handle.get_arguments()
internals.filter_path(const.args.folder)
youtube_tools.set_api_key()
spotify = spotify_tools.SpotifyAuthorize()
logzero.setup_default_logger(formatter=const._formatter, level=const.args.log_level)
try:
match_args()
# actually we don't necessarily need this, but yeah...
# explicit is better than implicit!
sys.exit(0)
except KeyboardInterrupt as e:
log.exception(e)
sys.exit(3)
def main():
const.args = handle.get_arguments()
internals.filter_path(const.args.folder)
youtube_tools.set_api_key()
logzero.setup_default_logger(formatter=const._formatter, level=const.args.log_level)
try:
match_args()
# actually we don't necessarily need this, but yeah...
# explicit is better than implicit!
sys.exit(0)
except KeyboardInterrupt as e:
log.exception(e)
sys.exit(3)