rednote-cli 0.1.7__tar.gz → 0.1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/PKG-INFO +1 -1
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/pyproject.toml +1 -1
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/__init__.py +1 -1
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/common/config.py +4 -2
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/core/account_manager.py +12 -38
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli.egg-info/PKG-INFO +1 -1
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/README.md +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/setup.cfg +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/common/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/common/app_utils.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/common/enums.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/common/errors.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/core/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/core/browser/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/core/browser/manager.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/core/database/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/core/database/manager.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/base.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/factory.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/publishing/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/publishing/media.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/publishing/models.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/publishing/validator.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/rednote/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/rednote/issues.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/services/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/services/scraper_service.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/output/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/output/event_stream.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/output/formatter_json.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/output/formatter_table.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/output/writer.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/persistence/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/persistence/file_account_repo.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/platform/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/platform/rednote/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/platform/rednote/extractor.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/platform/rednote/publisher.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/platform/rednote/runtime_extractor.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/platform/rednote/runtime_publisher.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/platform/rednote/runtime_registration.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/dto/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/dto/input_models.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/dto/output_models.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/account_list.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/account_mutation.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/auth_login.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/auth_status.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/doctor.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/init_runtime.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/note_get.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/note_search.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/publish_note.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/user_get.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/user_search.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/user_self.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/__main__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/commands/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/commands/account.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/commands/doctor.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/commands/init.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/commands/note.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/commands/publish.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/commands/search.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/commands/user.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/main.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/options.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/runtime.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/utils.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/cli/xsec_help.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/domain/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/domain/errors.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/domain/note_search_filters.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/infra/__init__.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/infra/exit_codes.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/infra/logger.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/infra/paths.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/infra/platforms.py +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli.egg-info/SOURCES.txt +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli.egg-info/dependency_links.txt +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli.egg-info/entry_points.txt +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli.egg-info/requires.txt +0 -0
- {rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli.egg-info/top_level.txt +0 -0
|
@@ -73,8 +73,10 @@ def resolve_login_mode_headless(mode: str) -> bool:
|
|
|
73
73
|
# Local login is interactive by design.
|
|
74
74
|
return resolve_browser_headless(False)
|
|
75
75
|
if normalized_mode == "remote":
|
|
76
|
-
# Remote login
|
|
77
|
-
|
|
76
|
+
# Remote login should mirror local browser environment as closely as possible.
|
|
77
|
+
# The only intended difference is remote screenshot handoff, not a weaker
|
|
78
|
+
# headless fingerprint.
|
|
79
|
+
return resolve_browser_headless(False)
|
|
78
80
|
return resolve_browser_headless()
|
|
79
81
|
|
|
80
82
|
# --- 浏览器环境配置 ---
|
|
@@ -9,7 +9,7 @@ from loguru import logger
|
|
|
9
9
|
|
|
10
10
|
import rednote_cli._runtime.common.config as runtime_config
|
|
11
11
|
from rednote_cli._runtime.common.enums import Platform
|
|
12
|
-
from rednote_cli._runtime.core.browser.manager import stealth_async
|
|
12
|
+
from rednote_cli._runtime.core.browser.manager import browser_manager, stealth_async
|
|
13
13
|
from rednote_cli._runtime.core.database.manager import DatabaseManager
|
|
14
14
|
from rednote_cli._runtime.platforms.factory import PlatformFactory
|
|
15
15
|
from rednote_cli._runtime.platforms.rednote import build_unknown_issue, detect_issue_from_page
|
|
@@ -263,8 +263,7 @@ class AccountManager:
|
|
|
263
263
|
except Exception as emit_err:
|
|
264
264
|
logger.debug(f"Ignored progress callback error: {emit_err}")
|
|
265
265
|
|
|
266
|
-
from playwright.async_api import TimeoutError as PlaywrightTimeoutError
|
|
267
|
-
from rednote_cli._runtime.common.app_utils import get_system_chrome_path
|
|
266
|
+
from playwright.async_api import TimeoutError as PlaywrightTimeoutError
|
|
268
267
|
|
|
269
268
|
if mode not in {"local", "remote"}:
|
|
270
269
|
return {
|
|
@@ -299,24 +298,16 @@ class AccountManager:
|
|
|
299
298
|
result["account_uid"] = target_account_uid
|
|
300
299
|
|
|
301
300
|
headless = runtime_config.resolve_login_mode_headless(mode)
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
executable_path=executable_path,
|
|
313
|
-
args=["--disable-blink-features=AutomationControlled"]
|
|
314
|
-
)
|
|
315
|
-
context_kwargs = {"viewport": {'width': 1280, 'height': 800}}
|
|
316
|
-
if target_account and target_account.get("storage_state"):
|
|
317
|
-
context_kwargs["storage_state"] = target_account.get("storage_state")
|
|
318
|
-
logger.info(f"Loaded stored session for account: {target_account_uid}")
|
|
319
|
-
context = await browser.new_context(**context_kwargs)
|
|
301
|
+
account_key = target_account_uid or account_uid or None
|
|
302
|
+
storage_state_seed = target_account.get("storage_state") if target_account else None
|
|
303
|
+
if target_account and storage_state_seed:
|
|
304
|
+
logger.info(f"Loaded stored session for account: {target_account_uid}")
|
|
305
|
+
|
|
306
|
+
async with browser_manager.get_context(
|
|
307
|
+
storage_state=storage_state_seed,
|
|
308
|
+
headless=headless,
|
|
309
|
+
account_key=account_key,
|
|
310
|
+
) as context:
|
|
320
311
|
page = await context.new_page()
|
|
321
312
|
await stealth_async(page)
|
|
322
313
|
|
|
@@ -414,20 +405,3 @@ class AccountManager:
|
|
|
414
405
|
result["reason"] = "login_failed"
|
|
415
406
|
result["message"] = str(e)
|
|
416
407
|
return result
|
|
417
|
-
finally:
|
|
418
|
-
if context is not None:
|
|
419
|
-
try:
|
|
420
|
-
await asyncio.wait_for(context.close(), timeout=close_timeout_seconds)
|
|
421
|
-
except Exception as close_err:
|
|
422
|
-
logger.warning(f"Context close timeout/error ignored: {close_err}")
|
|
423
|
-
if browser is not None:
|
|
424
|
-
try:
|
|
425
|
-
await asyncio.wait_for(browser.close(), timeout=close_timeout_seconds)
|
|
426
|
-
except Exception as close_err:
|
|
427
|
-
logger.warning(f"Browser close timeout/error ignored: {close_err}")
|
|
428
|
-
finally:
|
|
429
|
-
if p is not None:
|
|
430
|
-
try:
|
|
431
|
-
await asyncio.wait_for(p.stop(), timeout=close_timeout_seconds)
|
|
432
|
-
except Exception as close_err:
|
|
433
|
-
logger.warning(f"Playwright stop timeout/error ignored: {close_err}")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/publishing/__init__.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/publishing/media.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/publishing/models.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/publishing/validator.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/rednote/__init__.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/platforms/rednote/issues.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/_runtime/services/scraper_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/persistence/file_account_repo.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/platform/rednote/__init__.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/platform/rednote/extractor.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/adapters/platform/rednote/publisher.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/account_list.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/account_mutation.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/auth_status.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/init_runtime.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/note_search.py
RENAMED
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/publish_note.py
RENAMED
|
File without changes
|
|
File without changes
|
{rednote-cli-0.1.7 → rednote-cli-0.1.8}/src/rednote_cli/application/use_cases/user_search.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|