strawcore/Cargo.toml
Cobb 6df61c1f52
Some checks failed
gitleaks / scan (push) Failing after 4s
youtube: instrument the extractor with diagnostic logging
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.
2026-08-06 08:16:42 -07:00

52 lines
1.6 KiB
TOML

[package]
name = "strawcore-core"
version = "0.1.0"
edition = "2021"
license = "GPL-3.0-or-later"
authors = ["Sulkta"]
repository = "https://git.sulkta.com/Sulkta-OSS/strawcore"
description = "Rust port of NewPipeExtractor (YT-only). Plugs into Straw via UniFFI."
[lib]
# rlib only — strawcore-core is consumed as a Rust library, NOT loaded
# directly by Android. The Straw wrapper crate is the cdylib + the
# .so Android calls System.loadLibrary("strawcore") for. Emitting a
# cdylib here too just bloats jniLibs by ~300 KB per ABI.
crate-type = ["rlib"]
[dependencies]
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls-webpki-roots", "blocking", "gzip"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "1"
log = "0.4"
parking_lot = "0.12"
url = "2"
once_cell = "1"
regex = "1"
rquickjs = { version = "0.11", default-features = false }
ress = "0.12.0-alpha.1"
[dev-dependencies]
serde_json = "1"
[features]
default = []
# `online-tests` gates network-dependent integration tests. Enable with
# `cargo test --features online-tests` once an internet route is available.
online-tests = []
[profile.release]
strip = true
lto = "thin"
codegen-units = 1
# unwind: inert when built as a dependency of the Straw cdylib (that workspace's
# profile governs the shipped .so — the load-bearing setting lives in
# straw/rust/Cargo.toml), but kept consistent so a standalone release build/test
# of strawcore-core also unwinds instead of aborting on a core panic.
panic = "unwind"
opt-level = "z"
[profile.dev]
opt-level = 0
debug = 1