xianyu-backend-java/utils/xianyu_slider_stealth.pyi
zhinianboke df052b820b 1
2025-10-24 20:54:08 +08:00

88 lines
3.1 KiB
Python

# This file was generated by Nuitka
# Stubs included by default
from __future__ import annotations
from config import SLIDER_VERIFICATION
from datetime import datetime
from loguru import logger
from playwright.sync_api import ElementHandle, sync_playwright
from typing import Any, Dict, List, Optional, Tuple
from typing_extensions import Self
import json
import os
import random
import shutil
import tempfile
import threading
import time
SLIDER_MAX_CONCURRENT = 3
SLIDER_WAIT_TIMEOUT = 60
class SliderConcurrencyManager:
def __new__(cls: cls) -> Any: ...
def __init__(self: Self) -> None: ...
def can_start_instance(self: Self, user_id: str) -> bool: ...
def wait_for_slot(self: Self, user_id: str, timeout: int) -> bool: ...
def register_instance(self: Self, user_id: str, instance: Any) -> Any: ...
def unregister_instance(self: Self, user_id: str) -> Any: ...
def _extract_pure_user_id(self: Self, user_id: str) -> str: ...
def get_stats(self: Self) -> Any: ...
class XianyuSliderStealth:
def __init__(self: Self, user_id: str, enable_learning: bool, headless: bool) -> None: ...
def _check_date_validity(self: Self) -> bool: ...
def init_browser(self: Self) -> Any: ...
def _cleanup_on_init_failure(self: Self) -> Any: ...
def _load_success_history(self: Self) -> List[Dict[str, Any]]: ...
def _save_success_record(self: Self, trajectory_data: Dict[str, Any]) -> Any: ...
def _optimize_trajectory_params(self: Self) -> Dict[str, Any]: ...
def _get_cookies_after_success(self: Self) -> Any: ...
def _save_cookies_to_file(self: Self, cookies: Any) -> Any: ...
def _get_random_browser_features(self: Self) -> Any: ...
def _get_stealth_script(self: Self, browser_features: Any) -> Any: ...
def generate_human_trajectory(self: Self, distance: float) -> Any: ...
def simulate_slide(self: Self, slider_button: ElementHandle, trajectory: Any) -> Any: ...
def find_slider_elements(self: Self) -> Any: ...
def calculate_slide_distance(self: Self, slider_button: ElementHandle, slider_track: ElementHandle) -> Any: ...
def check_verification_success(self: Self, slider_button: ElementHandle) -> Any: ...
def check_page_changed(self: Self) -> Any: ...
def check_verification_failure(self: Self) -> Any: ...
def solve_slider(self: Self) -> Any: ...
def close_browser(self: Self) -> Any: ...
def __del__(self: Self) -> Any: ...
def login_with_password_headful(self: Self, account: str, password: str, show_browser: bool) -> Any: ...
def run(self: Self, url: str) -> Any: ...
def get_slider_stats() -> Any:
...
__name__ = ...
# Modules used internally, to allow implicit dependencies to be seen:
import time
import random
import json
import os
import threading
import tempfile
import shutil
import datetime
import playwright
import playwright.sync_api
import playwright.sync_api.sync_playwright
import playwright.sync_api.ElementHandle
import typing
import loguru
import loguru.logger
import config
import traceback
import re
import DrissionPage
import DrissionPage.ChromiumPage
import DrissionPage.ChromiumOptions
import subprocess
import platform
import sys