Skip to content

Commit

Permalink
Fix sync
Browse files Browse the repository at this point in the history
  • Loading branch information
7x11x13 committed Jun 24, 2024
1 parent eaf1793 commit 7f22f4b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scdl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- encoding: utf-8 -*-
"""Python Soundcloud Music Downloader."""
__version__ = "v2.9.4"
__version__ = "v2.9.5"
19 changes: 18 additions & 1 deletion scdl/scdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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,
)
Expand Down

0 comments on commit 7f22f4b

Please sign in to comment.