Исправление совместимости с python <3.11
This commit is contained in:
parent
6dc2d0dc56
commit
e8ab89cd7f
3 changed files with 9 additions and 21 deletions
|
|
@ -7,13 +7,14 @@ build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "yandex-music-downloader"
|
name = "yandex-music-downloader"
|
||||||
version = "3.2.1b0"
|
version = "3.2.1b1"
|
||||||
description = "Загрузчик музыки с сервиса Яндекс.Музыка"
|
description = "Загрузчик музыки с сервиса Яндекс.Музыка"
|
||||||
requires-python = ">=3.9"
|
requires-python = ">=3.9"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"yandex-music",
|
"yandex-music",
|
||||||
"mutagen"
|
"mutagen",
|
||||||
|
"StrEnum"
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
yandex-music
|
yandex-music
|
||||||
mutagen
|
mutagen
|
||||||
|
StrEnum
|
||||||
|
|
|
||||||
24
ymd/core.py
24
ymd/core.py
|
|
@ -2,11 +2,9 @@ import datetime as dt
|
||||||
import random
|
import random
|
||||||
import re
|
import re
|
||||||
import typing
|
import typing
|
||||||
from collections.abc import Iterable
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import Enum, StrEnum, auto
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional, Type, TypeVar, Union
|
from typing import Optional, Union
|
||||||
|
|
||||||
import mutagen
|
import mutagen
|
||||||
from mutagen.flac import FLAC, Picture
|
from mutagen.flac import FLAC, Picture
|
||||||
|
|
@ -25,6 +23,7 @@ from mutagen.id3._frames import (
|
||||||
from mutagen.id3._specs import ID3TimeStamp, PictureType
|
from mutagen.id3._specs import ID3TimeStamp, PictureType
|
||||||
from mutagen.mp3 import MP3
|
from mutagen.mp3 import MP3
|
||||||
from mutagen.mp4 import MP4, MP4Cover
|
from mutagen.mp4 import MP4, MP4Cover
|
||||||
|
from strenum import StrEnum
|
||||||
from yandex_music import Client, DownloadInfo, Track, YandexMusicObject
|
from yandex_music import Client, DownloadInfo, Track, YandexMusicObject
|
||||||
|
|
||||||
from ymd.api import get_lossless_info
|
from ymd.api import get_lossless_info
|
||||||
|
|
@ -41,23 +40,10 @@ MAX_COMPATIBILITY_LEVEL = 1
|
||||||
AUDIO_FILE_SUFFIXES = {".mp3", ".flac", ".m4a"}
|
AUDIO_FILE_SUFFIXES = {".mp3", ".flac", ".m4a"}
|
||||||
|
|
||||||
|
|
||||||
_E = TypeVar("_E", bound=Enum)
|
|
||||||
|
|
||||||
|
|
||||||
class ParameterEnum(StrEnum):
|
|
||||||
@classmethod
|
|
||||||
def available_keys(cls) -> Iterable[str]:
|
|
||||||
return cls.__members__.keys()
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_str(cls: Type[_E], arg: str) -> _E:
|
|
||||||
return cls[arg.lower()]
|
|
||||||
|
|
||||||
|
|
||||||
class LyricsFormat(StrEnum):
|
class LyricsFormat(StrEnum):
|
||||||
NONE = auto()
|
NONE = "none"
|
||||||
TEXT = auto()
|
TEXT = "text"
|
||||||
LRC = auto()
|
LRC = "lrc"
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue