Commit graph

241 commits

Author SHA1 Message Date
8126cc0da5 audit-fix sprint: all 13 findings (CRIT/HIGH/MED/LOW)
CRIT-1: ExtractionError::Deobfuscation is now switchable.
        Deobfuscator gains has_sig()/has_nsig() — deobfuscate_sig/_nsig
        short-circuit with a recognisable error class so cipher streams
        on the wrong client fall through to the next client in the chain
        instead of killing the whole call.

CRIT-2: Soft-failed DeobfData now caches with a 1-hour retry instead of
        living for 24h. Re-extraction kicks in automatically once YT
        rotates back to a player.js shape we recognise — no more
        wall-clock-day-of-poisoned-cache.

HIGH-1: Reporter now emits a Level::WRN `extract_deobf_soft_fail` report
        on partial extraction. straw / torttube get an artefact when
        sig/nsig regex starts missing.

HIGH-2: player_client_order branches on opts.auth. With botguard
        + authed-cookie users, Desktop is now position 2 (where their
        cookie maps to an OAuth session) instead of position 4.

HIGH-3: Android dropped from the default order. needs_po_token doesn't
        flag Android, so requests were firing unsigned and tripping
        YT's bot-check rejection — which is also not switchable.
        Re-add when a real po_token strategy lands.

MED-1: Comment in needs_deobf softened — the iOS/Android-no-deobf
        property is a current YT behaviour, not a permanent protocol.

MED-2: Cargo.toml workspace pin bumped 0.11.4 → 0.11.5 so it matches
        the package version (avoids future 0.12.x bump surprises).

MED-3: Smoke test fixture uses an isolated per-process scratch dir
        instead of the repo root, avoiding cache-race with
        tests/youtube.rs (which uses CARGO_MANIFEST_DIR and could
        wipe OAuth tokens).

LOW-1: Misleading "dead-code fallback" comment in extract_fns replaced
        with the actual behaviour description.

LOW-2: get_deobf_data uses read-then-write — concurrent player calls
        on warm cache no longer serialise on the write lock.

LOW-3: Smoke test catches IpBan via exact UnavailabilityReason match
        instead of substring "Sign in/IpBan/bot" — a real regression
        won't silently pass anymore.

LOW-4: TV smoke test now asserts !audio_streams.is_empty() too,
        matching iOS / default-order tests.

LOW-5: needs_deobf comment notes YT's historical n= experiments on
        Android — sets expectation for future review passes.
2026-05-24 12:20:14 -07:00
84bb666bb2 release: 0.11.4-sulkta.1 — soft-fail sig + iOS-first default order
Smoke-tested against current YT player c2f7551f (May 2026):

  test ios_player_returns_streams ........... ok
  test default_client_order_returns_streams . ok  (audio Range-GET 206 Partial Content, 1024 bytes)
  test tv_player_returns_streams ............ ok (or env-skipped on IP-banned egress)

Fork changes since upstream v0.11.4:
- client::ClientType::needs_deobf: skip player.js deobf for Android too
- client::player::player_client_order: prefer iOS first (no botguard),
  iOS/Android/Tv/Desktop (with botguard)
- deobfuscate::DeobfData::extract_fns: soft-fail sig_fn/nsig_fn extraction
  so Tv/Desktop callers keep working when YT rotates player.js to a shape
  our regex doesn't recognise — only the load-bearing sig_timestamp is
  required for the request payload
- tests/sulkta_smoke.rs: end-to-end sanity covering iOS, Tv, default-order
  and a Range-GET probe to confirm YT actually serves the audio bytes
2026-05-24 11:57:46 -07:00
947f67834a tests: smoke — switch HEAD to Range GET + iOS UA
YouTube googlevideo CDN 403s HEAD requests + 403s requests with a
non-client User-Agent. Use the iOS client UA on the probe so the CDN
treats it as the same client that requested the URL.
2026-05-24 11:56:41 -07:00
b50f04d565 tests: sulkta smoke — iOS / TV / default-order player_from_client + HEAD probe
Exercises the patched default client_order + soft-fail DeobfData
end-to-end against current YouTube. Verifies:
1. iOS player_from_client returns streams (no deobf path).
2. TV player_from_client returns streams (deobf path with soft-fail).
3. default-clients player() picks iOS primary and a returned audio
   URL HEADs to a 2xx/3xx (i.e. YouTube CDN accepts it).

