DedInc / pyanty

Python module for controlling Dolphin browser profiles using Selenium, Pyppeteer, and Playwright. Includes Dolphin API for profile management.
https://pypi.org/project/pyanty
MIT License
45 stars 14 forks source link

Problem with setting a proxy #1

Closed Allamaris0 closed 9 months ago

Allamaris0 commented 9 months ago

Thx you for this library. You save my time. However, there is a problem with set a proxy programmatically.

        data = api.fingerprint_to_profile(name=checked_profile, fingerprint=fingerprint)

        splitted = (proxy_address.replace("http://","")).split("@")
        host = 'http://proxy.proxyverse.io'
        port = '9200'
        login = splitted[0].split(":")[0]
        password = splitted[0].split(":")[1]

        data.update({'proxy': {
            'name': proxy_address,
            'host': host,
            'port': port,
            'type': 'http',
            'login': login,
            'password': password
        }})

        ip_address = check_ip(proxy_address)

        if ip_address:
            data.update({'webrtc': {
                'mode': 'manual',
                'ipAddress': ip_address,
            }})

        response = api.create_profile(data)
        print(response)
        profile_id = response['browserProfileId']

        check_proxy = api.check_proxy(host=host, port=port, type='http',
                                   login=login,
                                   password=password)
        print(check_proxy)

        try:
            run_profile(profile_id)
        except:
            print("Launch Dolphin")

When it launches browser, I can't open any website, because it shows ERR_NO_SUPPORTED_PROXIES. It's no problem with a proxy because api.check_proxy() returns success. Also it works when I copy a proxy address from profile proxy and I set a new proxy with the same address manually.

Allamaris0 commented 9 months ago

I fix the problem :stuck_out_tongue_closed_eyes:. My bad. There should be host = 'proxy.proxyverse.io'