MCPcopy Create free account

hub / github.com/TheSmallHanCat/flow2api / functions

Functions1,214 in github.com/TheSmallHanCat/flow2api

↓ 2 callersFunctionstart_runtime_prepare
(runtime_kind: str, message: str)
src/core/browser_runtime_status.py:50
↓ 2 callersMethodstop_cleanup_task
Stop background cleanup task
src/services/file_cache.py:190
↓ 2 callersMethodstream_flow_creation_agent
( self, at: str, payload: Dict[str, Any], *, project_id: Optional[str]
src/services/flow_client.py:2675
↓ 2 callersMethodupdate_proxy_config
Update proxy configuration
src/core/database.py:1374
↓ 2 callersMethodupdate_request_log
Update an existing request log row.
src/core/database.py:1517
↓ 2 callersMethodupdate_task
Update task
src/core/database.py:1181
↓ 2 callersMethodupdate_token_refresh_config
Update protocol ST refresh configuration.
src/core/database.py:2030
↓ 2 callersMethodverify_admin
Verify admin credentials
src/core/auth.py:21
↓ 2 callersMethodwarmup_browser_slots
(self)
src/services/browser_captcha.py:2700
↓ 2 callersMethodwarmup_resident_tabs
启动时预热共享常驻标签页。 对每个 project_id 调用 _ensure_resident_tab 创建标签页, 达到 limit 数量后停止。返回已预热的 slot_id 列表。
src/services/browser_captcha_personal.py:11997
↓ 1 callersMethod_acquire_image_launch_gate
图片请求不再做本地发车排队,直接进入取 token 并提交上游。
src/services/flow_client.py:1018
↓ 1 callersMethod_add_pending
(self, token_id: int, for_image_generation: bool, for_video_generation: bool)
src/services/load_balancer.py:37
↓ 1 callersFunction_append_login_hint
(target_url: str, email: Optional[str])
src/services/protocol_login.py:179
↓ 1 callersFunction_append_openai_reference_images
( model: str, messages: List[ChatMessage], images: List[bytes], )
src/api/routes.py:325
↓ 1 callersMethod_apply_fingerprint_surface_spoof
(self, tab, *, label: str)
src/services/browser_captcha_personal.py:5366
↓ 1 callersMethod_apply_headless_visibility_spoof
(self, tab, *, label: str)
src/services/browser_captcha_personal.py:5419
↓ 1 callersMethod_apply_runtime_profile_to_tab
( self, tab, *, label: str, browser_context_id: Any = None, ta
src/services/browser_captcha_personal.py:2997
↓ 1 callersFunction_apply_veo_3_1_model_updates
Keep the public aliases aligned with the current Veo 3.1 model families.
src/services/generation_handler.py:770
↓ 1 callersMethod_as_utc
(self, value: Optional[datetime])
src/services/token_manager.py:87
↓ 1 callersMethod_build_bezier_mouse_path
( self, start: tuple[float, float], end: tuple[float, float], *, viewp
src/services/browser_captcha_personal.py:5494
↓ 1 callersMethod_build_browser_environment_patch_config
(self)
src/services/browser_captcha.py:467
↓ 1 callersMethod_build_browser_environment_patch_source
(self)
src/services/browser_captcha.py:554
↓ 1 callersMethod_build_cdp_cookie_params
(self, browser_cookies: Iterable[Dict[str, Any]])
src/services/browser_captcha_personal.py:6782
↓ 1 callersMethod_build_configured_browser_cookie_targets
构建系统级浏览器启动 cookie,确保 Google / reCAPTCHA 首跳都能命中。
src/services/browser_captcha_personal.py:6442
↓ 1 callersFunction_build_cookie_merge_key
(cookie: Dict[str, Any], default_url: str)
src/services/browser_cookie_utils.py:228
↓ 1 callersMethod_build_download_headers
构建媒体下载请求头,优先复用当前打码浏览器指纹。
src/services/file_cache.py:122
↓ 1 callersMethod_build_flow_project_url
(self, project_id: Optional[str])
src/services/browser_captcha.py:1029
↓ 1 callersFunction_build_gemini_error_response_from_handler
(payload: Dict[str, Any])
src/api/routes.py:545
↓ 1 callersFunction_build_gemini_success_payload
( payload: Dict[str, Any], response_model: str, )
src/api/routes.py:657
↓ 1 callersFunction_build_image_parts_from_uri
(uri: str)
src/api/routes.py:592
↓ 1 callersFunction_build_openai_json_response
(payload: Dict[str, Any])
src/api/routes.py:531
↓ 1 callersFunction_build_personal_browser_args
构建 personal 模式浏览器启动参数。 说明: - 始终依赖独立临时 user-data-dir,避免污染系统真实资料。 - 显式去掉 `--profile-directory=Default` 这种容易误导的配置。 - 显式加 `--no-startup-w
src/services/browser_captcha_personal.py:535
↓ 1 callersMethod_build_personal_cookie_targets
为 personal 内置浏览器构建 cookie 注入列表。 说明: - 原始 Cookie 头没有 domain 元数据时,直接扩展到 labs/google/recaptcha 三个目标。 - 即使 token.cookie 已经带有显式的 g
src/services/browser_captcha_personal.py:6382
↓ 1 callersMethod_build_project_buckets_for_workers
( self, project_ids: list[str], *, worker_limits: list[int], )
src/services/browser_captcha_personal.py:13339
↓ 1 callersMethod_build_realistic_video_submit_headers
构造当前上游真实抓包风格的视频提交头。
src/services/flow_client.py:937
↓ 1 callersMethod_build_recaptcha_asset_data_url
Build a data URL backed by the local asset cache.
src/services/browser_captcha_personal.py:8663
↓ 1 callersMethod_build_recaptcha_local_asset_bundle
Build a compact rewrite bundle for local reCAPTCHA static assets.
src/services/browser_captcha_personal.py:8697
↓ 1 callersMethod_build_recaptcha_local_asset_hook_source
Build the browser-side rewrite hook for reCAPTCHA static assets.
src/services/browser_captcha_personal.py:8755
↓ 1 callersFunction_build_remote_browser_http_timeout
(read_timeout: float)
src/api/admin.py:268
↓ 1 callersMethod_build_remote_browser_http_timeout
(read_timeout: float)
src/services/flow_client.py:4300
↓ 1 callersMethod_build_runtime_extra_http_headers
(self)
src/services/browser_captcha_personal.py:2819
↓ 1 callersMethod_build_runtime_permission_origins
(self, target_url: Optional[str] = None)
src/services/browser_captcha_personal.py:2892
↓ 1 callersMethod_build_runtime_surface_profile
( self, *, user_agent: Optional[str] = None, product: Optional[str] = None,
src/services/browser_captcha_personal.py:3164
↓ 1 callersMethod_build_runtime_user_agent_metadata
(self)
src/services/browser_captcha_personal.py:2848
↓ 1 callersMethod_build_solve_bundle
( self, *, token: str, project_id: str, action: str, token_id:
src/services/browser_captcha_personal.py:10665
↓ 1 callersMethod_build_tab_fingerprint_spoof_config
(self, tab)
src/services/browser_captcha_personal.py:3558
↓ 1 callersMethod_build_token_session_cookie_targets
(cls, session_token: str)
src/services/browser_captcha.py:1044
↓ 1 callersFunction_build_video_parts_from_uri
(uri: str)
src/api/routes.py:625
↓ 1 callersMethod_capture_visible_startup_page
记录浏览器启动后自带的首个 page target,避免后续先关空页再开业务页。
src/services/browser_captcha_personal.py:5753
↓ 1 callersMethod_check_available
检查服务是否可用
src/services/browser_captcha_personal.py:2255
↓ 1 callersMethod_cleanup_affinity_maps
(self)
src/services/browser_captcha_personal.py:12675
↓ 1 callersMethod_cleanup_expired_files
Remove expired cache files
src/services/file_cache.py:222
↓ 1 callersMethod_cleanup_loop
Background task to clean up expired files
src/services/file_cache.py:207
↓ 1 callersMethod_cleanup_runtime_profile_dirs_after_shutdown
(self, *, reason: str)
src/services/browser_captcha_personal.py:1689
↓ 1 callersMethod_cleanup_stale_slot_process
(self)
src/services/browser_captcha.py:974
↓ 1 callersMethod_clear_browser_cache
清理浏览器全部缓存
src/services/browser_captcha_personal.py:11725
↓ 1 callersMethod_clear_tab_site_storage
清理当前站点的本地存储状态,但保留 cookies 登录态。
src/services/browser_captcha_personal.py:9634
↓ 1 callersFunction_coerce_gemini_contents
(raw_contents: Optional[List[Any]])
src/api/routes.py:238
↓ 1 callersMethod_collect_reclaimable_resident_slot_ids
(self)
src/services/browser_captcha_personal.py:2475
↓ 1 callersMethod_collect_runtime_profile_process_targets
(self)
src/services/browser_captcha_personal.py:8188
↓ 1 callersFunction_compose_proxy_url
Compose a proxy URL from parsed proxy parts.
src/services/browser_captcha_personal.py:1018
↓ 1 callersFunction_configure_asyncio_policy
()
src/main.py:55
↓ 1 callersFunction_configure_local_no_proxy
()
src/main.py:40
↓ 1 callersFunction_configure_process_runtime
()
src/main.py:76
↓ 1 callersFunction_configure_stdio_utf8
()
src/main.py:29
↓ 1 callersMethod_consume_resident_slot_reservation
( self, slot_id: Optional[str], resident_info: Optional[ResidentTabInfo] = None, )
src/services/browser_captcha_personal.py:6590
↓ 1 callersMethod_create_default_context_target_tab
( self, url: str, *, label: str, timeout_seconds: Optional[float] = No
src/services/browser_captcha_personal.py:5901
↓ 1 callersMethod_create_generation_result
????????????????
src/services/generation_handler.py:1087
↓ 1 callersFunction_create_proxy_auth_extension
Create a temporary Chrome extension directory for proxy authentication. Returns the path to the extension directory.
src/services/browser_captcha_personal.py:1312
↓ 1 callersMethod_cubic_bezier_point
( start: tuple[float, float], control_a: tuple[float, float], control_b: tuple[float,
src/services/browser_captcha_personal.py:5467
↓ 1 callersMethod_default_runtime_profile_dir
(self)
src/services/browser_captcha_personal.py:1606
↓ 1 callersMethod_derive_runtime_os_profile
(cls, user_agent: Optional[str])
src/services/browser_captcha_personal.py:3132
↓ 1 callersFunction_detect_image_mime_type
(image_bytes: bytes, fallback: str = "image/png")
src/api/routes.py:154
↓ 1 callersMethod_detect_image_mime_type
通过文件头 magic bytes 检测图片 MIME 类型 Args: image_bytes: 图片字节数据 Returns: MIME 类型字符串,默认 image/jpeg
src/services/flow_client.py:1367
↓ 1 callersMethod_disconnect_browser_connection_quietly
尽量先关闭 DevTools websocket,减少 nodriver 后台任务在浏览器退场时炸栈。
src/services/browser_captcha_personal.py:8115
↓ 1 callersMethod_discover_dynamic_recaptcha_static_urls
Recursively discover reCAPTCHA static assets from bootstrap/JS/CSS content.
src/services/browser_captcha_personal.py:8620
↓ 1 callersMethod_download_recaptcha_asset_bytes
Download a reCAPTCHA-related static asset through the same proxy path.
src/services/browser_captcha_personal.py:8565
↓ 1 callersMethod_download_recaptcha_bootstrap_source
Download the reCAPTCHA bootstrap source using the same proxy path as the browser.
src/services/browser_captcha_personal.py:8979
↓ 1 callersMethod_ease_human_progress
(t: float)
src/services/browser_captcha_personal.py:5490
↓ 1 callersMethod_encode_trpc_input
(self, payload: Dict[str, Any])
src/services/flow_client.py:316
↓ 1 callersFunction_enrich_payload_with_direct_url
(payload: Dict[str, Any])
src/api/routes.py:585
↓ 1 callersFunction_ensure_browser_installed
确保 chromium 浏览器已安装
src/services/browser_captcha.py:157
↓ 1 callersMethod_ensure_idle_worker_reaper
(self)
src/services/browser_captcha_personal.py:12881
↓ 1 callersFunction_ensure_nodriver_installed
确保 nodriver 已安装 Returns: 是否安装成功/已安装
src/services/browser_captcha_personal.py:330
↓ 1 callersFunction_ensure_playwright_installed
确保 playwright 已安装
src/services/browser_captcha.py:127
↓ 1 callersMethod_evict_lru_tab_if_needed
如果达到共享池上限,使用 LRU 策略淘汰最久未使用的空闲标签页。
src/services/browser_captcha_personal.py:6277
↓ 1 callersMethod_execute_captcha
在给定 context 中执行打码逻辑
src/services/browser_captcha.py:1822
↓ 1 callersMethod_execute_custom_recaptcha_on_tab
在指定标签页执行任意站点的 reCAPTCHA。
src/services/browser_captcha_personal.py:10311
↓ 1 callersMethod_extract_flow_entity_id
(self, entity_payload: Dict[str, Any])
src/services/flow_client.py:2523
↓ 1 callersFunction_extract_prompt_and_images_from_gemini_contents
( contents: List[GeminiContent], )
src/api/routes.py:363
↓ 1 callersFunction_extract_prompt_and_images_from_openai_messages
Extract prompt, images, and optional video_media_id from messages. Returns: (prompt, images, video_media_id) video_media_id is se
src/api/routes.py:289
↓ 1 callersFunction_extract_redirect_from_html
(text: str)
src/services/protocol_login.py:109
↓ 1 callersFunction_extract_text_from_gemini_content
(content: Optional[GeminiContent])
src/api/routes.py:248
↓ 1 callersMethod_extract_turn_count
(self, session_detail: Dict[str, Any])
src/services/flow_client.py:2551
↓ 1 callersFunction_extract_url_from_openai_payload
(payload: Dict[str, Any])
src/api/routes.py:565
↓ 1 callersMethod_extract_video_metadata_from_media
( self, media: Dict[str, Any], )
src/services/flow_client.py:1927
↓ 1 callersMethod_extract_video_status_from_media
(self, media: Dict[str, Any])
src/services/flow_client.py:1902
↓ 1 callersMethod_extract_video_url_from_media
(self, media: Dict[str, Any])
src/services/flow_client.py:1915
↓ 1 callersFunction_fake_cdp_command
()
tests/test_browser_captcha_personal.py:67
↓ 1 callersFunction_finalize_nodriver_send_task
回收 nodriver websocket.send 的后台异常,避免事件循环打印未检索 task 错误。
src/services/browser_captcha_personal.py:803
← previousnext →501–600 of 1,214, ranked by callers