Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to get proxy #43

Open
Roboxkin opened this issue Mar 20, 2024 · 1 comment
Open

failed to get proxy #43

Roboxkin opened this issue Mar 20, 2024 · 1 comment

Comments

@Roboxkin
Copy link

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant