mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
25 lines
805 B
Python
25 lines
805 B
Python
|
|
import aiohttp
|
|
from src.configs.api_config import animetrace_url
|
|
|
|
async def animetrace_search_by_url(search_url):
|
|
data = {
|
|
'model': 'anime_model_lovelive',
|
|
'ai_detect':0,
|
|
'is_multi':1,
|
|
'url': search_url
|
|
}
|
|
sort,content = 1,""
|
|
async with aiohttp.ClientSession() as session:
|
|
async with session.post(animetrace_url, data=data) as response:
|
|
if response.status == 200:
|
|
result = await response.json()
|
|
for item in result['data']:
|
|
character = item['character'][0]
|
|
content += f"{sort} :作品名称:{character['work']}, 角色名称:{character['character']}\n"
|
|
sort += 1
|
|
return content
|
|
else:
|
|
return None
|
|
|
|
|