Skip to content

Commit 41a49ff

Browse files
committed
测试对Device的引用
1 parent 597685f commit 41a49ff

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ pytest==7.1.3
33
pytest-asyncio==0.20.3
44
uvicorn==0.20.0
55
pydantic~=1.10.4
6+
pywidevine==1.6.0

src/index.py

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
from fastapi import FastAPI
22

3+
from pywidevine.cdm import Cdm
4+
from pywidevine.device import Device
5+
from pywidevine.pssh import PSSH
36
from src.dtos.ISayHelloDto import ISayHelloDto
47

58
app = FastAPI()
@@ -18,3 +21,15 @@ async def say_hello(name: str):
1821
@app.post("/hello")
1922
async def hello_message(dto: ISayHelloDto):
2023
return {"message": f"Hello {dto.message}"}
24+
25+
26+
@app.get("/cdm/device")
27+
async def cdm_device():
28+
Device(
29+
type_=Device.Types.ANDROID,
30+
security_level=3,
31+
flags={},
32+
client_id='123',
33+
private_key='456',
34+
)
35+
return {"message": "Device"}

0 commit comments

Comments
 (0)