mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
cookiecloud: support download encrypted data using post
This commit is contained in:
@@ -4,7 +4,7 @@ from typing import Annotated, Callable, Any, Dict, Optional
|
|||||||
|
|
||||||
import aiofiles
|
import aiofiles
|
||||||
from anyio import Path as AsyncPath
|
from anyio import Path as AsyncPath
|
||||||
from fastapi import APIRouter, Depends, HTTPException, Path, Request, Response
|
from fastapi import APIRouter, Body, Depends, HTTPException, Path, Request, Response
|
||||||
from fastapi.responses import PlainTextResponse
|
from fastapi.responses import PlainTextResponse
|
||||||
from fastapi.routing import APIRoute
|
from fastapi.routing import APIRoute
|
||||||
|
|
||||||
@@ -127,10 +127,14 @@ async def get_cookie(
|
|||||||
|
|
||||||
@cookie_router.post("/get/{uuid}")
|
@cookie_router.post("/get/{uuid}")
|
||||||
async def post_cookie(
|
async def post_cookie(
|
||||||
uuid: Annotated[str, Path(min_length=5, pattern="^[a-zA-Z0-9]+$")],
|
uuid: Annotated[str, Path(min_length=5, pattern="^[a-zA-Z0-9]+$")],
|
||||||
request: schemas.CookiePassword):
|
request: Optional[schemas.CookiePassword] = Body(None)
|
||||||
|
):
|
||||||
"""
|
"""
|
||||||
POST 下载加密数据
|
POST 下载加密数据
|
||||||
"""
|
"""
|
||||||
data = await load_encrypt_data(uuid)
|
data = await load_encrypt_data(uuid)
|
||||||
return get_decrypted_cookie_data(uuid, request.password, data["encrypted"])
|
if request is not None:
|
||||||
|
return get_decrypted_cookie_data(uuid, request.password, data["encrypted"])
|
||||||
|
else:
|
||||||
|
return data
|
||||||
Reference in New Issue
Block a user