Skip to content

[SCR-577] API parity: youtube-subtitles command, google --pages and --search-type ads - #31

Merged
sahilsunny merged 2 commits into
mainfrom
feat/api-parity-1.6.0/SCR-577
Sep 4, 2026
Merged

[SCR-577] API parity: youtube-subtitles command, google --pages and --search-type ads#31
sahilsunny merged 2 commits into
mainfrom
feat/api-parity-1.6.0/SCR-577

Conversation

@sahilsunny

@sahilsunny sahilsunny commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds three missing API features to the CLI and bumps the unreleased version to 1.6.0 (the unreleased section holds features — Auto-Mode from #26 plus these — so semver calls for a minor bump).

Changes

  • New youtube-subtitles command/api/v1/youtube/subtitles (5 credits): accepts a video ID or full YouTube URL, --language, --subtitle-origin (auto-generated / uploader-provided), --tag, and batch via --input-file, mirroring youtube-metadata.
  • google --pages — fetch up to 10 consecutive result pages starting at --page in one combined response; bounds validated client-side.
  • google --search-type ads — classic-result structure optimized for paid-ad visibility.
  • Version 1.5.2 → 1.6.0 across all manifests; docs and skill references updated.

Verification

  • Live API: subtitles returned real captions; --pages 2 combined two SERP pages; ads returned 200 JSON; out-of-range --pages rejected before any request.
  • 853 unit tests green; ruff + ty clean. (Known exclusion: test_scroll_up_reaches_content_above_wrapped_line, a pre-existing flake that fails identically on main.)
  • pipx install smoke-tested in both normal and REPL mode — no regressions.

… ads (SCR-577)

API-parity sweep against scrapingbee.com/llms.txt found three gaps:

- youtube-subtitles: new command for /api/v1/youtube/subtitles (video ID or
  URL, --language, --subtitle-origin auto-generated/uploader-provided, batch
  via --input-file, 5 credits). Registered in CLI, REPL Media group,
  --scraping-config router, and ESTIMATED_CREDITS.
- google --pages: fetch up to 10 consecutive pages starting at --page in one
  combined response; validated via new _validate_pages() helper (1..10).
- google --search-type ads: classic-result structure optimized for paid-ad
  visibility.

Version bumped to 1.6.0 (unreleased section holds features: Auto-Mode +
these additions). Docs updated: CHANGELOG, README, AGENTS.md, canonical
.agents/skills tree (new reference/youtube/subtitles.md, google overview)
synced to all mirrors.

Verified live against the API: subtitles returned real captions, --pages 2
combined two SERP pages, ads returned 200 JSON; bounds rejected locally.
853 unit tests green (new client param-forwarding, validator, and help
tests); ruff + ty clean. Installed via pipx and smoke-tested normal mode
and REPL (help, completion, live call, session-default warnings) with no
regressions.
The google --help variant matched on the raw PTY stream, but the REPL's
differential renderer can repaint straight to the final frame without
ever emitting the scrolled-off warning line into the stream, so the
assertion raced on slow CI runners (failed on ubuntu/3.11 in PR CI and
macos/3.10 on main — different cells, same mechanism). Restore the
1.5.1-era approach: usage --help keeps the output short so the warning
stays on screen, and the transient pump checks every intermediate
screen state.
@kostas-jakeliunas-sb

Copy link
Copy Markdown
Contributor

Ok, but doc-side inconsistencies, @sahilsunny ideally should fix before merge:

  • "cost is per fetched page" is false. CHANGELOG.md:16 and reference/google/overview.md:21 across the five mirrors. The backend charges a flat 10 or 15 regardless of pages. Live: --pages 1 and --pages 3 both cost 10 credits. Reword to flat cost.
  • reference/youtube/subtitles.md:17 says a language with no subtitles returns 404. Live: --language fr returns 200 with an empty subtitles object and still charges 5 credits. Document that, and consider an empty-result warning like the google command has.
  • youtube-subtitles is absent from the command registries in tests/unit/test_error_responses.py:93, tests/integration/helpers.py:195, and tests/run_e2e_tests.py:1581. It ships with no 4xx exit-code test, no missing-key test and no e2e. Four one-line additions.

@sahilsunny

Copy link
Copy Markdown
Collaborator Author

@kostas-jakeliunas-sb , will fix this in #32, as it requires changes

@sahilsunny
sahilsunny merged commit 7b30fc5 into main Sep 4, 2026
14 checks passed
@sahilsunny
sahilsunny deleted the feat/api-parity-1.6.0/SCR-577 branch September 4, 2026 14:40
sahilsunny added a commit that referenced this pull request Sep 4, 2026
- Custom -H headers are now Spb--prefixed on every method (idempotently),
  not only GET. On POST/PUT raw headers were silently dropped by the API,
  and after the Bearer migration a user Authorization header replaced the
  session's API key (aiohttp per-request beats session headers), failing
  auth with 400/401. Red->green verified live with the reviewer's repro;
  fake-API regression tests added (3 fail without the fix).
- Stale --forward-headers help ('use Spb- prefix') removed — following it
  produced Spb-Spb- double prefixes; prefixing is now automatic.
- google --pages billing corrected in CHANGELOG and references: flat 10/15
  per request regardless of page count (measured: --pages 1/2/2-from-2 all
  cost 10). Window semantics (--page start, N consecutive) re-verified by
  URL-overlap comparison and were already documented correctly.
- youtube-subtitles: a language with no subtitles returns HTTP 200 with an
  empty object (not 404 as the API docs claim) and still charges 5 credits
  (verified live) — the CLI now warns instead of printing silent empty
  JSON; docs corrected; unit tests added.
- youtube-subtitles added to the error-response, integration, and e2e test
  registries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants