youtube: instrument the extractor with diagnostic logging
Some checks failed
gitleaks / scan (push) Failing after 4s
Some checks failed
gitleaks / scan (push) Failing after 4s
The crate had zero logging — every failure, fallback, cache reset, and empty-parse was silent by construction, which made the 2026 bot-wall outage nearly undiagnosable. Add `log = "0.4"` and 52 statements across the extractor following a one-INFO-per-outcome / WARN-on-every-failure / DEBUG-for-internals policy, so a future break shows up in a log grep instead of a debugger. Highlights: nsig->throttled-URL fallback (aggregated one WARN per extraction, never per-format, via a threaded UrlProcessStats counter); the nsig identity-output trap now returns DeobfError::NsigIdentity and is NOT cached (previously it cached and permanently throttled); player.js build/eval/install/ StillBad lifecycle; the ANDROID->VISIONOS cascade outcome; visitorData decline + reset; HTTP 429 bot-flag; channel/search layout-change empties; per-request DEBUG (query stripped). Plus a `BotDetected` error variant (Display byte- identical to the old string) so the wall is greppable. No secrets: only videoId/channel ids, error Displays (already URL/token-scrubbed at the exceptions.rs choke points), query-stripped endpoints/player.js URLs, counts, and lengths are logged — never token/poToken/visitorData/signature values or response bodies.
This commit is contained in:
parent
dd964407cc
commit
6df61c1f52
14 changed files with 559 additions and 70 deletions
|
|
@ -60,6 +60,8 @@ pub enum DeobfError {
|
|||
JsRuntimeFailed(String),
|
||||
#[error("nsig output was empty (function neutered?)")]
|
||||
NsigEmpty,
|
||||
#[error("nsig output equalled its input (identity — deobfuscator neutered?)")]
|
||||
NsigIdentity,
|
||||
#[error("downloader not initialized")]
|
||||
DownloaderMissing,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue