Celeskry commited on
Commit
c7e9d08
·
verified ·
1 Parent(s): 33966f8

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +13 -0
main.py CHANGED
@@ -48,6 +48,19 @@ async def get_free_account():
48
  raise HTTPException(status_code=500, detail=res["error"])
49
  return res
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  @app.get("/api/v1/genshin/daily")
52
  async def genshin_daily():
53
  res = await gs_app.run_daily_and_capture()
 
48
  raise HTTPException(status_code=500, detail=res["error"])
49
  return res
50
 
51
+
52
+ class CookieRequest(BaseModel):
53
+ cookie: str
54
+
55
+ @app.post("/api/v1/genshin/daily")
56
+ async def genshin_daily(data: CookieRequest):
57
+ res = await gs_app.run_daily_and_capture(data.cookie)
58
+
59
+ if not res["ok"]:
60
+ raise HTTPException(status_code=500, detail=res["error"])
61
+
62
+ return FileResponse(res["file"], media_type="image/png")
63
+
64
  @app.get("/api/v1/genshin/daily")
65
  async def genshin_daily():
66
  res = await gs_app.run_daily_and_capture()