From 8aafa15ccbad89112cc9ea7e7a17f25f7122f200 Mon Sep 17 00:00:00 2001 From: Ilya Siamionau Date: Sun, 24 Dec 2023 19:38:17 +0100 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6?= =?UTF-8?q?=D0=BA=D0=B0=20Python=203.12=20(#628)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- setup.py | 7 +++++-- yandex_music/download_info.py | 2 +- yandex_music/utils/request.py | 2 +- yandex_music/utils/request_async.py | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aa5a3a6e..22c20774 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ macos-latest, ubuntu-latest, windows-latest ] - python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ] + python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12" ] steps: - name: Checkout repository. diff --git a/setup.py b/setup.py index e8c587f5..c4f0c44a 100644 --- a/setup.py +++ b/setup.py @@ -12,10 +12,10 @@ def run_tests(self) -> None: sys.exit(pytest.main(['tests'])) -with open('yandex_music/__init__.py', encoding='utf-8') as f: +with open('yandex_music/__init__.py', encoding='UTF-8') as f: version = re.findall(r"__version__ = '(.+)'", f.read())[0] -with open('README.md', 'r', encoding='utf-8') as f: +with open('README.md', 'r', encoding='UTF-8') as f: readme = f.read() setup( @@ -50,6 +50,7 @@ def run_tests(self) -> None: 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: Implementation', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', @@ -59,6 +60,8 @@ def run_tests(self) -> None: tests_require=['pytest'], project_urls={ 'Documentation': 'https://yandex-music.rtfd.io', + 'Changes': 'https://github.com/MarshalX/yandex-music-api/blob/main/CHANGES.md', + 'Tracker': 'https://github.com/MarshalX/yandex-music-api/issues', 'Telegram chat': 'https://t.me/yandex_music_api', 'Codecov': 'https://codecov.io/gh/MarshalX/yandex-music-api', 'Codacy': 'https://app.codacy.com/gh/MarshalX/yandex-music-api', diff --git a/yandex_music/download_info.py b/yandex_music/download_info.py index 0469f7ff..3ed7dcd2 100644 --- a/yandex_music/download_info.py +++ b/yandex_music/download_info.py @@ -56,7 +56,7 @@ def __build_direct_link(self, xml: str) -> str: path = self._get_text_node_data(doc.getElementsByTagName('path')) ts = self._get_text_node_data(doc.getElementsByTagName('ts')) s = self._get_text_node_data(doc.getElementsByTagName('s')) - sign = md5((SIGN_SALT + path[1::] + s).encode('utf-8')).hexdigest() # noqa: S324 + sign = md5((SIGN_SALT + path[1::] + s).encode('UTF-8')).hexdigest() # noqa: S324 return f'https://{host}/get-mp3/{sign}/{ts}{path}' diff --git a/yandex_music/utils/request.py b/yandex_music/utils/request.py index 5faee703..7dfd4944 100644 --- a/yandex_music/utils/request.py +++ b/yandex_music/utils/request.py @@ -167,7 +167,7 @@ def _parse(self, json_data: bytes) -> Optional[Response]: :class:`yandex_music.exceptions.YandexMusicError`: Базовое исключение библиотеки. """ try: - decoded_s = json_data.decode('utf-8') + decoded_s = json_data.decode('UTF-8') data = json.loads(decoded_s, object_hook=Request._object_hook) except UnicodeDecodeError as e: diff --git a/yandex_music/utils/request_async.py b/yandex_music/utils/request_async.py index 84970a55..ee37b5e7 100644 --- a/yandex_music/utils/request_async.py +++ b/yandex_music/utils/request_async.py @@ -173,7 +173,7 @@ def _parse(self, json_data: bytes) -> Optional[Response]: :class:`yandex_music.exceptions.YandexMusicError`: Базовое исключение библиотеки. """ try: - decoded_s = json_data.decode('utf-8') + decoded_s = json_data.decode('UTF-8') data = json.loads(decoded_s, object_hook=Request._object_hook) except UnicodeDecodeError as e: