feat: 增加桌面端登录、视频清单和封面缓存
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import os
|
||||
import socket
|
||||
|
||||
import uvicorn
|
||||
|
||||
|
||||
def listen_port() -> int:
|
||||
chosen = os.environ.get("RAPTD_PORT", "").strip()
|
||||
if chosen:
|
||||
return int(chosen)
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
|
||||
sock.bind(("127.0.0.1", 0))
|
||||
return sock.getsockname()[1]
|
||||
|
||||
|
||||
def main() -> None:
|
||||
port = listen_port()
|
||||
print(f"http://127.0.0.1:{port}", flush=True)
|
||||
uvicorn.run("server.app:app", host="127.0.0.1", port=port)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user