feat(masters): add direct masters browser-based read commands - #629
Merged
Conversation
Мастер кампаний (Campaign Wizard) has no Yandex Direct API surface at all — do not confuse with UNIFIED_CAMPAIGN, an unrelated v5 API campaign type already supported by `campaigns add/get --type unified_campaign`. Adds `direct masters list`/`get`, driving a real Chrome session via Playwright on a throwaway copy of the user's own Chrome cookies, with graceful per-section degradation since this data has no API contract to rely on. Closes #628 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Owner
Author
🔍 Local review (cycle 1)Reviewed locally (
Both findings triaged and confirmed. Proceeding to fix. |
fetch_masters_list/fetch_master never called assert_not_captcha after page.goto, so a live SmartCaptcha gate would silently fall through to the parsers instead of raising BrowserCaptchaError (issue #628 risk item 5). The --chrome-profile flag referenced in session.py's error message also didn't exist, making non-Default Chrome profiles unreachable via the CLI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Owner
Author
📋 Review summary — all cycles
Totals: 2 FIX (both resolved in b0a8505), 0 SKIP, 0 UNVERIFIED. Round 2 clean — no cleanup pass needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
direct masters list/direct masters get <ids>— read-only access to Мастер кампаний (Campaign Wizard), which has no Yandex Direct API surface at all (not to be confused withUNIFIED_CAMPAIGN, an unrelated v5 API campaign type already supported bycampaigns add/get --type unified_campaign).browserextra:pip install "direct-cli[browser]" && playwright install chromium./wizard/campaigns/{id}/href signal (confirmed live, not link-counting). Overview parsing degrades per-section (warning, not hard failure) since this data has no API contract.direct_cli._captcha.find_captcha_marker) rather than duplicating markers.Test plan
pytest tests/test_masters.py -n0— 14 tests, all green (fake Page/Locator doubles, no real browser/network)vcrpy/aiohttperrors intest_integration_write.py/test_read_cassettes.pyconfirmed unrelated viagit stash)black --check/flake8clean on all changed files/simplifyreview pass applied: removed dead code, deduped shared Click options into a decorator, cut redundant Playwright round-tripsdirect masters list/getagainst a real account) — not run, requiresplaywright install chromiumCloses #628
🤖 Generated with Claude Code