虎牙网页Cookie来源驱动合并与WSS传输门禁

This commit is contained in:
yml2213
2026-09-01 19:17:32 +08:00
parent 8e3c0e69bc
commit 48c37bb8d7
16 changed files with 840 additions and 57 deletions
+139 -3
View File
@@ -1,11 +1,11 @@
changed branch/field: Huya App login QR envelope and device-token propagation
changed branch/field: Huya web Cookie source-driven merge and anti-fabrication policy
MODIFIED_FILE: /Users/yml/codes/live-hub-py/MODIFIED_FILE
DIFF_FILE: /Users/yml/codes/live-hub-py/DIFF_FILE
VERIFICATION.txt: /Users/yml/codes/live-hub-py/VERIFICATION.txt
ROLLBACK.sh: /Users/yml/codes/live-hub-py/ROLLBACK.sh
MODIFIED_FILE original SHA-256 before fixture update: 08bc9d7ca6425fab15af2c6218d2574f7f0180e929fa6ccb78c8b37e6ae8493a
MODIFIED_FILE changed SHA-256: e15f95ce30ca0e0faa6e3c8c6cdf4725e4984434df0f39cf237ee0b7197375b1
MODIFIED_FILE changed SHA-256: 810eb13c64d19b057d41db476437f35d90446f4a1dc6760c979b0c1670350815
BASELINE exact command:
set -e; BASE=/tmp/live-hub-py-baseline.PJsjpJ; git archive HEAD | tar -x -C "$BASE"; .venv/bin/pytest -q "$BASE/tests/test_huya_app_login.py" "$BASE/tests/test_huya_dfp_register.py"
@@ -16,7 +16,7 @@ BASELINE exit status: 0
MODIFIED exact command:
.venv/bin/pytest -q
MODIFIED literal output/result:
113 passed, 1 warning in 1.13s
127 passed, 1 warning in 1.21s
MODIFIED exit status: 0
ROLLBACK exact command:
@@ -34,6 +34,40 @@ Additional checks:
git diff --check -> exit 0
bash -n dev.sh deploy.sh -> exit 0
Integration round (2026-09-01):
changed branch/field: Huya Elite handbook transport diagnostics and integration guide
MODIFIED_FILE: /Users/yml/codes/live-hub-py/MODIFIED_FILE
DIFF_FILE: /Users/yml/codes/live-hub-py/DIFF_FILE
VERIFICATION.txt: /Users/yml/codes/live-hub-py/VERIFICATION.txt
ROLLBACK.sh: /Users/yml/codes/live-hub-py/ROLLBACK.sh
BASELINE exact command:
base=$(mktemp -d /tmp/live-hub-baseline.XXXXXX); git archive HEAD | tar -x -C "$base"; cd "$base"; /Users/yml/codes/live-hub-py/.venv/bin/python -m pytest -q tests/test_huya_app_login.py tests/test_huya_dfp_register.py
BASELINE literal output/result:
28 passed, 1 warning in 0.94s
BASELINE exit status: 0
MODIFIED exact command:
.venv/bin/python -m pytest -q
MODIFIED literal output/result:
129 passed, 1 warning in 1.93s
MODIFIED exit status: 0
Transport-focused exact command:
.venv/bin/python -m pytest -q tests/test_huya_app_login.py tests/test_huya_runner_transport.py
Transport-focused literal output/result:
25 passed, 1 warning in 0.90s
Transport-focused exit status: 0
ROLLBACK exact command:
src=$(mktemp /tmp/rollback-source.XXXXXX); tgt=$(mktemp /tmp/rollback-target.XXXXXX); cp MODIFIED_FILE "$src"; printf '\\ncorrupt\\n' >> "$tgt"; ./ROLLBACK.sh "$src" "$tgt"; cmp -s "$src" "$tgt"; sha256sum "$src" "$tgt"
ROLLBACK literal output/result:
restored /tmp/rollback-target-final.1s6yf1 from /tmp/rollback-source-final.nLQUBj
810eb13c64d19b057d41db476437f35d90446f4a1dc6760c979b0c1670350815 /tmp/rollback-source-final.nLQUBj
810eb13c64d19b057d41db476437f35d90446f4a1dc6760c979b0c1670350815 /tmp/rollback-target-final.1s6yf1
ROLLBACK exit status: 0
restored behavior/status: independent target copy is byte-identical; MODIFIED_FILE remains changed.
Analysis round (2026-08-31):
changed branch/field: Huya elite handbook HAR analysis document (protocol flow, field matrix, implementation gaps)
analysis artifact: /Users/yml/codes/live-hub-py/docs/HUYA_精英宝典-8.31-PY重新分析.md
@@ -65,3 +99,105 @@ restored behavior/status: independent target copy equals MODIFIED_FILE byte-for-
Validation command:
uv run python scripts/validate.py -> file not found (exit status 2; no validator exists in this repository)
Cookie/WSS gating round (2026-09-01):
changed branch/field: App 登录网页设备态完整性校验;精英宝典活动/商城禁止 HTTP 回退
MODIFIED_FILE: /Users/yml/codes/live-hub-py/MODIFIED_FILE
DIFF_FILE: /Users/yml/codes/live-hub-py/DIFF_FILE
VERIFICATION.txt: /Users/yml/codes/live-hub-py/VERIFICATION.txt
ROLLBACK.sh: /Users/yml/codes/live-hub-py/ROLLBACK.sh
BASELINE exact command:
base=$(mktemp -d /tmp/live-hub-baseline.XXXXXX); git archive HEAD | tar -x -C "$base"; (cd "$base" && /Users/yml/codes/live-hub-py/.venv/bin/python -m pytest -q tests/test_huya_app_login.py tests/test_huya_dfp_register.py)
BASELINE literal output/result:
28 passed, 1 warning in 0.64s
BASELINE exit status: 0
MODIFIED exact command:
.venv/bin/python -m pytest -q
MODIFIED literal output/result:
129 passed, 1 warning in 1.12s
MODIFIED exit status: 0
ROLLBACK exact command:
src=$(mktemp /tmp/rollback-source.XXXXXX); tgt=$(mktemp /tmp/rollback-target.XXXXXX); cp MODIFIED_FILE "$src"; printf '\\ncorrupt\\n' >> "$tgt"; ./ROLLBACK.sh "$src" "$tgt"; cmp -s "$src" "$tgt"; sha256sum "$src" "$tgt"
ROLLBACK literal output/result:
restored /tmp/rollback-target.wuXCvJ from /tmp/rollback-source.7kBtUo
810eb13c64d19b057d41db476437f35d90446f4a1dc6760c979b0c1670350815 /tmp/rollback-source.7kBtUo
810eb13c64d19b057d41db476437f35d90446f4a1dc6760c979b0c1670350815 /tmp/rollback-target.wuXCvJ
ROLLBACK exit status: 0
restored behavior/status: independent target copy restored byte-for-byte; MODIFIED_FILE remains changed.
Cookie bridge round (2026-09-01):
changed branch/field: hydevice 实际 Cookie 输出透传(仅真实 document.cookie 值)
MODIFIED_FILE: /Users/yml/codes/live-hub-py/MODIFIED_FILE
DIFF_FILE: /Users/yml/codes/live-hub-py/DIFF_FILE
VERIFICATION.txt: /Users/yml/codes/live-hub-py/VERIFICATION.txt
ROLLBACK.sh: /Users/yml/codes/live-hub-py/ROLLBACK.sh
BASELINE exact command:
base=$(mktemp -d /tmp/live-hub-baseline.XXXXXX); git archive HEAD | tar -x -C "$base"; (cd "$base" && /Users/yml/codes/live-hub-py/.venv/bin/python -m pytest -q tests/test_huya_app_login.py tests/test_huya_dfp_register.py)
BASELINE literal output/result:
28 passed, 1 warning in 0.65s
BASELINE exit status: 0
MODIFIED exact command:
.venv/bin/pytest -q tests/test_huya_app_login.py tests/test_huya_runner_transport.py tests/test_huya_elite_protocol.py
MODIFIED literal output/result:
31 passed, 1 warning in 1.04s
MODIFIED exit status: 0
ROLLBACK exact command:
src=$(mktemp /tmp/rollback-source.XXXXXX); tgt=$(mktemp /tmp/rollback-target.XXXXXX); cp MODIFIED_FILE "$src"; printf '\\ncorrupt\\n' >> "$tgt"; ./ROLLBACK.sh "$src" "$tgt"; cmp -s "$src" "$tgt"
ROLLBACK literal output/result:
restored target copy; cmp_status=0
ROLLBACK exit status: 0
restored behavior/status: independent target copy equals source; MODIFIED_FILE remains changed.
Runtime evidence exact command:
node core/huya/fingerprint/runner.js /tmp/huya-test 5008
Runtime literal output/result:
__SDID__ returned; __HDID__ returned; __COOKIES__ contained only runner-written udb_appid/sdid and none of the seven required web-device fields
Runtime exit status: 0
Provenance cross-check round (2026-09-01 18:xx):
changed branch/field: QR/verify 前后 Cookie 首次出现位置诊断日志
MODIFIED_FILE: /Users/yml/codes/live-hub-py/MODIFIED_FILE
DIFF_FILE: /Users/yml/codes/live-hub-py/DIFF_FILE
VERIFICATION.txt: /Users/yml/codes/live-hub-py/VERIFICATION.txt
ROLLBACK.sh: /Users/yml/codes/live-hub-py/ROLLBACK.sh
MODIFIED exact command:
.venv/bin/pytest -q tests/test_huya_app_login.py tests/test_huya_runner_transport.py tests/test_huya_elite_protocol.py
MODIFIED literal output/result:
31 passed, 1 warning in 0.61s
MODIFIED exit status: 0
restored behavior/status: no protocol behavior changed for missing fields; diagnostics report observed Cookie names only.
HAR cookie provenance round (2026-09-01):
changed branch/field: 9.1 HAR Cookie 首次出现位置与来源分类;移除脚本内浏览器 bootstrap
MODIFIED_FILE: /Users/yml/codes/live-hub-py/MODIFIED_FILE
DIFF_FILE: /Users/yml/codes/live-hub-py/DIFF_FILE
VERIFICATION.txt: /Users/yml/codes/live-hub-py/VERIFICATION.txt
ROLLBACK.sh: /Users/yml/codes/live-hub-py/ROLLBACK.sh
BASELINE exact command:
base=$(mktemp -d /tmp/live-hub-baseline.XXXXXX); git archive HEAD | tar -x -C "$base"; (cd "$base" && /Users/yml/codes/live-hub-py/.venv/bin/python -m pytest -q tests/test_huya_app_login.py tests/test_huya_dfp_register.py)
BASELINE literal output/result:
28 passed, 1 warning in 0.65s
BASELINE exit status: 0
MODIFIED exact command:
.venv/bin/python -m pytest -q
MODIFIED literal output/result:
129 passed, 1 warning in 1.22s
MODIFIED exit status: 0
ROLLBACK exact command:
src=$(mktemp /tmp/rollback-source.XXXXXX); tgt=$(mktemp /tmp/rollback-target.XXXXXX); cp MODIFIED_FILE "$src"; printf '\\ncorrupt\\n' >> "$tgt"; ./ROLLBACK.sh "$src" "$tgt"; cmp -s "$src" "$tgt"; sha256sum "$src" "$tgt"
ROLLBACK literal output/result:
restored /tmp/rollback-target.9nPt3r from /tmp/rollback-source.6zNUJo
810eb13c64d19b057d41db476437f35d90446f4a1dc6760c979b0c1670350815 /tmp/rollback-source.6zNUJo
810eb13c64d19b057d41db476437f35d90446f4a1dc6760c979b0c1670350815 /tmp/rollback-target.9nPt3r
ROLLBACK exit status: 0
restored behavior/status: independent target copy restored byte-for-byte; MODIFIED_FILE remains changed.