Compare commits

..
4 Commits
Author SHA1 Message Date
Aeru eef8fe95bd adding /whitelist
hardcoded gg gg
2026-10-18 00:01:25 +02:00
Aeru f5a45bf87c Update main.py
fr->en
2026-10-17 22:56:58 +02:00
Aeru e56910d7e9 Merge pull request 'Écoute en IPv6' (#1) from Almtesh/API5005:main into main
Reviewed-on: #1
2026-10-17 13:15:46 +02:00
Almtesh 14ec50992b Écoute en IPv6
D'après la documentation (et mon expérience), ça fonctionne en dual-stack de faire ça.
2026-10-17 03:16:45 +02:00
+9 -4
View File
@@ -17,7 +17,10 @@ lanyard_link = "https://api.lanyard.rest/v1/users/1558056824387805300"
CACHE_TTL = 1.0
_cache = {"data": None, "time": 0.0}
_lock = threading.Lock()
WHITELIST = [
1558056824387805300,
1179777658675007520,
] #harcode final boss
def get_lanyard():
@@ -33,7 +36,7 @@ def get_lanyard():
_cache["time"] = time.monotonic()
except requests.RequestException:
if _cache["data"] is None:
raise fastapi.HTTPException(status_code=502, detail="Lanyard indisponible")
raise fastapi.HTTPException(status_code=502, detail="Lanyard not available") #I wrote this in French, lol
return _cache["data"]
@@ -43,8 +46,10 @@ def read_root():
@app.get("/discord")
def read_lanyard():
return get_lanyard()
@app.get("/whitelist")
def read_whitelist():
return WHITELIST
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=5005)
uvicorn.run(app, host="::", port=5005)