diff options
author | 0w0 <[email protected]> | 2022-09-21 12:04:35 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2022-09-21 12:04:35 +0800 |
commit | 1f458f9b279368354ccad224100abd59566f4ef3 (patch) | |
tree | 712f3ac05765c0e3d8cbd6e292602dc86a132dce /ATRI/plugins | |
parent | 87bb8add6cbfa0797f8b3eba66c643a8045db154 (diff) | |
parent | bd68ad78c8879143e37523d679cb643578db13c5 (diff) | |
download | ATRI-1f458f9b279368354ccad224100abd59566f4ef3.tar.gz ATRI-1f458f9b279368354ccad224100abd59566f4ef3.tar.bz2 ATRI-1f458f9b279368354ccad224100abd59566f4ef3.zip |
🔀 Merge pull request #61 from yangrq1018/main
Request Fix
Diffstat (limited to 'ATRI/plugins')
-rw-r--r-- | ATRI/plugins/anime_search.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ATRI/plugins/anime_search.py b/ATRI/plugins/anime_search.py index 670c766..bf06ece 100644 --- a/ATRI/plugins/anime_search.py +++ b/ATRI/plugins/anime_search.py @@ -9,7 +9,7 @@ from ATRI.utils import request, Translate from ATRI.exceptions import RequestError -URL = "https://api.trace.moe/search?anilistInfo=true&url=" +URL = "https://api.trace.moe/search?anilistInfo=true" _anime_flmt_notice = choice(["慢...慢一..点❤", "冷静1下", "歇会歇会~~"]) @@ -21,9 +21,10 @@ class Anime(Service): @staticmethod async def _request(url: str) -> dict: - aim = URL + url try: - res = await request.get(aim) + resp = await request.get(url) + image_bytes = resp.read() + res = await request.post(URL, data=image_bytes, headers={"Content-Type": "image/jpeg"}) except Exception: raise RequestError("Request failed!") result = res.json() |