forked from labdiynez/yuki-emby-crack-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
51 lines (38 loc) · 1.5 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @author: MitsuhaYuki
import uvicorn
from fastapi import FastAPI, Request
app = FastAPI(docs_url=None, redoc_url=None, openapi_url=None)
@app.get('/')
def get_main():
return {'status': 200, 'msg': 'emby validation server successfully start'}
@app.get('/admin/service/registration/validateDevice')
@app.post('/admin/service/registration/validateDevice')
def post_validate_device():
return {"cacheExpirationDays": 365, "message": "Device Valid", "resultCode": "GOOD"}
@app.get('/admin/service/registration/validate')
@app.post('/admin/service/registration/validate')
def post_validate():
return {"featId": "", "registered": True, "expDate": "2099-01-01", "key": ""}
@app.get('/admin/service/registration/getStatus')
@app.post('/admin/service/registration/getStatus')
def post_get_status():
return {"deviceStatus": "0", "planType": "Lifetime", "subscriptions": {}}
@app.middleware("http")
async def add_process_time_header(request: Request, call_next):
response = await call_next(request)
response.headers["Access-Control-Allow-Origin"] = "*"
response.headers["Access-Control-Allow-Headers"] = "*"
response.headers["Access-Control-Allow-Method"] = "*"
response.headers["Access-Control-Allow-Credentials"] = "true"
return response
if __name__ == '__main__':
uvicorn.run(
app,
host="127.0.0.1",
port=443,
workers=1,
ssl_certfile='./cert/server.crt',
ssl_keyfile='./cert/server.key'
)