From b0ac1034d25e157477aa15753f100c52490c8f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Wed, 24 Jul 2024 01:47:46 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=92=AD=E6=94=BE=E6=97=B6=E9=95=BF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=B0=9D=E8=AF=95=E8=A7=A3=E5=86=B3=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E5=BB=B6=E8=BF=9F=E5=92=8C=E6=93=8D=E4=BD=9C=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=8D=A1=E9=A1=BF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pdm.lock | 114 ++++++++++++++++++++++++++++++++++++++--- pyproject.toml | 1 + requirements.txt | 103 +++++++++++++++++++------------------ xiaomusic/utils.py | 47 +++++++++-------- xiaomusic/xiaomusic.py | 6 ++- 5 files changed, 191 insertions(+), 80 deletions(-) diff --git a/pdm.lock b/pdm.lock index 6fc2db2..3d3fef7 100644 --- a/pdm.lock +++ b/pdm.lock @@ -4,8 +4,26 @@ [metadata] groups = ["default", "dev", "lint"] strategy = ["inherit_metadata"] -lock_version = "4.4.2" -content_hash = "sha256:fe8f356d82d38641f48975833c27c352829a895c3c3293c36e0e010a3202966e" +lock_version = "4.5.0" +content_hash = "sha256:662037dc1982f7f3592bd691dffc2ffd7b7d7f7b464fa74f716403a03e3a7725" + +[[metadata.targets]] +requires_python = "==3.10.12" +platform = "manylinux_2_35_x86_64" +implementation = "cpython" +gil_disabled = false + +[[package]] +name = "aiofiles" +version = "24.1.0" +requires_python = ">=3.8" +summary = "File support for asyncio." +groups = ["default"] +marker = "python_full_version == \"3.10.12\"" +files = [ + {file = "aiofiles-24.1.0-py3-none-any.whl", hash = "sha256:b4ec55f4195e3eb5d7abd1bf7e061763e864dd4954231fb8539a0ef8bb8260e5"}, + {file = "aiofiles-24.1.0.tar.gz", hash = "sha256:22a075c9e5a3810f0c2e48f3008c94d68c65d763b9b03857924c99e57355166c"}, +] [[package]] name = "aiohttp" @@ -13,6 +31,7 @@ version = "3.9.5" requires_python = ">=3.8" summary = "Async http client/server framework (asyncio)" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "aiosignal>=1.1.2", "async-timeout<5.0,>=4.0; python_version < \"3.11\"", @@ -32,6 +51,7 @@ version = "1.3.1" requires_python = ">=3.7" summary = "aiosignal: a list of registered asynchronous callbacks" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "frozenlist>=1.1.0", ] @@ -46,6 +66,10 @@ version = "0.7.0" requires_python = ">=3.8" summary = "Reusable constraint types to use with typing.Annotated" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" +dependencies = [ + "typing-extensions>=4.0.0; python_version < \"3.9\"", +] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, @@ -57,6 +81,7 @@ version = "4.4.0" requires_python = ">=3.8" summary = "High level compatibility layer for multiple asynchronous event loop implementations" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "exceptiongroup>=1.0.2; python_version < \"3.11\"", "idna>=2.8", @@ -74,6 +99,7 @@ version = "3.4.0" requires_python = ">=3.8" summary = "Bash tab completion for argparse" groups = ["dev"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "argcomplete-3.4.0-py3-none-any.whl", hash = "sha256:69a79e083a716173e5532e0fa3bef45f793f4e61096cf52b5a42c0211c8b8aa5"}, {file = "argcomplete-3.4.0.tar.gz", hash = "sha256:c2abcdfe1be8ace47ba777d4fce319eb13bf8ad9dace8d085dcad6eded88057f"}, @@ -85,7 +111,10 @@ version = "4.0.3" requires_python = ">=3.7" summary = "Timeout context manager for asyncio programs" groups = ["default"] -marker = "python_version < \"3.11\"" +marker = "python_full_version == \"3.10.12\"" +dependencies = [ + "typing-extensions>=3.6.5; python_version < \"3.8\"", +] files = [ {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, @@ -97,6 +126,10 @@ version = "23.2.0" requires_python = ">=3.7" summary = "Classes Without Boilerplate" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" +dependencies = [ + "importlib-metadata; python_version < \"3.8\"", +] files = [ {file = "attrs-23.2.0-py3-none-any.whl", hash = "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1"}, {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, @@ -107,7 +140,7 @@ name = "brotli" version = "1.1.0" summary = "Python bindings for the Brotli compression library" groups = ["default"] -marker = "implementation_name == \"cpython\"" +marker = "implementation_name == \"cpython\" and python_full_version == \"3.10.12\"" files = [ {file = "Brotli-1.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e1140c64812cb9b06c922e77f1c26a75ec5e3f0fb2bf92cc8c58720dec276752"}, {file = "Brotli-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c8fd5270e906eef71d4a8d19b7c6a43760c6abcfcc10c9101d14eb2357418de9"}, @@ -154,6 +187,7 @@ version = "2024.7.4" requires_python = ">=3.6" summary = "Python package for providing Mozilla's CA Bundle." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, @@ -165,6 +199,7 @@ version = "3.3.2" requires_python = ">=3.7.0" summary = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." groups = ["default", "dev"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, @@ -221,6 +256,11 @@ version = "8.1.7" requires_python = ">=3.7" summary = "Composable command line interface toolkit" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" +dependencies = [ + "colorama; platform_system == \"Windows\"", + "importlib-metadata; python_version < \"3.8\"", +] files = [ {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, @@ -232,6 +272,7 @@ version = "0.4.6" requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" summary = "Cross-platform colored terminal text." groups = ["dev"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -243,17 +284,20 @@ version = "3.28.0" requires_python = ">=3.8" summary = "Python commitizen client tool" groups = ["dev"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "argcomplete<3.5,>=1.12.1", "charset-normalizer<4,>=2.1.0", "colorama<0.5.0,>=0.4.1", "decli<0.7.0,>=0.6.0", + "importlib-metadata<9,>=8.0.0; python_version < \"3.10\"", "jinja2>=2.10.3", "packaging>=19", "pyyaml>=3.08", "questionary<3.0,>=2.0", "termcolor<3,>=1.1", "tomlkit<1.0.0,>=0.5.3", + "typing-extensions<5.0.0,>=4.0.1; python_version < \"3.8\"", ] files = [ {file = "commitizen-3.28.0-py3-none-any.whl", hash = "sha256:372dba10bb082be0e571cfa9ac0946f4333c3f4b2e242fbe32ae2f2afea143e4"}, @@ -266,6 +310,7 @@ version = "0.6.2" requires_python = ">=3.7" summary = "Minimal, easy-to-use, declarative cli tool" groups = ["dev"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "decli-0.6.2-py3-none-any.whl", hash = "sha256:2fc84106ce9a8f523ed501ca543bdb7e416c064917c12a59ebdc7f311a97b7ed"}, {file = "decli-0.6.2.tar.gz", hash = "sha256:36f71eb55fd0093895efb4f416ec32b7f6e00147dda448e3365cf73ceab42d6f"}, @@ -277,6 +322,7 @@ version = "2.6.1" requires_python = ">=3.8" summary = "DNS toolkit" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "dnspython-2.6.1-py3-none-any.whl", hash = "sha256:5ef3b9680161f6fa89daf8ad451b5f1a33b18ae8a1c6778cdf4b43f08c0a6e50"}, {file = "dnspython-2.6.1.tar.gz", hash = "sha256:e8f0f9c23a7b7cb99ded64e6c3a6f3e701d78f50c55e002b839dea7225cff7cc"}, @@ -288,6 +334,7 @@ version = "2.2.0" requires_python = ">=3.8" summary = "A robust email address syntax and deliverability validation library." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "dnspython>=2.0.0", "idna>=2.0.0", @@ -303,7 +350,7 @@ version = "1.2.2" requires_python = ">=3.7" summary = "Backport of PEP 654 (exception groups)" groups = ["default"] -marker = "python_version < \"3.11\"" +marker = "python_full_version == \"3.10.12\"" files = [ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, @@ -315,6 +362,7 @@ version = "0.111.1" requires_python = ">=3.8" summary = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "email-validator>=2.0.0", "fastapi-cli>=0.0.2", @@ -337,6 +385,7 @@ version = "0.0.4" requires_python = ">=3.8" summary = "Run and manage FastAPI apps from the command line with FastAPI CLI. 🚀" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "typer>=0.12.3", ] @@ -351,6 +400,7 @@ version = "1.4.1" requires_python = ">=3.8" summary = "A list-like structure which implements collections.abc.MutableSequence" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "frozenlist-1.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f9aa1878d1083b276b0196f2dfbe00c9b7e752475ed3b682025ff20c1c1f51ac"}, {file = "frozenlist-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:29acab3f66f0f24674b7dc4736477bcd4bc3ad4b896f5f45379a67bce8b96868"}, @@ -407,6 +457,10 @@ version = "0.14.0" requires_python = ">=3.7" summary = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" +dependencies = [ + "typing-extensions; python_version < \"3.8\"", +] files = [ {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, @@ -418,6 +472,7 @@ version = "1.0.5" requires_python = ">=3.8" summary = "A minimal low-level HTTP client." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "certifi", "h11<0.15,>=0.13", @@ -433,6 +488,7 @@ version = "0.6.1" requires_python = ">=3.8.0" summary = "A collection of framework independent HTTP protocol utils." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "httptools-0.6.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d2f6c3c4cb1948d912538217838f6e9960bc4a521d7f9b323b3da579cd14532f"}, {file = "httptools-0.6.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:00d5d4b68a717765b1fabfd9ca755bd12bf44105eeb806c03d1962acd9b8e563"}, @@ -464,6 +520,7 @@ version = "0.27.0" requires_python = ">=3.8" summary = "The next generation HTTP client." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "anyio", "certifi", @@ -482,6 +539,7 @@ version = "3.7" requires_python = ">=3.5" summary = "Internationalized Domain Names in Applications (IDNA)" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, @@ -493,6 +551,7 @@ version = "3.1.4" requires_python = ">=3.7" summary = "A very fast and expressive template engine." groups = ["default", "dev"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "MarkupSafe>=2.0", ] @@ -507,6 +566,7 @@ version = "3.0.0" requires_python = ">=3.8" summary = "Python port of markdown-it. Markdown parsing, done right!" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "mdurl~=0.1", ] @@ -521,6 +581,7 @@ version = "2.1.5" requires_python = ">=3.7" summary = "Safely add untrusted strings to HTML/XML markup." groups = ["default", "dev"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"}, {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"}, @@ -561,6 +622,7 @@ version = "0.1.2" requires_python = ">=3.7" summary = "Markdown URL utilities" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, @@ -572,6 +634,7 @@ version = "2.7.0" requires_python = ">=3.8" summary = "XiaoMi Cloud Service fork from https://github.com/Yonsm/MiService" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "aiohttp", "mutagen", @@ -588,6 +651,7 @@ version = "6.0.5" requires_python = ">=3.7" summary = "multidict implementation" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:228b644ae063c10e7f324ab1ab6b548bdf6f8b47f3ec234fef1093bc2735e5f9"}, {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:896ebdcf62683551312c30e20614305f53125750803b614e9e6ce74a96232604"}, @@ -644,6 +708,7 @@ version = "1.47.0" requires_python = ">=3.7" summary = "read and write audio tags for many formats" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "mutagen-1.47.0-py3-none-any.whl", hash = "sha256:edd96f50c5907a9539d8e5bba7245f62c9f520aef333d13392a79a4f70aca719"}, {file = "mutagen-1.47.0.tar.gz", hash = "sha256:719fadef0a978c31b4cf3c956261b3c58b6948b32023078a2117b1de09f0fc99"}, @@ -655,6 +720,7 @@ version = "24.1" requires_python = ">=3.8" summary = "Core utilities for Python packages" groups = ["dev"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, @@ -666,6 +732,7 @@ version = "3.0.36" requires_python = ">=3.6.2" summary = "Library for building powerful interactive command lines in Python" groups = ["dev"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "wcwidth", ] @@ -680,6 +747,7 @@ version = "3.20.0" requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" summary = "Cryptographic library for Python" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "pycryptodomex-3.20.0-cp35-abi3-macosx_10_9_universal2.whl", hash = "sha256:59af01efb011b0e8b686ba7758d59cf4a8263f9ad35911bfe3f416cee4f5c08c"}, {file = "pycryptodomex-3.20.0-cp35-abi3-macosx_10_9_x86_64.whl", hash = "sha256:82ee7696ed8eb9a82c7037f32ba9b7c59e51dda6f105b39f043b6ef293989cb3"}, @@ -704,9 +772,11 @@ version = "2.8.2" requires_python = ">=3.8" summary = "Data validation using Python type hints" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "annotated-types>=0.4.0", "pydantic-core==2.20.1", + "typing-extensions>=4.12.2; python_version >= \"3.13\"", "typing-extensions>=4.6.1; python_version < \"3.13\"", ] files = [ @@ -720,6 +790,7 @@ version = "2.20.1" requires_python = ">=3.8" summary = "Core functionality for Pydantic validation and serialization" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "typing-extensions!=4.7.0,>=4.6.0", ] @@ -789,6 +860,7 @@ version = "2.18.0" requires_python = ">=3.8" summary = "Pygments is a syntax highlighting package written in Python." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a"}, {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"}, @@ -800,6 +872,7 @@ version = "1.0.1" requires_python = ">=3.8" summary = "Read key-value pairs from a .env file and set them as environment variables" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"}, {file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"}, @@ -811,6 +884,7 @@ version = "0.0.9" requires_python = ">=3.8" summary = "A streaming multipart parser for Python" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "python_multipart-0.0.9-py3-none-any.whl", hash = "sha256:97ca7b8ea7b05f977dc3849c3ba99d51689822fab725c3703af7c866a0c2b215"}, {file = "python_multipart-0.0.9.tar.gz", hash = "sha256:03f54688c663f1b7977105f021043b0793151e4cb1c1a9d4a11fc13d622c4026"}, @@ -822,6 +896,7 @@ version = "6.0.1" requires_python = ">=3.6" summary = "YAML parser and emitter for Python" groups = ["default", "dev"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, @@ -855,6 +930,7 @@ version = "2.0.1" requires_python = ">=3.8" summary = "Python library to build pretty command line user prompts ⭐️" groups = ["dev"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "prompt-toolkit<=3.0.36,>=2.0", ] @@ -869,6 +945,7 @@ version = "2.32.3" requires_python = ">=3.8" summary = "Python HTTP for Humans." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "certifi>=2017.4.17", "charset-normalizer<4,>=2", @@ -886,9 +963,11 @@ version = "13.7.1" requires_python = ">=3.7.0" summary = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "markdown-it-py>=2.2.0", "pygments<3.0.0,>=2.13.0", + "typing-extensions<5.0,>=4.0.0; python_version < \"3.9\"", ] files = [ {file = "rich-13.7.1-py3-none-any.whl", hash = "sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222"}, @@ -901,6 +980,7 @@ version = "0.5.3" requires_python = ">=3.7" summary = "An extremely fast Python linter and code formatter, written in Rust." groups = ["lint"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "ruff-0.5.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03bfe9ab5bdc0b08470c3b261643ad54ea86edc32b64d1e080892d7953add3ad"}, {file = "ruff-0.5.3.tar.gz", hash = "sha256:2a3eb4f1841771fa5b67a56be9c2d16fd3cc88e378bd86aaeaec2f7e6bcdd0a2"}, @@ -912,6 +992,7 @@ version = "1.5.4" requires_python = ">=3.7" summary = "Tool to Detect Surrounding Shell" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686"}, {file = "shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"}, @@ -923,6 +1004,7 @@ version = "1.3.1" requires_python = ">=3.7" summary = "Sniff out which async library your code is running under" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -934,8 +1016,10 @@ version = "0.37.2" requires_python = ">=3.8" summary = "The little ASGI library that shines." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "anyio<5,>=3.4.0", + "typing-extensions>=3.10.0; python_version < \"3.10\"", ] files = [ {file = "starlette-0.37.2-py3-none-any.whl", hash = "sha256:6fe59f29268538e5d0d182f2791a479a0c64638e6935d1c6989e63fb2699c6ee"}, @@ -948,6 +1032,7 @@ version = "2.4.0" requires_python = ">=3.8" summary = "ANSI color formatting for output in terminal" groups = ["dev"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "termcolor-2.4.0-py3-none-any.whl", hash = "sha256:9297c0df9c99445c2412e832e882a7884038a25617c60cea2ad69488d4040d63"}, {file = "termcolor-2.4.0.tar.gz", hash = "sha256:aab9e56047c8ac41ed798fa36d892a37aca6b3e9159f3e0c24bc64a9b3ac7b7a"}, @@ -959,6 +1044,7 @@ version = "0.13.0" requires_python = ">=3.8" summary = "Style preserving TOML library" groups = ["dev"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "tomlkit-0.13.0-py3-none-any.whl", hash = "sha256:7075d3042d03b80f603482d69bf0c8f345c2b30e41699fd8883227f89972b264"}, {file = "tomlkit-0.13.0.tar.gz", hash = "sha256:08ad192699734149f5b97b45f1f18dad7eb1b6d16bc72ad0c2335772650d7b72"}, @@ -970,6 +1056,7 @@ version = "0.12.3" requires_python = ">=3.7" summary = "Typer, build great CLIs. Easy to code. Based on Python type hints." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "click>=8.0.0", "rich>=10.11.0", @@ -987,6 +1074,7 @@ version = "4.12.2" requires_python = ">=3.8" summary = "Backported and Experimental Type Hints for Python 3.8+" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, @@ -998,6 +1086,7 @@ version = "2.2.2" requires_python = ">=3.8" summary = "HTTP library with thread-safe connection pooling, file post, and more." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, @@ -1009,6 +1098,7 @@ version = "0.30.1" requires_python = ">=3.8" summary = "The lightning-fast ASGI server." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "click>=7.0", "h11>=0.8", @@ -1026,7 +1116,9 @@ extras = ["standard"] requires_python = ">=3.8" summary = "The lightning-fast ASGI server." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ + "colorama>=0.4; sys_platform == \"win32\"", "httptools>=0.5.0", "python-dotenv>=0.13", "pyyaml>=5.1", @@ -1046,7 +1138,7 @@ version = "0.19.0" requires_python = ">=3.8.0" summary = "Fast implementation of asyncio event loop on top of libuv" groups = ["default"] -marker = "(sys_platform != \"cygwin\" and sys_platform != \"win32\") and platform_python_implementation != \"PyPy\"" +marker = "(sys_platform != \"cygwin\" and sys_platform != \"win32\") and platform_python_implementation != \"PyPy\" and python_full_version == \"3.10.12\"" files = [ {file = "uvloop-0.19.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:de4313d7f575474c8f5a12e163f6d89c0a878bc49219641d49e6f1444369a90e"}, {file = "uvloop-0.19.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5588bd21cf1fcf06bded085f37e43ce0e00424197e7c10e77afd4bbefffef428"}, @@ -1075,6 +1167,7 @@ version = "0.22.0" requires_python = ">=3.8" summary = "Simple, modern and high performance file watching and code reload in python." groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "anyio>=3.0.0", ] @@ -1129,6 +1222,10 @@ name = "wcwidth" version = "0.2.13" summary = "Measures the displayed width of unicode strings in a terminal" groups = ["dev"] +marker = "python_full_version == \"3.10.12\"" +dependencies = [ + "backports-functools-lru-cache>=1.2.1; python_version < \"3.2\"", +] files = [ {file = "wcwidth-0.2.13-py2.py3-none-any.whl", hash = "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859"}, {file = "wcwidth-0.2.13.tar.gz", hash = "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5"}, @@ -1140,6 +1237,7 @@ version = "12.0" requires_python = ">=3.8" summary = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" files = [ {file = "websockets-12.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d554236b2a2006e0ce16315c16eaa0d628dab009c33b63ea03f41c6107958374"}, {file = "websockets-12.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2d225bb6886591b1746b17c0573e29804619c8f755b5598d875bb4235ea639be"}, @@ -1189,9 +1287,11 @@ version = "1.9.4" requires_python = ">=3.7" summary = "Yet another URL library" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "idna>=2.0", "multidict>=4.0", + "typing-extensions>=3.7.4; python_version < \"3.8\"", ] files = [ {file = "yarl-1.9.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a8c1df72eb746f4136fe9a2e72b0c9dc1da1cbd23b5372f94b5820ff8ae30e0e"}, @@ -1249,8 +1349,10 @@ version = "2024.7.16" requires_python = ">=3.8" summary = "A feature-rich command-line audio/video downloader" groups = ["default"] +marker = "python_full_version == \"3.10.12\"" dependencies = [ "brotli; implementation_name == \"cpython\"", + "brotlicffi; implementation_name != \"cpython\"", "certifi", "mutagen", "pycryptodomex", diff --git a/pyproject.toml b/pyproject.toml index f4a5412..52de8f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ dependencies = [ "uvicorn>=0.30.1", "fastapi>=0.111.0", "starlette>=0.37.2", + "aiofiles>=24.1.0", ] requires-python = ">=3.10" readme = "README.md" diff --git a/requirements.txt b/requirements.txt index af19ca9..02ab3d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,25 +1,28 @@ # This file is @generated by PDM. # Please do not edit it manually. -aiohttp==3.9.5 \ +aiofiles==24.1.0; python_full_version == "3.10.12" \ + --hash=sha256:22a075c9e5a3810f0c2e48f3008c94d68c65d763b9b03857924c99e57355166c \ + --hash=sha256:b4ec55f4195e3eb5d7abd1bf7e061763e864dd4954231fb8539a0ef8bb8260e5 +aiohttp==3.9.5; python_full_version == "3.10.12" \ --hash=sha256:c26959ca7b75ff768e2776d8055bf9582a6267e24556bb7f7bd29e677932be72 \ --hash=sha256:edea7d15772ceeb29db4aff55e482d4bcfb6ae160ce144f2682de02f6d693551 -aiosignal==1.3.1 \ +aiosignal==1.3.1; python_full_version == "3.10.12" \ --hash=sha256:54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc \ --hash=sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17 -annotated-types==0.7.0 \ +annotated-types==0.7.0; python_full_version == "3.10.12" \ --hash=sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53 \ --hash=sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89 -anyio==4.4.0 \ +anyio==4.4.0; python_full_version == "3.10.12" \ --hash=sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94 \ --hash=sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7 -async-timeout==4.0.3; python_version < "3.11" \ +async-timeout==4.0.3; python_full_version == "3.10.12" \ --hash=sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f \ --hash=sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028 -attrs==23.2.0 \ +attrs==23.2.0; python_full_version == "3.10.12" \ --hash=sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30 \ --hash=sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1 -brotli==1.1.0; implementation_name == "cpython" \ +brotli==1.1.0; implementation_name == "cpython" and python_full_version == "3.10.12" \ --hash=sha256:0c6244521dda65ea562d5a69b9a26120769b7a9fb3db2fe9545935ed6735b128 \ --hash=sha256:19c116e796420b0cee3da1ccec3b764ed2952ccfcc298b55a10e5610ad7885f9 \ --hash=sha256:1ae56aca0402a0f9a3431cddda62ad71666ca9d4dc3a10a142b9dce2e3c0cda3 \ @@ -57,10 +60,10 @@ brotli==1.1.0; implementation_name == "cpython" \ --hash=sha256:e6a904cb26bfefc2f0a6f240bdf5233be78cd2488900a2f846f3c3ac8489ab80 \ --hash=sha256:e84799f09591700a4154154cab9787452925578841a94321d5ee8fb9a9a328f0 \ --hash=sha256:f66b5337fa213f1da0d9000bc8dc0cb5b896b726eefd9c6046f699b169c41b9e -certifi==2024.7.4 \ +certifi==2024.7.4; python_full_version == "3.10.12" \ --hash=sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b \ --hash=sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90 -charset-normalizer==3.3.2 \ +charset-normalizer==3.3.2; python_full_version == "3.10.12" \ --hash=sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027 \ --hash=sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8 \ --hash=sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09 \ @@ -108,25 +111,25 @@ charset-normalizer==3.3.2 \ --hash=sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f \ --hash=sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5 \ --hash=sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519 -click==8.1.7 \ +click==8.1.7; python_full_version == "3.10.12" \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de -dnspython==2.6.1 \ +dnspython==2.6.1; python_full_version == "3.10.12" \ --hash=sha256:5ef3b9680161f6fa89daf8ad451b5f1a33b18ae8a1c6778cdf4b43f08c0a6e50 \ --hash=sha256:e8f0f9c23a7b7cb99ded64e6c3a6f3e701d78f50c55e002b839dea7225cff7cc -email-validator==2.2.0 \ +email-validator==2.2.0; python_full_version == "3.10.12" \ --hash=sha256:561977c2d73ce3611850a06fa56b414621e0c8faa9d66f2611407d87465da631 \ --hash=sha256:cb690f344c617a714f22e66ae771445a1ceb46821152df8e165c5f9a364582b7 -exceptiongroup==1.2.2; python_version < "3.11" \ +exceptiongroup==1.2.2; python_full_version == "3.10.12" \ --hash=sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b \ --hash=sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc -fastapi==0.111.1 \ +fastapi==0.111.1; python_full_version == "3.10.12" \ --hash=sha256:4f51cfa25d72f9fbc3280832e84b32494cf186f50158d364a8765aabf22587bf \ --hash=sha256:ddd1ac34cb1f76c2e2d7f8545a4bcb5463bce4834e81abf0b189e0c359ab2413 -fastapi-cli==0.0.4 \ +fastapi-cli==0.0.4; python_full_version == "3.10.12" \ --hash=sha256:a2552f3a7ae64058cdbb530be6fa6dbfc975dc165e4fa66d224c3d396e25e809 \ --hash=sha256:e2e9ffaffc1f7767f488d6da34b6f5a377751c996f397902eb6abb99a67bde32 -frozenlist==1.4.1 \ +frozenlist==1.4.1; python_full_version == "3.10.12" \ --hash=sha256:04ced3e6a46b4cfffe20f9ae482818e34eba9b5fb0ce4056e4cc9b6e212d09b7 \ --hash=sha256:0633c8d5337cb5c77acbccc6357ac49a1770b8c487e5b3505c57b949b4b82e98 \ --hash=sha256:068b63f23b17df8569b7fdca5517edef76171cf3897eb68beb01341131fbd2ad \ @@ -174,13 +177,13 @@ frozenlist==1.4.1 \ --hash=sha256:fb3c2db03683b5767dedb5769b8a40ebb47d6f7f45b1b3e3b4b51ec8ad9d9825 \ --hash=sha256:fde5bd59ab5357e3853313127f4d3565fc7dad314a74d7b5d43c22c6a5ed2ced \ --hash=sha256:fe1a06da377e3a1062ae5fe0926e12b84eceb8a50b350ddca72dc85015873f74 -h11==0.14.0 \ +h11==0.14.0; python_full_version == "3.10.12" \ --hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \ --hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761 -httpcore==1.0.5 \ +httpcore==1.0.5; python_full_version == "3.10.12" \ --hash=sha256:34a38e2f9291467ee3b44e89dd52615370e152954ba21721378a87b2960f7a61 \ --hash=sha256:421f18bac248b25d310f3cacd198d55b8e6125c107797b609ff9b7a6ba7991b5 -httptools==0.6.1 \ +httptools==0.6.1; python_full_version == "3.10.12" \ --hash=sha256:00d5d4b68a717765b1fabfd9ca755bd12bf44105eeb806c03d1962acd9b8e563 \ --hash=sha256:0ac5a0ae3d9f4fe004318d64b8a854edd85ab76cffbf7ef5e32920faef62f142 \ --hash=sha256:1ed99a373e327f0107cb513b61820102ee4f3675656a37a50083eda05dc9541b \ @@ -203,19 +206,19 @@ httptools==0.6.1 \ --hash=sha256:c6e26c30455600b95d94b1b836085138e82f177351454ee841c148f93a9bad5a \ --hash=sha256:d2f6c3c4cb1948d912538217838f6e9960bc4a521d7f9b323b3da579cd14532f \ --hash=sha256:e57997ac7fb7ee43140cc03664de5f268813a481dff6245e0075925adc6aa185 -httpx==0.27.0 \ +httpx==0.27.0; python_full_version == "3.10.12" \ --hash=sha256:71d5465162c13681bff01ad59b2cc68dd838ea1f10e51574bac27103f00c91a5 \ --hash=sha256:a0cb88a46f32dc874e04ee956e4c2764aba2aa228f650b06788ba6bda2962ab5 -idna==3.7 \ +idna==3.7; python_full_version == "3.10.12" \ --hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \ --hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0 -jinja2==3.1.4 \ +jinja2==3.1.4; python_full_version == "3.10.12" \ --hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \ --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d -markdown-it-py==3.0.0 \ +markdown-it-py==3.0.0; python_full_version == "3.10.12" \ --hash=sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1 \ --hash=sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb -markupsafe==2.1.5 \ +markupsafe==2.1.5; python_full_version == "3.10.12" \ --hash=sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff \ --hash=sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f \ --hash=sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f \ @@ -247,13 +250,13 @@ markupsafe==2.1.5 \ --hash=sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b \ --hash=sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5 \ --hash=sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd -mdurl==0.1.2 \ +mdurl==0.1.2; python_full_version == "3.10.12" \ --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \ --hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba -miservice-fork==2.7.0 \ +miservice-fork==2.7.0; python_full_version == "3.10.12" \ --hash=sha256:8e2c91ebe1fc4b3c63b01cbf1818e5d5833d024fd3a8311970d649ad2d49d6e6 \ --hash=sha256:8e87ef6d89adceaf3f7a98242cdae1c9135498d77f2c743ec3871d2e42bcbab8 -multidict==6.0.5 \ +multidict==6.0.5; python_full_version == "3.10.12" \ --hash=sha256:01265f5e40f5a17f8241d52656ed27192be03bfa8764d88e8220141d1e4b3556 \ --hash=sha256:04bde7a7b3de05732a4eb39c94574db1ec99abb56162d6c520ad26f83267de29 \ --hash=sha256:0d63c74e3d7ab26de115c49bffc92cc77ed23395303d496eae515d4204a625e7 \ @@ -301,10 +304,10 @@ multidict==6.0.5 \ --hash=sha256:f7e301075edaf50500f0b341543c41194d8df3ae5caf4702f2095f3ca73dd8da \ --hash=sha256:fb616be3538599e797a2017cccca78e354c767165e8858ab5116813146041a24 \ --hash=sha256:fe5d7785250541f7f5019ab9cba2c71169dc7d74d0f45253f8313f436458a4ef -mutagen==1.47.0 \ +mutagen==1.47.0; python_full_version == "3.10.12" \ --hash=sha256:719fadef0a978c31b4cf3c956261b3c58b6948b32023078a2117b1de09f0fc99 \ --hash=sha256:edd96f50c5907a9539d8e5bba7245f62c9f520aef333d13392a79a4f70aca719 -pycryptodomex==3.20.0 \ +pycryptodomex==3.20.0; python_full_version == "3.10.12" \ --hash=sha256:25cd61e846aaab76d5791d006497134602a9e451e954833018161befc3b5b9ed \ --hash=sha256:2a47bcc478741b71273b917232f521fd5704ab4b25d301669879e7273d3586cc \ --hash=sha256:59af01efb011b0e8b686ba7758d59cf4a8263f9ad35911bfe3f416cee4f5c08c \ @@ -320,10 +323,10 @@ pycryptodomex==3.20.0 \ --hash=sha256:d00fe8596e1cc46b44bf3907354e9377aa030ec4cd04afbbf6e899fc1e2a7781 \ --hash=sha256:e48217c7901edd95f9f097feaa0388da215ed14ce2ece803d3f300b4e694abea \ --hash=sha256:f2e497413560e03421484189a6b65e33fe800d3bd75590e6d78d4dfdb7accf3b -pydantic==2.8.2 \ +pydantic==2.8.2; python_full_version == "3.10.12" \ --hash=sha256:6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a \ --hash=sha256:73ee9fddd406dc318b885c7a2eab8a6472b68b8fb5ba8150949fc3db939f23c8 -pydantic-core==2.20.1 \ +pydantic-core==2.20.1; python_full_version == "3.10.12" \ --hash=sha256:035ede2e16da7281041f0e626459bcae33ed998cca6a0a007a5ebb73414ac72d \ --hash=sha256:0827505a5c87e8aa285dc31e9ec7f4a17c81a813d45f70b1d9164e03a813a686 \ --hash=sha256:084659fac3c83fd674596612aeff6041a18402f1e1bc19ca39e417d554468482 \ @@ -381,16 +384,16 @@ pydantic-core==2.20.1 \ --hash=sha256:f9aa05d09ecf4c75157197f27cdc9cfaeb7c5f15021c6373932bf3e124af029f \ --hash=sha256:fa2fddcb7107e0d1808086ca306dcade7df60a13a6c347a7acf1ec139aa6789a \ --hash=sha256:faa6b09ee09433b87992fb5a2859efd1c264ddc37280d2dd5db502126d0e7f27 -pygments==2.18.0 \ +pygments==2.18.0; python_full_version == "3.10.12" \ --hash=sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199 \ --hash=sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a -python-dotenv==1.0.1 \ +python-dotenv==1.0.1; python_full_version == "3.10.12" \ --hash=sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca \ --hash=sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a -python-multipart==0.0.9 \ +python-multipart==0.0.9; python_full_version == "3.10.12" \ --hash=sha256:03f54688c663f1b7977105f021043b0793151e4cb1c1a9d4a11fc13d622c4026 \ --hash=sha256:97ca7b8ea7b05f977dc3849c3ba99d51689822fab725c3703af7c866a0c2b215 -pyyaml==6.0.1 \ +pyyaml==6.0.1; python_full_version == "3.10.12" \ --hash=sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc \ --hash=sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df \ --hash=sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741 \ @@ -415,37 +418,37 @@ pyyaml==6.0.1 \ --hash=sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab \ --hash=sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d \ --hash=sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f -requests==2.32.3 \ +requests==2.32.3; python_full_version == "3.10.12" \ --hash=sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 \ --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 -rich==13.7.1 \ +rich==13.7.1; python_full_version == "3.10.12" \ --hash=sha256:4edbae314f59eb482f54e9e30bf00d33350aaa94f4bfcd4e9e3110e64d0d7222 \ --hash=sha256:9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432 -shellingham==1.5.4 \ +shellingham==1.5.4; python_full_version == "3.10.12" \ --hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686 \ --hash=sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de -sniffio==1.3.1 \ +sniffio==1.3.1; python_full_version == "3.10.12" \ --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \ --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc -starlette==0.37.2 \ +starlette==0.37.2; python_full_version == "3.10.12" \ --hash=sha256:6fe59f29268538e5d0d182f2791a479a0c64638e6935d1c6989e63fb2699c6ee \ --hash=sha256:9af890290133b79fc3db55474ade20f6220a364a0402e0b556e7cd5e1e093823 -typer==0.12.3 \ +typer==0.12.3; python_full_version == "3.10.12" \ --hash=sha256:070d7ca53f785acbccba8e7d28b08dcd88f79f1fbda035ade0aecec71ca5c914 \ --hash=sha256:49e73131481d804288ef62598d97a1ceef3058905aa536a1134f90891ba35482 -typing-extensions==4.12.2 \ +typing-extensions==4.12.2; python_full_version == "3.10.12" \ --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 -urllib3==2.2.2 \ +urllib3==2.2.2; python_full_version == "3.10.12" \ --hash=sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472 \ --hash=sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168 -uvicorn==0.30.1 \ +uvicorn==0.30.1; python_full_version == "3.10.12" \ --hash=sha256:cd17daa7f3b9d7a24de3617820e634d0933b69eed8e33a516071174427238c81 \ --hash=sha256:d46cd8e0fd80240baffbcd9ec1012a712938754afcf81bce56c024c1656aece8 -uvicorn[standard]==0.30.1 \ +uvicorn[standard]==0.30.1; python_full_version == "3.10.12" \ --hash=sha256:cd17daa7f3b9d7a24de3617820e634d0933b69eed8e33a516071174427238c81 \ --hash=sha256:d46cd8e0fd80240baffbcd9ec1012a712938754afcf81bce56c024c1656aece8 -uvloop==0.19.0; (sys_platform != "cygwin" and sys_platform != "win32") and platform_python_implementation != "PyPy" \ +uvloop==0.19.0; (sys_platform != "cygwin" and sys_platform != "win32") and platform_python_implementation != "PyPy" and python_full_version == "3.10.12" \ --hash=sha256:0246f4fd1bf2bf702e06b0d45ee91677ee5c31242f39aab4ea6fe0c51aedd0fd \ --hash=sha256:02506dc23a5d90e04d4f65c7791e65cf44bd91b37f24cfc3ef6cf2aff05dc7ec \ --hash=sha256:2693049be9d36fef81741fddb3f441673ba12a34a704e7b4361efb75cf30befc \ @@ -465,7 +468,7 @@ uvloop==0.19.0; (sys_platform != "cygwin" and sys_platform != "win32") and platf --hash=sha256:cd81bdc2b8219cb4b2556eea39d2e36bfa375a2dd021404f90a62e44efaaf957 \ --hash=sha256:da8435a3bd498419ee8c13c34b89b5005130a476bda1d6ca8cfdde3de35cd650 \ --hash=sha256:de4313d7f575474c8f5a12e163f6d89c0a878bc49219641d49e6f1444369a90e -watchfiles==0.22.0 \ +watchfiles==0.22.0; python_full_version == "3.10.12" \ --hash=sha256:00095dd368f73f8f1c3a7982a9801190cc88a2f3582dd395b289294f8975172b \ --hash=sha256:00f39592cdd124b4ec5ed0b1edfae091567c72c7da1487ae645426d1b0ffcad1 \ --hash=sha256:030bc4e68d14bcad2294ff68c1ed87215fbd9a10d9dea74e7cfe8a17869785ab \ @@ -509,7 +512,7 @@ watchfiles==0.22.0 \ --hash=sha256:dc2e8fe41f3cac0660197d95216c42910c2b7e9c70d48e6d84e22f577d106fc1 \ --hash=sha256:e0f0a874231e2839abbf473256efffe577d6ee2e3bfa5b540479e892e47c172d \ --hash=sha256:f7e1f9c5d1160d03b93fc4b68a0aeb82fe25563e12fbcdc8507f8434ab6f823c -websockets==12.0 \ +websockets==12.0; python_full_version == "3.10.12" \ --hash=sha256:0e6e2711d5a8e6e482cacb927a49a3d432345dfe7dea8ace7b5790df5932e4df \ --hash=sha256:12743ab88ab2af1d17dd4acb4645677cb7063ef4db93abffbf164218a5d54c6b \ --hash=sha256:1e4b3f8ea6a9cfa8be8484c9221ec0257508e3a1ec43c36acdefb2a9c3b00aa2 \ @@ -550,7 +553,7 @@ websockets==12.0 \ --hash=sha256:ed2fcf7a07334c77fc8a230755c2209223a7cc44fc27597729b8ef5425aa61a3 \ --hash=sha256:f44069528d45a933997a6fef143030d8ca8042f0dfaad753e2906398290e2870 \ --hash=sha256:f764ba54e33daf20e167915edc443b6f88956f37fb606449b4a5b10ba42235a5 -yarl==1.9.4 \ +yarl==1.9.4; python_full_version == "3.10.12" \ --hash=sha256:008d3e808d03ef28542372d01057fd09168419cdc8f848efe2804f894ae03e51 \ --hash=sha256:03caa9507d3d3c83bca08650678e25364e1843b484f19986a527630ca376ecce \ --hash=sha256:09efe4615ada057ba2d30df871d2f668af661e971dfeedf0c159927d48bbeff0 \ @@ -598,6 +601,6 @@ yarl==1.9.4 \ --hash=sha256:e516dc8baf7b380e6c1c26792610230f37147bb754d6426462ab115a02944385 \ --hash=sha256:ea65804b5dc88dacd4a40279af0cdadcfe74b3e5b4c897aa0d81cf86927fee78 \ --hash=sha256:ee04010f26d5102399bd17f8df8bc38dc7ccd7701dc77f4a68c5b8d733406958 -yt-dlp==2024.7.16 \ +yt-dlp==2024.7.16; python_full_version == "3.10.12" \ --hash=sha256:424805a112e757b141e767bc938d49db56d13d6415a92fa4cd8acadd55790be0 \ --hash=sha256:c5bd517a49dea1923ec8e14f51858f10fd89dfece14cb701392b480b41b2f516 diff --git a/xiaomusic/utils.py b/xiaomusic/utils.py index 0b9d0c3..796d470 100644 --- a/xiaomusic/utils.py +++ b/xiaomusic/utils.py @@ -3,6 +3,8 @@ from __future__ import annotations import copy import difflib +import io +import logging import mimetypes import os import random @@ -14,6 +16,7 @@ from collections.abc import AsyncIterator from http.cookies import SimpleCookie from urllib.parse import urlparse +import aiofiles import aiohttp import mutagen from mutagen.id3 import ID3 @@ -193,23 +196,20 @@ async def _get_web_music_duration(session, url, start=0, end=500): headers = {"Range": f"bytes={start}-{end}"} async with session.get(url, headers=headers) as response: array_buffer = await response.read() - with tempfile.NamedTemporaryFile(delete=False) as tmp: + with tempfile.NamedTemporaryFile() as tmp: tmp.write(array_buffer) - name = tmp.name - - try: - if is_mp3(url): - m = mutagen.mp3.MP3(name) - else: - m = mutagen.File(name) - duration = m.info.length - except Exception: - pass - os.remove(name) + try: + if is_mp3(url): + m = mutagen.mp3.MP3(tmp) + else: + m = mutagen.File(tmp) + duration = m.info.length + except Exception as e: + logging.error(f"Error _get_web_music_duration: {e}") return duration -async def get_web_music_duration(url, start=0, end=500): +async def get_web_music_duration(url): duration = 0 try: parsed_url = urlparse(url) @@ -232,24 +232,27 @@ async def get_web_music_duration(url, start=0, end=500): duration = await _get_web_music_duration(session, url, start=0, end=500) if duration <= 0: duration = await _get_web_music_duration( - session, url, start=0, end=1000 + session, url, start=0, end=3000 ) - except Exception: - pass + except Exception as e: + logging.error(f"Error get_web_music_duration: {e}") return duration, url # 获取文件播放时长 -def get_local_music_duration(filename): +async def get_local_music_duration(filename): duration = 0 try: + async with aiofiles.open(filename, "rb") as f: + buffer = io.BytesIO(await f.read()) if is_mp3(filename): - m = mutagen.mp3.MP3(filename) + m = mutagen.mp3.MP3(buffer) else: - m = mutagen.File(filename) - duration = m.info.length - except Exception: - pass + m = mutagen.File(buffer) + if m and m.info: + duration = m.info.length + except Exception as e: + logging.error(f"Error getting local music duration: {e}") return duration diff --git a/xiaomusic/xiaomusic.py b/xiaomusic/xiaomusic.py index 38217e0..0cf1989 100644 --- a/xiaomusic/xiaomusic.py +++ b/xiaomusic/xiaomusic.py @@ -2,6 +2,7 @@ import asyncio import json import logging +import math import os import random import re @@ -353,11 +354,12 @@ class XiaoMusic: if self.is_web_music(name): origin_url = url duration, url = await get_web_music_duration(url) - sec = int(duration) + sec = math.ceil(duration) self.log.info(f"网络歌曲 {name} : {origin_url} {url} 的时长 {sec} 秒") else: filename = self.get_filename(name) - sec = int(get_local_music_duration(filename)) + duration = await get_local_music_duration(filename) + sec = math.ceil(duration) self.log.info(f"本地歌曲 {name} : {filename} {url} 的时长 {sec} 秒") if sec <= 0: