INNER CODE UNIT · Python

resolve_default_har_path

cwuom/NeriPlayer · tools_pub/ytmusic_api_probe.py:503

def resolve_default_har_path(explicit: str) -> Path | None:
    if explicit:
        path = Path(explicit)
        return path if path.is_file() else None
    for candidate in HAR_DEFAULT_CANDIDATES:
        if candidate.is_file():
            return candidate
    return None


def random_nonce(length: int = 16) -> str:
    alphabet = string.ascii_letters + string.digits
    return "".join(secrets.choice(alphabet) for _ in range(length))


def resolve_browser_name(user_agent: str) -> str:
    if "Chrome/" in user_agent:
        return "Chrome"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…