Update main.py
Browse files
main.py
CHANGED
|
@@ -23,6 +23,8 @@ gs_app = GSDailyApp()
|
|
| 23 |
from app.gs_code import GSCodeApp
|
| 24 |
gs_code_app = GSCodeApp()
|
| 25 |
|
|
|
|
|
|
|
| 26 |
@asynccontextmanager
|
| 27 |
async def lifespan(app: FastAPI):
|
| 28 |
await invite_app.start()
|
|
@@ -105,6 +107,21 @@ async def genshin_redeem(
|
|
| 105 |
raise HTTPException(status_code=400, detail=res)
|
| 106 |
|
| 107 |
return res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
@app.get("/")
|
| 110 |
def home():
|
|
|
|
| 23 |
from app.gs_code import GSCodeApp
|
| 24 |
gs_code_app = GSCodeApp()
|
| 25 |
|
| 26 |
+
from app.ht_noti import get_new_hentai
|
| 27 |
+
|
| 28 |
@asynccontextmanager
|
| 29 |
async def lifespan(app: FastAPI):
|
| 30 |
await invite_app.start()
|
|
|
|
| 107 |
raise HTTPException(status_code=400, detail=res)
|
| 108 |
|
| 109 |
return res
|
| 110 |
+
|
| 111 |
+
@app.get("/api/v1/hentai/newest")
|
| 112 |
+
async def hentai_newest(
|
| 113 |
+
apikey: Optional[str] = Query(None, description="API Key (n岷縰 c贸 c岷 h矛nh)"),
|
| 114 |
+
x_api_key: Optional[str] = Header(None, alias="X-API-Key")
|
| 115 |
+
):
|
| 116 |
+
key_to_check = x_api_key or apikey
|
| 117 |
+
|
| 118 |
+
try:
|
| 119 |
+
result = await get_new_hentai(key_to_check)
|
| 120 |
+
return result
|
| 121 |
+
except HTTPException as e:
|
| 122 |
+
raise e
|
| 123 |
+
except Exception as e:
|
| 124 |
+
raise HTTPException(status_code=500, detail=str(e))
|
| 125 |
|
| 126 |
@app.get("/")
|
| 127 |
def home():
|