fix
This commit is contained in:
@ -29,3 +29,16 @@ async def webhook_message(background_tasks: BackgroundTasks,
|
||||
args = request.query_params
|
||||
background_tasks.add_task(start_webhook_chain, body, form, args)
|
||||
return schemas.Response(success=True)
|
||||
|
||||
|
||||
@router.get("/", summary="Webhook消息响应", response_model=schemas.Response)
|
||||
async def webhook_message(background_tasks: BackgroundTasks,
|
||||
token: str, request: Request) -> Any:
|
||||
"""
|
||||
Webhook响应
|
||||
"""
|
||||
if token != settings.API_TOKEN:
|
||||
return schemas.Response(success=False, message="token认证不通过")
|
||||
args = request.query_params
|
||||
background_tasks.add_task(start_webhook_chain, None, None, args)
|
||||
return schemas.Response(success=True)
|
||||
|
@ -40,14 +40,10 @@ class EmbyModule(_ModuleBase):
|
||||
:param args: 请求参数
|
||||
:return: 字典,解析为消息时需要包含:title、text、image
|
||||
"""
|
||||
if form.get("data"):
|
||||
if form and form.get("data"):
|
||||
result = form.get("data")
|
||||
else:
|
||||
pairs = args.split("&")
|
||||
result = {}
|
||||
for pair in pairs:
|
||||
key, value = pair.split("=")
|
||||
result[key] = value
|
||||
result = dict(args)
|
||||
return self.emby.get_webhook_message(result)
|
||||
|
||||
def media_exists(self, mediainfo: MediaInfo, itemid: str = None) -> Optional[ExistMediaInfo]:
|
||||
|
Reference in New Issue
Block a user