From c7e121b3e59865aa15200691dbe333e7a4b88aa8 Mon Sep 17 00:00:00 2001 From: Lev Plyusnin Date: Mon, 11 Nov 2024 06:35:13 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20type=20hints=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20python=203.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- ymd/cli.py | 4 ++-- ymd/core.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8131e0a..cfe89eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "yandex-music-downloader" -version = "3.0.0b0" +version = "3.0.0b1" description = "Загрузчик музыки с сервиса Яндекс.Музыка" requires-python = ">=3.9" readme = "README.md" diff --git a/ymd/cli.py b/ymd/cli.py index 9b54dea..5204eb8 100644 --- a/ymd/cli.py +++ b/ymd/cli.py @@ -7,7 +7,7 @@ import time import typing from collections.abc import Generator, Iterable from pathlib import Path -from typing import Optional +from typing import Optional, Union from urllib.parse import urlparse from yandex_music import Album, Client, Playlist, Track @@ -151,7 +151,7 @@ def main(): client = Client(args.token).init() result_tracks: Iterable[Track] = [] - def album_tracks_gen(album_ids: Iterable[int | str]) -> Generator[Track]: + def album_tracks_gen(album_ids: Iterable[Union[int, str]]) -> Generator[Track]: for album_id in album_ids: if full_album := client.albums_with_tracks(album_id): if volumes := full_album.volumes: diff --git a/ymd/core.py b/ymd/core.py index 5e148ad..9cc384a 100644 --- a/ymd/core.py +++ b/ymd/core.py @@ -15,7 +15,7 @@ DEFAULT_PATH_PATTERN = Path("#album-artist", "#album", "#number - #title") DEFAULT_COVER_RESOLUTION = 400 -def full_title(obj: YandexMusicObject) -> str | None: +def full_title(obj: YandexMusicObject) -> Optional[str]: result = obj["title"] if result is None: return