From 7f22f4b4bea0355deca4faa6d9b85e14aebf7ba3 Mon Sep 17 00:00:00 2001 From: 7x11x13 Date: Sun, 23 Jun 2024 20:40:41 -0400 Subject: [PATCH] Fix sync --- scdl/__init__.py | 2 +- scdl/scdl.py | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/scdl/__init__.py b/scdl/__init__.py index df7d458..9559da1 100644 --- a/scdl/__init__.py +++ b/scdl/__init__.py @@ -1,3 +1,3 @@ # -*- encoding: utf-8 -*- """Python Soundcloud Music Downloader.""" -__version__ = "v2.9.4" +__version__ = "v2.9.5" diff --git a/scdl/scdl.py b/scdl/scdl.py index df63b7a..032519f 100755 --- a/scdl/scdl.py +++ b/scdl/scdl.py @@ -264,8 +264,24 @@ def main(): arguments["-l"] = validate_url(client, arguments["-l"]) + if arguments["--download-archive"]: + try: + path = pathlib.Path(arguments["--download-archive"]).resolve() + arguments["--download-archive"] = path + except Exception: + logger.error( + f"Invalid download archive file {arguments['--download-archive']}" + ) + sys.exit(1) + if arguments["--sync"]: - arguments["--download-archive"] = arguments["--sync"] + try: + path = pathlib.Path(arguments["--sync"]).resolve() + arguments["--download-archive"] = path + arguments["--sync"] = path + except Exception: + logger.error(f"Invalid sync archive file {arguments['--sync']}") + sys.exit(1) # convert arguments dict to python_args (kwargs-friendly args) python_args = {} @@ -518,6 +534,7 @@ def sync( for ext in (".mp3", ".m4a", ".opus", ".flac", ".wav"): filename = get_filename( client.get_track(track_id), + ext, playlist_info=playlist_info, **kwargs, )