free-proxy icon indicating copy to clipboard operation
free-proxy copied to clipboard

failed to get proxy

Open Roboxkin opened this issue 11 months ago • 1 comments

I haven't received a proxy yet, is it possible that it no longer works? I will install with pip Here is my code

    def proxy():
        i = 1
        while True:
            try:
                proxy = FreeProxy(google=True, https=True).get()
            except:
                status_fail = Fore.RED + 'FAIL'
                print(f'failed to get proxy {status_fail}')
                time.sleep(2)
                if i == 50:
                    status_fail = Fore.RED + 'proxy not found'
                    sys.exit(f'{status_fail}')
                i += 1
            else:
                status_ok = Fore.GREEN + 'OK'
                print(f'proxy {proxy} status {status_ok}')
                break
        return proxy

    proxy = proxy()

50 lines always "failed to get proxy FAIL" Any ideas? Thank you

Roboxkin avatar Mar 20 '24 17:03 Roboxkin

I removed https=True from the code and everything worked immediately

Roboxkin avatar Mar 20 '24 18:03 Roboxkin