feat: add autonomous YouTube resource recovery and adaptive GGC

Co-authored-by: GPT-6 <gpt-6@openai.com>
This commit is contained in:
ZeusinaandGPT-6 Bot committed 2026-10-11 20:15:16 +03:00
1 parent 8826c591dc
commit b4e1e1e9ca
43 files changed
+5163 -93

No files matched your search

+34
View File
@@ -40,11 +40,45 @@ with a tag or local default.
Offline static guard (from repository root):
`python3 deploy/managed-target/check_static.py`.
Offline real pre-launch validation and private Compose forwarding fixtures:
`python3 deploy/managed-target/check_config.py` (requires local Go and Compose).
Isolated, accelerated shell supervision fixtures (no network):
`python3 deploy/managed-target/check_supervision.py`.
## In-container supervision
### Opt-in service/adaptive and target-native DNS
Compose forwards `ZAPRET_AUTOTUNE_YOUTUBE_SERVICE` (`0` or `1`, default `0`),
`ZAPRET_AUTOTUNE_GOOGLEVIDEO_MODE` (`cold` or `adaptive`, default `cold`),
`ZAPRET_AUTOTUNE_VIDEO_ID` (default `dQw4w9WgXcQ`) and
`ZAPRET_AUTOTUNE_GOOGLEVIDEO_VIDEO_IDS` (JSON array of 1..5 unique VideoIDs;
default only the primary ID). Explicit empty/invalid settings are rejected,
not silently replaced. Adaptive requires service `1`. See `.env.example`.
Service `0` preserves legacy Player API/exact-host behavior.
Adaptive qualification is **post-warmup**, distinct from cold qualification;
initial connections may fail and native learning must repeat after restart.
It requires at least **three real unique signed ordinary media host samples**.
Three sample videos may all resolve to the same CDN host: that means
`DEGRADED`, no authorized googlevideo suffix, not fabricated coverage. Service
asset checks cover sampled thumbnail/avatar routes, not the whole thumbnail pool.
The current service/adaptive hardware acceptance gate is **pending**; the old
clean-run PASS below does not qualify these new modes.
Optional `SS_DNS_SERVER` is an unbracketed literal IPv4/IPv6 address only (for
example `8.8.8.8` or `2001:4860:4860::8888`); empty preserves existing resolver
behavior. No domain, port, zone, control characters or option strings are
accepted. Validation runs before service launch and reports opaque `configerror`
without echoing input. DNS applies only to this target's native `ss-server`.
The image build checks installed `ss-server -h` for native `-d <addr>` support;
the validated nonsecret address is passed as a separate `-d` argv value, not
eval or an assumed JSON key. Passwords still go only to private JSON configs.
The reported `8.8.8.8` diagnostic corrected a tampered avatar response, but does
not fix/prove all thumbnail routes. Native DNS correction is **not full asset
availability proof**. No DoH bridge, permanent Google IP pins or global host DNS
changes are supplied. PID 1 remains the sole startup/recovery owner.
Compose has no automatic restart. PID 1 restarts the entire owned runtime only
for technical failures, with three starts per rolling six hours (including initial
startup) and cancellable 15/30-second cooldowns. Clean typed recovery timeouts,