Lives alongside the upstream tests/youtube.rs so we don't fork their
big snapshot-based test suite, but stays standalone so a single
`cargo test --test sulkta_smoke` exercises just the load-bearing
playback path for our consumers (straw, future torttube).
2026-05-24 11:54:18 -07:00
ThetaDev
e7e389a316
feat: add unavailable field for music tracks
fix: handling albums with unavailable tracks
2025-06-18 15:34:05 +02:00
ThetaDev
412cd37840
test: fix isrc_search_languages (use quoted query) 2025-06-18 13:25:13 +02:00
ThetaDev
c6abd89087
test: fix tests 2025-04-18 16:38:44 +02:00
ThetaDev
47bea4eed2
test: update music_artist_basic snapshot 2025-03-26 01:38:35 +01:00
ThetaDev
b8f61c9bae
test: skip android client test 2025-03-04 22:50:33 +01:00
ThetaDev
f3057b4d63
chore: remove commented-out debug statements 2025-02-26 19:32:46 +01:00
ThetaDev
544782f8de
feat: add original album track count, fix fetching albums with more than 200 tracks 2025-02-26 15:21:47 +01:00
ThetaDev
739eac4d1f
test: fix tests 2025-02-18 00:16:09 +01:00
ThetaDev
65cb4244c6
feat!: add userdata feature for all personal data queries (playback history, subscriptions) 2025-02-07 13:21:12 +01:00
ThetaDev
8385b87c63
feat: check rustypipe-botguard-api version 2025-02-06 01:41:48 +01:00
ThetaDev
b72b501b6d
feat: add session po token cache 2025-02-06 00:48:37 +01:00
ThetaDev
b90a252a5e
feat: add support for rustypipe-botguard to get PO tokens 2025-02-05 15:56:14 +01:00
ThetaDev
10767fe71c
test: fix tests 2025-02-05 10:21:16 +01:00
ThetaDev
2b891ca078
fix: a/v streams incorrectly recognized as video-only 2025-01-22 01:59:01 +01:00
ThetaDev
9c512c3c4d
fix: player_from_clients method not send/sync 2025-01-16 04:23:02 +01:00
ThetaDev
47424b9681
test: fix tests 2025-01-16 01:01:00 +01:00
ThetaDev
51dacf8df2
ci: skip authenticated tests 2025-01-13 03:51:24 +01:00
ThetaDev
2af4001c75
feat: extract player DRM data 2025-01-13 03:22:37 +01:00
ThetaDev
320a8c2c24
feat: add history item dates, extend timeago parser 2025-01-05 05:50:59 +01:00
ThetaDev
14e399594f
feat: add functions to fetch a user's history and subscriptions 2025-01-05 05:50:58 +01:00
ThetaDev
28cdba59c5
test: fix tests 2025-01-05 05:36:14 +01:00
ThetaDev
0b3afc1b13
test: fix tests 2025-01-05 05:30:50 +01:00
ThetaDev
59625de949
test: fix tests 2024-12-20 03:41:42 +01:00
ThetaDev
fd51809202
test: fix tests 2024-12-20 03:10:34 +01:00
ThetaDev
162959ca45
fix: remove leading zero-width-space from comments, ensure space after links 2024-12-18 19:31:24 +01:00
ThetaDev
44ae456d2c
fix: limit retry attempts to fetch client versions and deobf data 2024-12-13 03:47:37 +01:00
ThetaDev
a846b729e3
fix: disable Android client 2024-11-25 15:48:04 +01:00
ThetaDev
ac8fbc3e67
fix: parsing lockup playlists with "MIX" instead of view count 2024-11-10 03:25:26 +01:00
ThetaDev
044094a4b7
feat!: replace TrackItem::is_video attr with TrackType enum; serde lowercase AlbumType enum for consistency 2024-11-09 02:55:59 +01:00
ThetaDev
50010b7b08
feat: allow searching for YTM users 2024-11-09 00:36:42 +01:00
ThetaDev
07fd62c560
ci: fix tests for PRs 2024-10-27 02:28:57 +02:00
ThetaDev
d452af4fb7
test: expect user auth when running in CI 2024-10-24 00:57:47 +02:00
ThetaDev
7984f9f13a
test: fix authenticated testing in CI 2024-10-24 00:42:19 +02:00
ThetaDev
1cc3f9ad74
feat: add OAuth user login to access age-restricted videos 2024-10-23 23:02:32 +02:00
ThetaDev
9e835c8f38
feat!: remove TvHtml5Embed client as it got disabled 2024-10-23 01:42:02 +02:00
ThetaDev
79a62816ff
fix: update channel order tokens 2024-10-23 00:30:18 +02:00
ThetaDev
b589061a40
fix: fetch artist albums continuation 2024-10-22 23:56:59 +02:00
ThetaDev
71d3ec65dd
feat: add mobile client 2024-10-13 05:16:06 +02:00
ThetaDev
69d64e5aca
test: fix tests 2024-10-12 05:31:05 +02:00
ThetaDev
7972df0df4
fix: A/B test 15 (parsing channel shortsLockupViewModel) 2024-09-10 03:12:16 +02:00
ThetaDev
ed08f9ff9a
test: add test case 2024-09-09 23:24:25 +02:00
ThetaDev
3599acafef
feat!: remove startpage 2024-08-18 03:03:11 +02:00
ThetaDev
a3a1d9abf3
test: add downloader test 2024-08-17 23:11:44 +02:00
ThetaDev
e6715700d9
feat!: update channel model, addd handle + video_count, remove tv/mobile banner 2024-08-17 02:44:47 +02:00
ThetaDev
479fac1c02
test: dont check video streams for desktop client (pot token) 2024-08-10 03:21:29 +02:00
ThetaDev
e608811e5f
feat!: add TV client 2024-07-30 01:55:24 +02:00