diff --git a/pyproject.toml b/pyproject.toml index 02602b5..f2b6869 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "yandex-music-downloader" -version = "3.2.0b1" +version = "3.2.0b2" description = "Загрузчик музыки с сервиса Яндекс.Музыка" requires-python = ">=3.9" readme = "README.md" diff --git a/ymd/cli.py b/ymd/cli.py index 3f1a5c7..61e1bf9 100644 --- a/ymd/cli.py +++ b/ymd/cli.py @@ -250,8 +250,11 @@ def main(): track, args.unsafe_path, ) - if args.skip_existing and save_path.is_file(): - continue + if args.skip_existing: + if any( + save_path.with_suffix(s).is_file() for s in core.AUDIO_FILE_SUFFIXES + ): + continue save_dir = save_path.parent if not save_dir.is_dir(): diff --git a/ymd/core.py b/ymd/core.py index c0027cc..945cec7 100644 --- a/ymd/core.py +++ b/ymd/core.py @@ -36,6 +36,8 @@ DEFAULT_COVER_RESOLUTION = 400 MIN_COMPATIBILITY_LEVEL = 0 MAX_COMPATIBILITY_LEVEL = 1 +AUDIO_FILE_SUFFIXES = {".mp3", ".flac", ".m4a"} + @dataclass class DownloadableTrack: