072d83da35
TDD GREEN phase - implementation passes all 8 tests: - ZhihuLoginResult: Pydantic model for login results - ZhihuLogin: Main class with QR code login flow - LOGIN_URL: https://www.zhihu.com/signin - CANVAS_SELECTORS: Multiple fallback selectors for QR canvas - _find_qrcode_canvas(): Find canvas with fallback selectors - _save_qrcode_image(): Save QR code to intermediate directory - check_login_cookie(): Detect z_c0 cookie for login state - get_cookies_str(): Extract cookie string from context - _wait_for_login(): Poll with configurable timeout (tenacity) - login_by_qrcode(): Main entry point for login flow Key design decisions: - Uses tenacity Retrying for configurable timeout - QR code saved to intermediate_path with timestamp - Multiple canvas selectors for robustness - Proper browser lifecycle management Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9 lines
198 B
Python
9 lines
198 B
Python
"""Auth module for KB Workflow
|
|
|
|
Provides authentication and cookie management functionality.
|
|
"""
|
|
|
|
from .zhihu_login import ZhihuLogin, ZhihuLoginResult
|
|
|
|
__all__ = ["ZhihuLogin", "ZhihuLoginResult"]
|