diff --git a/pythonlib/camoufox/addons.py b/pythonlib/camoufox/addons.py index 974e3f1..c172d62 100644 --- a/pythonlib/camoufox/addons.py +++ b/pythonlib/camoufox/addons.py @@ -54,6 +54,10 @@ def confirm_paths(paths: List[str]) -> None: for path in paths: if not os.path.isdir(path): raise InvalidAddonPath(path) + if not os.path.exists(os.path.join(path, 'manifest.json')): + raise InvalidAddonPath( + 'manifest.json is missing. Addon path must be a path to an extracted addon.' + ) def get_open_port() -> int: diff --git a/pythonlib/camoufox/ip.py b/pythonlib/camoufox/ip.py index 50220c4..cca4ac6 100644 --- a/pythonlib/camoufox/ip.py +++ b/pythonlib/camoufox/ip.py @@ -6,7 +6,6 @@ from functools import lru_cache from typing import Dict, Optional, Tuple import requests -from urllib3 import disable_warnings from urllib3.exceptions import InsecureRequestWarning from .exceptions import InvalidIP, InvalidProxy @@ -108,6 +107,8 @@ def public_ip(proxy: Optional[str] = None) -> str: ip = resp.text.strip() validate_ip(ip) return ip + except requests.exceptions.ProxyError as e: + raise InvalidProxy(f"Failed to connect to proxy: {proxy}") from e except (requests.RequestException, InvalidIP): pass raise InvalidIP("Failed to get IP address") diff --git a/pythonlib/pyproject.toml b/pythonlib/pyproject.toml index 811c529..14381ba 100644 --- a/pythonlib/pyproject.toml +++ b/pythonlib/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "camoufox" -version = "0.3.2" +version = "0.3.3" description = "Wrapper around Playwright to help launch Camoufox" authors = ["daijro "] license = "MIT"