daijro / camoufox

🦊 Anti-detect browser
https://camoufox.com
Mozilla Public License 2.0
639 stars 49 forks source link

[pythonlib] `pysocks` is missing #43

Closed tobwen closed 4 weeks ago

tobwen commented 1 month ago

Describe the bug:

While solving #42, I figured out that pysocks is missing in https://github.com/daijro/camoufox/blob/main/pythonlib/pyproject.toml

Error disappears after pip install pysocks

Screenshots:

  File "/root/test/venv/lib/python3.11/site-packages/requests/adapters.py", line 282, in proxy_manager_for
    manager = self.proxy_manager[proxy] = SOCKSProxyManager(
                                          ^^^^^^^^^^^^^^^^^^
  File "/root/test/venv/lib/python3.11/site-packages/requests/adapters.py", line 64, in SOCKSProxyManager
    raise InvalidSchema("Missing dependencies for SOCKS support.")
requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support.

To Reproduce:

CONFIG = {
    "parameters": {
        "block_images": True,
        "geoip": True,
        "headless": False,
        "humanize": True,
        "locale": "de-DE",
        "proxy": {
            "server": "socks5://127.0.0.1:1080",
            "username": "",
            "password": "",
        },
        "firefox_user_prefs": {
            "permissions.default.image": 2,
            "intl.accept_languages": "de,en-US,en",
        }
    }
}

 with Camoufox(**CONFIG["parameters"]) as browser:
    with browser.new_context(proxy=CONFIG["parameters"]["proxy"], ignore_https_errors=True) as context:

Version:

Camoufox: v130.0.1-beta.11 (Up to date!)
daijro commented 4 weeks ago

Thanks! Fixed in 0.3.0 of the Python library.