diff --git a/run.sh b/run.sh index 58bf598..d9e6581 100755 --- a/run.sh +++ b/run.sh @@ -28,6 +28,9 @@ fi # ANIWEB_TRUST_XFF=1: prod traffic arrives via the local HTTPS proxy, so the # per-IP login budget keys on X-Forwarded-For; without the flag auth.py uses # the socket peer only (the header is spoofable on a direct connection). -ANIWEB_SECURE=1 ANIWEB_TRUST_XFF=1 nohup .venv/bin/python -m uvicorn server.app:app --host 0.0.0.0 --port 8321 --timeout-graceful-shutdown 3 > server.log 2>&1 & +# ANI_SOURCE: animekai leads while MegaPlay's CDN 403s our egress IP (its +# 1anime servers use an independent CDN); the hianime/anidb/anikoto chain +# stays as fallback. Restore "hianime,anidb,anikoto" once the block lifts. +ANIWEB_SECURE=1 ANIWEB_TRUST_XFF=1 ANI_SOURCE=animekai,hianime,anidb,anikoto nohup .venv/bin/python -m uvicorn server.app:app --host 0.0.0.0 --port 8321 --timeout-graceful-shutdown 3 > server.log 2>&1 & echo $! > "$PIDF" echo "ani-web on http://localhost:8321 (pid $(cat "$PIDF")) — use the HTTPS proxy to log in" diff --git a/server/app.py b/server/app.py index e8f66de..a5da631 100644 --- a/server/app.py +++ b/server/app.py @@ -565,6 +565,9 @@ def api_stream(ep_id: int, lang: str = "jpn", request: Request = None): if not master: raise HTTPException(404, f"no {lang} stream for episode {ep_id}") out = {"token": _b64(master)} + # the player kind is a property of the URL, not the provider: .m3u8 + # -> hls.js, anything else -> native