diff --git a/efb_qq_plugin_go_cqhttp/GoCQHttp.py b/efb_qq_plugin_go_cqhttp/GoCQHttp.py index 2bb5ca2..5ba1e3c 100644 --- a/efb_qq_plugin_go_cqhttp/GoCQHttp.py +++ b/efb_qq_plugin_go_cqhttp/GoCQHttp.py @@ -164,7 +164,7 @@ class GoCQHttp(BaseClient): main_text, messages, _ = await message_elements_wrapper(context, fmt_forward_msgs, chat) return main_text, messages, [] else: - messages.extend(self.call_msg_decorator(msg_type, msg_data, chat)) + messages.extend(await self.call_msg_decorator(msg_type, msg_data, chat)) return main_text, messages, at_list async def message_elements_wrapper( @@ -707,7 +707,7 @@ class GoCQHttp(BaseClient): asyncio.run(self.coolq_send_message(chat_type[0], chat_type[1], msg.text)) return msg - def call_msg_decorator(self, msg_type: str, *args) -> List[Message]: + async def call_msg_decorator(self, msg_type: str, *args) -> List[Message]: try: func = getattr(self.msg_decorator, "qq_{}_wrapper".format(msg_type)) except AttributeError: @@ -715,7 +715,7 @@ class GoCQHttp(BaseClient): self.logger.error(msg) return self.msg_decorator.qq_unsupported_wrapper(msg) else: - return func(*args) + return await func(*args) if asyncio.iscoroutinefunction(func) else func(*args) async def get_qq_uid(self): res = await self.get_login_info() @@ -1054,7 +1054,7 @@ class GoCQHttp(BaseClient): return "Done" async def async_download_file(self, context, download_url): - res = download_file(download_url) + res = await download_file(download_url) if isinstance(res, str): context["message"] = ("[Download] ") + res await self.send_efb_group_notice(context) diff --git a/efb_qq_plugin_go_cqhttp/MsgDecorator.py b/efb_qq_plugin_go_cqhttp/MsgDecorator.py index 0a2e6b5..97aba09 100644 --- a/efb_qq_plugin_go_cqhttp/MsgDecorator.py +++ b/efb_qq_plugin_go_cqhttp/MsgDecorator.py @@ -22,9 +22,8 @@ class QQMsgProcessor: def __init__(self, instance: "GoCQHttp"): self.inst = instance - pass - def qq_image_wrapper(self, data, chat: Chat = None): + async def qq_image_wrapper(self, data, _: Chat = None): efb_msg = Message() if "url" not in data: efb_msg.type = MsgType.Text @@ -32,13 +31,13 @@ class QQMsgProcessor: return [efb_msg] # flash picture - if "flash" == data.get("type", ""): + if data.get("type", "") == "flash": data["url"] = ( f"https://gchat.qpic.cn/gchatpic_new/1/1-1-" f'{data["file"].replace(".image", "").upper()}/0?term=3%27' ) efb_msg.text = "Send a flash picture." - efb_msg.file = cq_get_image(data["url"]) + efb_msg.file = await cq_get_image(data["url"]) if efb_msg.file is None: efb_msg.type = MsgType.Text efb_msg.text = "[Download image failed, please check on your QQ client]" @@ -56,11 +55,11 @@ class QQMsgProcessor: efb_msg.type = MsgType.Animation return [efb_msg] - def qq_record_wrapper(self, data, chat: Chat = None): # Experimental! + async def qq_record_wrapper(self, data, _: Chat = None): # Experimental! efb_msg = Message() try: efb_msg.type = MsgType.Audio - efb_msg.file = download_voice(data["url"]) + efb_msg.file = await download_voice(data["url"]) mime = magic.from_file(efb_msg.file.name, mime=True) if isinstance(mime, bytes): mime = mime.decode() @@ -72,7 +71,7 @@ class QQMsgProcessor: logging.getLogger(__name__).exception("Failed to download voice") return [efb_msg] - def qq_share_wrapper(self, data, chat: Chat = None): + def qq_share_wrapper(self, data, _: Chat = None): efb_msg = Message( type=MsgType.Link, text="", @@ -85,7 +84,7 @@ class QQMsgProcessor: ) return [efb_msg] - def qq_location_wrapper(self, data, chat: Chat = None): + def qq_location_wrapper(self, data, _: Chat = None): efb_msg = Message( text=data["content"], type=MsgType.Location, @@ -93,11 +92,11 @@ class QQMsgProcessor: ) return [efb_msg] - def qq_shake_wrapper(self, data, chat: Chat = None): + def qq_shake_wrapper(self, _, __: Chat = None): efb_msg = Message(type=MsgType.Text, text=("[Your friend shakes you!]")) return [efb_msg] - def qq_contact_wrapper(self, data, chat: Chat = None): + def qq_contact_wrapper(self, data, _: Chat = None): uid = data["id"] contact_type = data["type"] efb_msg = Message( @@ -106,7 +105,7 @@ class QQMsgProcessor: ) return [efb_msg] - def qq_bface_wrapper(self, data, chat: Chat = None): + def qq_bface_wrapper(self, _, __: Chat = None): efb_msg = Message( type=MsgType.Unsupported, text=("[Here comes the BigFace Emoji, please check it on your phone]"), @@ -117,7 +116,7 @@ class QQMsgProcessor: # todo this function's maybe not necessary? pass - def qq_sign_wrapper(self, data, chat: Chat = None): + def qq_sign_wrapper(self, data, _: Chat = None): location = ("at {}").format(data["location"]) if "location" in data else ("at Unknown Place") title = "" if "title" not in data else (("with title {}").format(data["title"])) efb_msg = Message( @@ -126,7 +125,7 @@ class QQMsgProcessor: ) return [efb_msg] - def qq_rich_wrapper(self, data: dict, chat: Chat = None): # Buggy, Help needed + async def qq_rich_wrapper(self, data: dict, chat: Chat = None): # Buggy, Help needed efb_messages = list() efb_msg = Message( type=MsgType.Unsupported, @@ -137,13 +136,13 @@ class QQMsgProcessor: efb_messages.append(efb_msg) # Optimizations for rich messages # Group Broadcast - _ = self.qq_group_broadcast_wrapper(data, chat) + _ = await self.qq_group_broadcast_wrapper(data, chat) if _ is not None: efb_messages.append(_) return efb_messages - def qq_music_wrapper(self, data, chat: Chat = None): + def qq_music_wrapper(self, data, _: Chat = None): efb_msg = Message() if data["type"] == "163": # Netease Cloud Music efb_msg.type = MsgType.Text @@ -193,7 +192,7 @@ class QQMsgProcessor: efb_msg.filename = data["filename"] return efb_msg - def qq_group_broadcast_wrapper(self, data, chat: Chat): + async def qq_group_broadcast_wrapper(self, data, chat: Chat): try: at_list = {} content_data = json.loads(data["content"]) @@ -212,7 +211,7 @@ class QQMsgProcessor: data["url"] = "http://gdynamic.qpic.cn/gdynamic/{}/628".format( content_data["mannounce"]["pic"][0]["url"] ) - efb_message = self.qq_image_wrapper(data)[0] + efb_message = (await self.qq_image_wrapper(data))[0] efb_message.text = text efb_message.substitutions = Substitutions(at_list) return [efb_message] @@ -241,7 +240,7 @@ class QQMsgProcessor: if "pics" in html.unescape(notice_data[0]["msg"]): # Picture Attached # Assuming there's only one picture data["url"] = "http://gdynamic.qpic.cn/gdynamic/{}/628".format(notice_data[0]["msg"]["pics"][0]["id"]) - efb_message = self.qq_image_wrapper(data)[0] + efb_message = (await self.qq_image_wrapper(data))[0] efb_message.text = text efb_message.substitutions = Substitutions(at_list) return [efb_message] @@ -250,13 +249,13 @@ class QQMsgProcessor: except Exception: return None - def qq_xml_wrapper(self, data, chat: Chat = None): + def qq_xml_wrapper(self, data, _: Chat = None): efb_msg = Message() efb_msg.type = MsgType.Text efb_msg.text = data["data"] return [efb_msg] - def qq_json_wrapper(self, data, chat: Chat = None): + def qq_json_wrapper(self, data, _: Chat = None): efb_msg = Message() efb_msg.type = MsgType.Text efb_msg.text = data["data"] @@ -338,14 +337,14 @@ class QQMsgProcessor: return [efb_msg] - def qq_video_wrapper(self, data, chat: Chat = None): - res = download_file(data["url"]) + async def qq_video_wrapper(self, data, _: Chat = None): + res = await download_file(data["url"]) mime = magic.from_file(res.name, mime=True) if isinstance(mime, bytes): mime = mime.decode() efb_msg = Message(type=MsgType.Video, file=res, filename=res.name, mime=mime) return [efb_msg] - def qq_unsupported_wrapper(self, data, chat: Chat = None): + def qq_unsupported_wrapper(self, data, _: Chat = None): efb_msg = Message(type=MsgType.Unsupported, text=data) return [efb_msg] diff --git a/efb_qq_plugin_go_cqhttp/Utils.py b/efb_qq_plugin_go_cqhttp/Utils.py index 8ba0b6c..8258aa5 100644 --- a/efb_qq_plugin_go_cqhttp/Utils.py +++ b/efb_qq_plugin_go_cqhttp/Utils.py @@ -1,10 +1,10 @@ import logging import tempfile -from typing import IO, Optional +from typing import IO, Optional, Union +import httpx import pilk import pydub -import requests from ehforwarderbot import Message, coordinator logger = logging.getLogger(__name__) @@ -641,20 +641,42 @@ qq_sface_list = { } -def cq_get_image(image_link: str) -> Optional[IO]: # Download image from QQ +async def async_get_file(url: str) -> IO: + temp_file = tempfile.NamedTemporaryFile() try: - resp = requests.get(image_link) - file = tempfile.NamedTemporaryFile() - file.write(resp.content) - if file.seek(0, 2) <= 0: - raise EOFError("File downloaded is Empty") - file.seek(0) + async with httpx.AsyncClient() as client: + resp = await client.get(url) + temp_file.write(resp.content) + if temp_file.seek(0, 2) <= 0: + raise EOFError("File downloaded is Empty") + temp_file.seek(0) + except Exception as e: + temp_file.close() + raise e + return temp_file + + +def sync_get_file(url: str) -> IO: + temp_file = tempfile.NamedTemporaryFile() + try: + resp = httpx.get(url) + temp_file.write(resp.content) + if temp_file.seek(0, 2) <= 0: + raise EOFError("File downloaded is Empty") + temp_file.seek(0) + except Exception as e: + temp_file.close() + raise e + return temp_file + + +async def cq_get_image(image_link: str) -> Optional[IO]: # Download image from QQ + try: + return await async_get_file(image_link) except Exception as e: - file.close() logger.warning("File download failed.") logger.warning(str(e)) return None - return file def async_send_messages_to_master(msg: Message): @@ -702,61 +724,36 @@ def param_spliter(str_param): return param -def download_file(download_url): +async def download_file(download_url: str) -> Union[IO, str]: try: - resp = requests.get(download_url) - file = tempfile.NamedTemporaryFile() - file.write(resp.content) - if file.seek(0, 2) <= 0: - raise EOFError("File downloaded is Empty") - file.seek(0) + return await async_get_file(download_url) except Exception as e: - file.close() logger.warning("Error occurs when downloading files: " + str(e)) - return ("Error occurs when downloading files: ") + str(e) - return file + return "Error occurs when downloading files: " + str(e) def download_user_avatar(uid: str): url = "https://q1.qlogo.cn/g?b=qq&nk={}&s=0".format(uid) try: - resp = requests.get(url) - file = tempfile.NamedTemporaryFile() - file.write(resp.content) - if file.seek(0, 2) <= 0: - raise EOFError("File downloaded is Empty") - file.seek(0) + return sync_get_file(url) except Exception as e: - file.close() logger.warning("Error occurs when downloading files: " + str(e)) raise - return file def download_group_avatar(uid: str): url = "https://p.qlogo.cn/gh/{}/{}/".format(uid, uid) try: - resp = requests.get(url) - file = tempfile.NamedTemporaryFile() - file.write(resp.content) - if file.seek(0, 2) <= 0: - raise EOFError("File downloaded is Empty") - file.seek(0) + return sync_get_file(url) except Exception as e: - file.close() logger.warning("Error occurs when downloading files: " + str(e)) raise - return file -def download_voice(voice_url: str): +async def download_voice(voice_url: str): + origin_file, audio_file = None, None try: - resp = requests.get(voice_url) - origin_file = tempfile.NamedTemporaryFile() - origin_file.write(resp.content) - if origin_file.seek(0, 2) <= 0: - raise EOFError("File downloaded is Empty") - origin_file.seek(0) + origin_file = await async_get_file(voice_url) silk_header = origin_file.read(10) origin_file.seek(0) if b"#!SILK_V3" in silk_header: @@ -769,8 +766,10 @@ def download_voice(voice_url: str): else: audio_file = origin_file except Exception as e: - origin_file.close() - audio_file.close() + if origin_file: + origin_file.close() + if audio_file: + audio_file.close() logger.warning("Error occurs when downloading files: " + str(e)) raise return audio_file diff --git a/pdm.lock b/pdm.lock index 3977011..0bfdb09 100644 --- a/pdm.lock +++ b/pdm.lock @@ -130,6 +130,7 @@ dependencies = [ [[package]] name = "efb-qq-slave" version = "2.0.1.dev0" +requires_python = ">=3.6" git = "https://github.com/milkice233/efb-qq-slave" ref = "master" revision = "0df5ddc826a6c502f0878f0541165fbac7a1f0fd" @@ -242,12 +243,12 @@ dependencies = [ [[package]] name = "httpx" -version = "0.23.0" +version = "0.23.3" requires_python = ">=3.7" summary = "The next generation HTTP client." dependencies = [ "certifi", - "httpcore<0.16.0,>=0.15.0", + "httpcore<0.17.0,>=0.15.0", "rfc3986[idna2008]<2,>=1.3", "sniffio", ] @@ -637,7 +638,7 @@ summary = "Backport of pathlib-compatible object wrapper for zip files" [metadata] lock_version = "4.0" -content_hash = "sha256:31a92e98cb57c2c24915316aca43a1756ad1d0ad8d5ffdd78631463724d61bd5" +content_hash = "sha256:087e4b39eeaa0626de49f9d3ff05ff764d0880addc24ee5eff729c5470ad6588" [metadata.files] "aiocqhttp 1.4.3" = [ @@ -661,7 +662,9 @@ content_hash = "sha256:31a92e98cb57c2c24915316aca43a1756ad1d0ad8d5ffdd7863146372 {url = "https://files.pythonhosted.org/packages/66/02/ca9061e93c487a897859e3a41f6c1a4f494038d2791382169b9a0c528175/anyio-3.3.4.tar.gz", hash = "sha256:67da67b5b21f96b9d3d65daa6ea99f5d5282cb09f50eb4456f8fb51dffefc3ff"}, {url = "https://files.pythonhosted.org/packages/67/c4/fd50bbb2fb72532a4b778562e28ba581da15067cfb2537dbd3a2e64689c1/anyio-3.6.1.tar.gz", hash = "sha256:413adf95f93886e442aea925f3ee43baa5a765a64a0f52c6081894f9992fdd0b"}, {url = "https://files.pythonhosted.org/packages/72/47/0c30d51c30d23eecead360e8624ad3972ebd8f9933265a91fca1372d37cf/anyio-3.1.0-py3-none-any.whl", hash = "sha256:5e335cef65fbd1a422bbfbb4722e8e9a9fadbd8c06d5afe9cd614d12023f6e5a"}, + {url = "https://files.pythonhosted.org/packages/77/2b/b4c0b7a3f3d61adb1a1e0b78f90a94e2b6162a043880704b7437ef297cad/anyio-3.6.2-py3-none-any.whl", hash = "sha256:fbbe32bd270d2a2ef3ed1c5d45041250284e31fc0a4df4a5a6071842051a51e3"}, {url = "https://files.pythonhosted.org/packages/89/c7/76b61d971bd463ed32d093c61a70d757a8edd7f7baaec0bdabc64ed9f376/anyio-3.3.2-py3-none-any.whl", hash = "sha256:c32da314c510b34a862f5afeaf8a446ffed2c2fde21583e654bd71ecfb5b744b"}, + {url = "https://files.pythonhosted.org/packages/8b/94/6928d4345f2bc1beecbff03325cad43d320717f51ab74ab5a571324f4f5a/anyio-3.6.2.tar.gz", hash = "sha256:25ea0d673ae30af41a0c442f81cf3b38c7e79fdc7b60335a4c14e05eb0947421"}, {url = "https://files.pythonhosted.org/packages/94/72/c728ad9e34f53be06f4dfbff4d511907bafb46920f10dc34836e58bd6894/anyio-3.3.0-py3-none-any.whl", hash = "sha256:929a6852074397afe1d989002aa96d457e3e1e5441357c60d03e7eea0e65e1b0"}, {url = "https://files.pythonhosted.org/packages/98/3e/1432e7d8d9f71676d6638b4feb6285f53575239f7b527a95e85b7e888bba/anyio-3.3.1-py3-none-any.whl", hash = "sha256:d7c604dd491eca70e19c78664d685d5e4337612d574419d503e76f5d7d1590bd"}, {url = "https://files.pythonhosted.org/packages/99/0d/65165f99e5f4f3b4c43a5ed9db0fb7aa655f5a58f290727a30528a87eb45/anyio-3.0.0.tar.gz", hash = "sha256:b553598332c050af19f7d41f73a7790142f5bc3d5eb8bd82f5e515ec22019bd9"}, @@ -777,9 +780,9 @@ content_hash = "sha256:31a92e98cb57c2c24915316aca43a1756ad1d0ad8d5ffdd7863146372 {url = "https://files.pythonhosted.org/packages/42/98/44c3e51a0655eae75adefee028c9bada7427a90f63105e54f5e735946f50/httpcore-0.15.0.tar.gz", hash = "sha256:18b68ab86a3ccf3e7dc0f43598eaddcf472b602aba29f9aa6ab85fe2ada3980b"}, {url = "https://files.pythonhosted.org/packages/ad/b9/260603ca0913072a10a4367c2dca9998706812a8c1f4558eca510f85ae16/httpcore-0.15.0-py3-none-any.whl", hash = "sha256:1105b8b73c025f23ff7c36468e4432226cbb959176eab66864b8e31c4ee27fa6"}, ] -"httpx 0.23.0" = [ - {url = "https://files.pythonhosted.org/packages/43/cd/677173d194b4839e5b196709e3819ffca2a4bc58b0538f4ae4be877ad480/httpx-0.23.0.tar.gz", hash = "sha256:f28eac771ec9eb4866d3fb4ab65abd42d38c424739e80c08d8d20570de60b0ef"}, - {url = "https://files.pythonhosted.org/packages/e9/fd/d8ff4bbf7ade1c9d60b53bf8234b44dcb2a9fcc7ae6933ae80ba38582f3e/httpx-0.23.0-py3-none-any.whl", hash = "sha256:42974f577483e1e932c3cdc3cd2303e883cbfba17fe228b0f63589764d7b9c4b"}, +"httpx 0.23.3" = [ + {url = "https://files.pythonhosted.org/packages/ac/a2/0260c0f5d73bdf06e8d3fc1013a82b9f0633dc21750c9e3f3cb1dba7bb8c/httpx-0.23.3-py3-none-any.whl", hash = "sha256:a211fcce9b1254ea24f0cd6af9869b3d29aba40154e947d2a07bb499b3e310d6"}, + {url = "https://files.pythonhosted.org/packages/f5/50/04d5e8ee398a10c767a341a25f59ff8711ae3adf0143c7f8b45fc560d72d/httpx-0.23.3.tar.gz", hash = "sha256:9818458eb565bb54898ccb9b8b251a28785dd4a55afbc23d0eb410754fe7d0f9"}, ] "humanize 4.2.3" = [ {url = "https://files.pythonhosted.org/packages/12/b0/da61e315115d563f8ef098836c237f1de723aa434b0ffbfd2290b165985a/humanize-4.2.3-py3-none-any.whl", hash = "sha256:bed628920d45cd5018abb095710f0c03a8336d6ac0790e7647c6a328f3880b81"}, @@ -986,12 +989,16 @@ content_hash = "sha256:31a92e98cb57c2c24915316aca43a1756ad1d0ad8d5ffdd7863146372 {url = "https://files.pythonhosted.org/packages/44/e5/4fea13230bcebf24b28c0efd774a2dd65a0937a2d39e94a4503438b078ed/PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, {url = "https://files.pythonhosted.org/packages/4d/7d/c2ab8da648cd2b937de11fb35649b127adab4851cbeaf5fd9b60a2dab0f7/PyYAML-6.0-cp36-cp36m-win32.whl", hash = "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293"}, {url = "https://files.pythonhosted.org/packages/55/e3/507a92589994a5b3c3d7f2a7a066339d6ff61c5c839bae56f7eff03d9c7b/PyYAML-6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86"}, + {url = "https://files.pythonhosted.org/packages/56/8f/e8b49ad21d26111493dc2d5cae4d7efbd0e2e065440665f5023515f87f64/PyYAML-6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:432557aa2c09802be39460360ddffd48156e30721f5e8d917f01d31694216782"}, + {url = "https://files.pythonhosted.org/packages/59/00/30e33fcd2a4562cd40c49c7740881009240c5cbbc0e41ca79ca4bba7c24b/PyYAML-6.0-cp311-cp311-win_amd64.whl", hash = "sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf"}, {url = "https://files.pythonhosted.org/packages/5e/f4/7b4bb01873be78fc9fde307f38f62e380b7111862c165372cf094ca2b093/PyYAML-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc"}, {url = "https://files.pythonhosted.org/packages/63/6b/f5dc7942bac17192f4ef00b2d0cdd1ae45eea453d05c1944c0573debe945/PyYAML-6.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34"}, {url = "https://files.pythonhosted.org/packages/67/d4/b95266228a25ef5bd70984c08b4efce2c035a4baa5ccafa827b266e3dc36/PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174"}, + {url = "https://files.pythonhosted.org/packages/68/3f/c027422e49433239267c62323fbc6320d6ac8d7d50cf0cb2a376260dad5f/PyYAML-6.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f"}, {url = "https://files.pythonhosted.org/packages/6c/3d/524c642f3db37e7e7ab8d13a3f8b0c72d04a619abc19100097d987378fc6/PyYAML-6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba"}, {url = "https://files.pythonhosted.org/packages/74/68/3c13deaa496c14a030c431b7b828d6b343f79eb241b4848c7918091a64a2/PyYAML-6.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92"}, {url = "https://files.pythonhosted.org/packages/77/da/e845437ffe0dffae4e7562faf23a4f264d886431c5d2a2816c853288dc8e/PyYAML-6.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3"}, + {url = "https://files.pythonhosted.org/packages/7f/d9/6a0d14ac8d3b5605dc925d177c1d21ee9f0b7b39287799db1e50d197b2f4/PyYAML-6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:afa17f5bc4d1b10afd4466fd3a44dc0e245382deca5b3c353d8b757f9e3ecb8d"}, {url = "https://files.pythonhosted.org/packages/81/59/561f7e46916b78f3c4cab8d0c307c81656f11e32c846c0c97fda0019ed76/PyYAML-6.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4"}, {url = "https://files.pythonhosted.org/packages/89/26/0bfd7b756b34c68f8fd158b7bc762b6b1705fc1b3cebf4cdbb53fd9ea75b/PyYAML-6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57"}, {url = "https://files.pythonhosted.org/packages/91/49/d46d7b15cddfa98533e89f3832f391aedf7e31f37b4d4df3a7a7855a7073/PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, @@ -1002,6 +1009,7 @@ content_hash = "sha256:31a92e98cb57c2c24915316aca43a1756ad1d0ad8d5ffdd7863146372 {url = "https://files.pythonhosted.org/packages/a8/5b/c4d674846ea4b07ee239fbf6010bcc427c4e4552ba5655b446e36b9a40a7/PyYAML-6.0-cp38-cp38-win_amd64.whl", hash = "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07"}, {url = "https://files.pythonhosted.org/packages/b3/85/79b9e5b4e8d3c0ac657f4e8617713cca8408f6cdc65d2ee6554217cedff1/PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4"}, {url = "https://files.pythonhosted.org/packages/b7/09/2f6f4851bbca08642fef087bade095edc3c47f28d1e7bff6b20de5262a77/PyYAML-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a"}, + {url = "https://files.pythonhosted.org/packages/cb/5f/05dd91f5046e2256e35d885f3b8f0f280148568f08e1bf20421887523e9a/PyYAML-6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:81957921f441d50af23654aa6c5e5eaf9b06aba7f0a19c18a538dc7ef291c5a1"}, {url = "https://files.pythonhosted.org/packages/d1/c0/4fe04181b0210ee2647cfbb89ecd10a36eef89f10d8aca6a192c201bbe58/PyYAML-6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d"}, {url = "https://files.pythonhosted.org/packages/d7/42/7ad4b6d67a16229496d4f6e74201bdbebcf4bc1e87d5a70c9297d4961bd2/PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287"}, {url = "https://files.pythonhosted.org/packages/db/4e/74bc723f2d22677387ab90cd9139e62874d14211be7172ed8c9f9a7c81a9/PyYAML-6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b"}, @@ -1009,6 +1017,8 @@ content_hash = "sha256:31a92e98cb57c2c24915316aca43a1756ad1d0ad8d5ffdd7863146372 {url = "https://files.pythonhosted.org/packages/eb/5f/6e6fe6904e1a9c67bc2ca5629a69e7a5a0b17f079da838bab98a1e548b25/PyYAML-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9"}, {url = "https://files.pythonhosted.org/packages/ef/ad/b443cce94539e57e1a745a845f95c100ad7b97593d7e104051e43f730ecd/PyYAML-6.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b"}, {url = "https://files.pythonhosted.org/packages/f5/6f/b8b4515346af7c33d3b07cd8ca8ea0700ca72e8d7a750b2b87ac0268ca4e/PyYAML-6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b"}, + {url = "https://files.pythonhosted.org/packages/f8/54/799b059314b13e1063473f76e908f44106014d18f54b16c83a16edccd5ec/PyYAML-6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d4b0ba9512519522b118090257be113b9468d804b19d63c71dbcf4a48fa32358"}, + {url = "https://files.pythonhosted.org/packages/fc/48/531ecd926fe0a374346dd811bf1eda59a95583595bb80eadad511f3269b8/PyYAML-6.0-cp311-cp311-win32.whl", hash = "sha256:bfaef573a63ba8923503d27530362590ff4f576c626d86a9fed95822a8255fd7"}, ] "quart 0.17.0" = [ {url = "https://files.pythonhosted.org/packages/09/d9/c1e8cdb929202f6bb4fae847b440d49282556ab9990fa4d2aa50632a9764/Quart-0.17.0-py3-none-any.whl", hash = "sha256:69480e7384935feff1f50293a8cb70c5d31f568af94ed792d043bb368b50bd50"}, @@ -1030,6 +1040,7 @@ content_hash = "sha256:31a92e98cb57c2c24915316aca43a1756ad1d0ad8d5ffdd7863146372 {url = "https://files.pythonhosted.org/packages/9e/cb/938214ac358fbef7058343b3765c79a1b7ed0c366f7f992ce7ff38335652/ruamel.yaml-0.17.21-py3-none-any.whl", hash = "sha256:742b35d3d665023981bd6d16b3d24248ce5df75fdb4e2924e93a05c1f8b61ca7"}, ] "ruamel.yaml.clib 0.2.6" = [ + {url = "https://files.pythonhosted.org/packages/0c/a5/6d803d5ad2fb2a0706dd715b1b192eeffa93d4a6d7ba604943f60210fbf3/ruamel.yaml.clib-0.2.6-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:066f886bc90cc2ce44df8b5f7acfc6a7e2b2e672713f027136464492b0c34d7c"}, {url = "https://files.pythonhosted.org/packages/10/7b/2f9e14ae5be9a94bed7a4c1aa040a068fe053dd199330a46e7f42b89f4bf/ruamel.yaml.clib-0.2.6-cp37-cp37m-win32.whl", hash = "sha256:a49e0161897901d1ac9c4a79984b8410f450565bbad64dbfcbf76152743a0cdb"}, {url = "https://files.pythonhosted.org/packages/15/7c/e65492dc1c311655760fb20a9f2512f419403fcdc9ada6c63f44d7fe7062/ruamel.yaml.clib-0.2.6-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7f7ecb53ae6848f959db6ae93bdff1740e651809780822270eab111500842a84"}, {url = "https://files.pythonhosted.org/packages/22/80/01ebb08cbcba7e36ee7e2c78c1e2dabbc3f932ddd3e9eb225d1358487907/ruamel.yaml.clib-0.2.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:6e7be2c5bcb297f5b82fee9c665eb2eb7001d1050deaba8471842979293a80b0"}, @@ -1038,20 +1049,24 @@ content_hash = "sha256:31a92e98cb57c2c24915316aca43a1756ad1d0ad8d5ffdd7863146372 {url = "https://files.pythonhosted.org/packages/26/aa/d80ca2e1bb30f3b1052aa9a0f9151f214006eeeb124b3629e204603d1dcd/ruamel.yaml.clib-0.2.6-cp39-cp39-win32.whl", hash = "sha256:3fb9575a5acd13031c57a62cc7823e5d2ff8bc3835ba4d94b921b4e6ee664104"}, {url = "https://files.pythonhosted.org/packages/27/c0/cead4d7f6dc82b222cc63032c29c8f82cb34b366ae48c285dfafa5c4a176/ruamel.yaml.clib-0.2.6-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:cfdb9389d888c5b74af297e51ce357b800dd844898af9d4a547ffc143fa56751"}, {url = "https://files.pythonhosted.org/packages/2a/25/5b1dfc832ef3b83576c546d1fb3e27f136022cdd1008aab290a1e28ef220/ruamel.yaml.clib-0.2.6-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:72a2b8b2ff0a627496aad76f37a652bcef400fd861721744201ef1b45199ab78"}, + {url = "https://files.pythonhosted.org/packages/2b/79/61f772b774361ac30df279364b6121a52406250b5abe158a76a464580414/ruamel.yaml.clib-0.2.6-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:210c8fcfeff90514b7133010bf14e3bad652c8efde6b20e00c43854bf94fa5a6"}, {url = "https://files.pythonhosted.org/packages/35/29/c026b3aee8033119f0415ee0de200d09934812320b7f587199b29cb9218c/ruamel.yaml.clib-0.2.6-cp35-cp35m-win32.whl", hash = "sha256:ada3f400d9923a190ea8b59c8f60680c4ef8a4b0dfae134d2f2ff68429adfab5"}, {url = "https://files.pythonhosted.org/packages/38/20/0b47e6daad9c7b6e0cd49ab3c47a823163d70cea7e1fce2baf1f9eaf7242/ruamel.yaml.clib-0.2.6-cp310-cp310-win32.whl", hash = "sha256:1070ba9dd7f9370d0513d649420c3b362ac2d687fe78c6e888f5b12bf8bc7bee"}, {url = "https://files.pythonhosted.org/packages/3e/36/f1e3b5a0507662a66f156518457ffaf530c818f204467a5c532fc44056f9/ruamel.yaml.clib-0.2.6-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:1866cf2c284a03b9524a5cc00daca56d80057c5ce3cdc86a52020f4c720856f0"}, {url = "https://files.pythonhosted.org/packages/49/8c/be4e675b5c38497f10e3eba89bf141ac7aa085db1a541294f0b60e4237a7/ruamel.yaml.clib-0.2.6-cp37-cp37m-win_amd64.whl", hash = "sha256:bf75d28fa071645c529b5474a550a44686821decebdd00e21127ef1fd566eabe"}, {url = "https://files.pythonhosted.org/packages/4a/8e/f187926adf40bcea2709e903f0efa7ae7cc704e31fe967f317a0d5dbd422/ruamel.yaml.clib-0.2.6-cp39-cp39-win_amd64.whl", hash = "sha256:825d5fccef6da42f3c8eccd4281af399f21c02b32d98e113dbc631ea6a6ecbc7"}, {url = "https://files.pythonhosted.org/packages/50/a2/6ba867eb0fad21a3360c11c6b64f004a40f82753ab2d305806e0c2398e04/ruamel.yaml.clib-0.2.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d67f273097c368265a7b81e152e07fb90ed395df6e552b9fa858c6d2c9f42502"}, + {url = "https://files.pythonhosted.org/packages/50/ef/c76cbfe816e12c4181305589ec0a7933bf34b2613cfbca6b94e1400d2d20/ruamel.yaml.clib-0.2.6-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:d3c620a54748a3d4cf0bcfe623e388407c8e85a4b06b8188e126302bcab93ea8"}, {url = "https://files.pythonhosted.org/packages/63/bf/231aa2913e416a118ba767cc36a5cb6322998e2d96f96067735a5f4b077d/ruamel.yaml.clib-0.2.6-cp38-cp38-win32.whl", hash = "sha256:89221ec6d6026f8ae859c09b9718799fea22c0e8da8b766b0b2c9a9ba2db326b"}, {url = "https://files.pythonhosted.org/packages/65/08/5998bd9f09036b83f70aebb90f6b683301c0431feb05f00222921d857db3/ruamel.yaml.clib-0.2.6-cp36-cp36m-win32.whl", hash = "sha256:9efef4aab5353387b07f6b22ace0867032b900d8e91674b5d8ea9150db5cae94"}, {url = "https://files.pythonhosted.org/packages/68/96/d741e85598f18f18d85624f2bc8df42ed892d10f4c651ffa6734a184e24e/ruamel.yaml.clib-0.2.6-cp310-cp310-win_amd64.whl", hash = "sha256:77df077d32921ad46f34816a9a16e6356d8100374579bc35e15bab5d4e9377de"}, + {url = "https://files.pythonhosted.org/packages/6c/1a/fe3e77e4fa2064a89918a825be5e0a3edde1df0dc7a5772ce66ba8552232/ruamel.yaml.clib-0.2.6-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:1b4139a6ffbca8ef60fdaf9b33dec05143ba746a6f0ae0f9d11d38239211d335"}, {url = "https://files.pythonhosted.org/packages/70/f9/6dec8d3209b819433e18bf9cdf0f0dcc8dabf5dfa0098eba999e4b813b41/ruamel.yaml.clib-0.2.6-cp36-cp36m-win_amd64.whl", hash = "sha256:846fc8336443106fe23f9b6d6b8c14a53d38cef9a375149d61f99d78782ea468"}, {url = "https://files.pythonhosted.org/packages/8b/25/08e5ad2431a028d0723ca5540b3af6a32f58f25e83c6dda4d0fcef7288a3/ruamel.yaml.clib-0.2.6.tar.gz", hash = "sha256:4ff604ce439abb20794f05613c374759ce10e3595d1867764dd1ae675b85acbd"}, {url = "https://files.pythonhosted.org/packages/98/8a/ba37489b423916162b086b01c7c18001cf297350694180468e1698085c58/ruamel.yaml.clib-0.2.6-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:78988ed190206672da0f5d50c61afef8f67daa718d614377dcd5e3ed85ab4a99"}, {url = "https://files.pythonhosted.org/packages/ba/2c/076d00f31f9476ccad3a6a5446ee30c5f0921012d714c76f3111e29b06ab/ruamel.yaml.clib-0.2.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:dc6a613d6c74eef5a14a214d433d06291526145431c3b964f5e16529b1842bed"}, {url = "https://files.pythonhosted.org/packages/bd/18/bd01961fefe36f3c6ed6c73bb84621e4c87a75bccb66b4a41ec248c58cb0/ruamel.yaml.clib-0.2.6-cp35-cp35m-win_amd64.whl", hash = "sha256:de9c6b8a1ba52919ae919f3ae96abb72b994dd0350226e28f3686cb4f142165c"}, + {url = "https://files.pythonhosted.org/packages/cb/d1/2e196f1c0b7e419798ca5dbaf1d6e8f0008be76f312ccd18d868e1cdf5d2/ruamel.yaml.clib-0.2.6-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:61bc5e5ca632d95925907c569daa559ea194a4d16084ba86084be98ab1cec1c6"}, {url = "https://files.pythonhosted.org/packages/d1/17/630d1d28e0fc442115280f3928b8a2b78a47b5c75bb619d16bfc4d046a69/ruamel.yaml.clib-0.2.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0847201b767447fc33b9c235780d3aa90357d20dd6108b92be544427bea197dd"}, {url = "https://files.pythonhosted.org/packages/e1/c6/a8ed2b252c9a1018ea1758bbfa6bcd1b4965009e4f9040e1d0456417d7ef/ruamel.yaml.clib-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:221eca6f35076c6ae472a531afa1c223b9c29377e62936f61bc8e6e8bdc5f9e7"}, {url = "https://files.pythonhosted.org/packages/f9/be/d2e098e62a9b18b67cb5b44651984014ff5584100074bcb68b1483e54dc1/ruamel.yaml.clib-0.2.6-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:7b2927e92feb51d830f531de4ccb11b320255ee95e791022555971c466af4527"}, @@ -1067,10 +1082,6 @@ content_hash = "sha256:31a92e98cb57c2c24915316aca43a1756ad1d0ad8d5ffdd7863146372 "sniffio 1.2.0" = [ {url = "https://files.pythonhosted.org/packages/52/b0/7b2e028b63d092804b6794595871f936aafa5e9322dcaaad50ebf67445b3/sniffio-1.2.0-py3-none-any.whl", hash = "sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663"}, {url = "https://files.pythonhosted.org/packages/a6/ae/44ed7978bcb1f6337a3e2bef19c941de750d73243fc9389140d62853b686/sniffio-1.2.0.tar.gz", hash = "sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de"}, - {url = "https://files.pythonhosted.org/packages/ad/e5/63342a59850c6d285af0df92c86a778e1753235d6d392b9ae184217af852/sniffio-1.1.0.tar.gz", hash = "sha256:8e3810100f69fe0edd463d02ad407112542a11ffdc29f67db2bf3771afb87a21"}, - {url = "https://files.pythonhosted.org/packages/b3/82/4bd4b7d9c0d1dc0fbfbc2a1e00138e7f3ab85bc239358fe9b78aa2ab586d/sniffio-1.1.0-py3-none-any.whl", hash = "sha256:20ed6d5b46f8ae136d00b9dcb807615d83ed82ceea6b2058cecb696765246da5"}, - {url = "https://files.pythonhosted.org/packages/c8/83/0e3953535271855718993595c582a0af7726b41beba683e63e1c3abc1982/sniffio-1.0.0.tar.gz", hash = "sha256:2e9b81429e3b7c9e119fcee2673ee3be3229982adc68b3f59317863aba05ebb7"}, - {url = "https://files.pythonhosted.org/packages/ca/08/58f3b857b8bba832983e8c5dce5e3f8c677a5527e41cf61ff45effc78cae/sniffio-1.0.0-py3-none-any.whl", hash = "sha256:afb4997584a920e6e378a81ded2b3e71a696b85a68c4bfbe4dadf1ba57a9ef45"}, ] "tempora 5.0.2" = [ {url = "https://files.pythonhosted.org/packages/4f/7e/872038fa04eeb69b7832a10ecc04f52d9950c41333cfaf2966fd5b06e65c/tempora-5.0.2-py3-none-any.whl", hash = "sha256:e65d32ae68ad772ee738d802689f689b3f883e165e8dadd39aa89ef317b12b99"}, diff --git a/pyproject.toml b/pyproject.toml index db21514..dc6cf1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,6 @@ dependencies = [ "efb-qq-slave @ git+https://github.com/milkice233/efb-qq-slave@master", "ehforwarderbot~=2.1.1", "PyYAML~=6.0", - "requests~=2.27.1", "python-magic~=0.4.25", "Pillow~=9.0.1", "aiocqhttp~=1.4.3", @@ -14,6 +13,7 @@ dependencies = [ "hypercorn~=0.13.2", "pilk~=0.0.2", "pydub~=0.25.1", + "httpx>=0.23.3", ] requires-python = ">=3.7" license = { text = "AGPL-3.0-only" }