Update main.py
Browse files
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()
|