fix webhook
This commit is contained in:
@ -197,7 +197,7 @@ docker pull jxxghp/moviepilot:latest
|
||||
- 通过下载器监控实现资源下载后自动整理入库刮削。
|
||||
- 通过微信/Telegram/Slack远程搜索下载、订阅和管理设置,其中Telegram将会自动添加操作菜单。微信回调相对路径为`/api/v1/message/`。
|
||||
- 通过WEB进行管理,将WEB添加到手机桌面获得类App使用效果,管理界面端口:`3000`。
|
||||
- 设置媒体服务器Webhook,通过MoviePilot发送播放通知,以及后续播放限速等插件功能。Webhook回调相对路径为`/api/v1/message?token=moviepilot`,其中`moviepilot`为设置的`API_TOKEN`。
|
||||
- 设置媒体服务器Webhook,通过MoviePilot发送播放通知,以及后续播放限速等插件功能。Webhook回调相对路径为`/api/v1/webhook?token=moviepilot`,其中`moviepilot`为设置的`API_TOKEN`。
|
||||
- 将MoviePilot做为Radarr或Sonarr服务器添加到Overseerr或Jellyseerr,可使用Overseerr/Jellyseerr选片。
|
||||
|
||||

|
||||
|
@ -17,15 +17,15 @@ def start_webhook_chain(body: Any, form: Any, args: Any):
|
||||
|
||||
|
||||
@router.post("/", summary="Webhook消息响应", response_model=schemas.Response)
|
||||
def webhook_message(background_tasks: BackgroundTasks,
|
||||
token: str, request: Request) -> Any:
|
||||
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认证不通过")
|
||||
body = request.body()
|
||||
form = request.form()
|
||||
body = await request.body()
|
||||
form = await request.form()
|
||||
args = request.query_params
|
||||
background_tasks.add_task(start_webhook_chain, body, form, args)
|
||||
return schemas.Response(success=True)
|
||||
|
Reference in New Issue
Block a user