From 0639ea15fce3c86bc60cbc76fcd494805c7b4426 Mon Sep 17 00:00:00 2001 From: Lev Plyusnin Date: Tue, 19 Nov 2024 10:38:06 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B?= =?UTF-8?q?=20--skip-existing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- ymd/cli.py | 7 +++++-- ymd/core.py | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) 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: