try to use curl_cffi

This commit is contained in:
2024-10-05 00:51:51 +02:00
parent 6976e0f484
commit c2db1035c4
3 changed files with 44 additions and 15 deletions
+12 -12
View File
@@ -6,18 +6,18 @@ from proxy_manager.proxy_manager import ProxyManager
def get_address_ip(proxy_to_use):
return ""
# try:
# response = requests.get(url="https://api.ipify.org", proxies=proxy_to_use, verify=False,
# timeout=15)
# print(response.status_code)
# if response.status_code == 200:
# return response.text
# else:
# return ""
# except Exception as Error:
# print(Error)
# return "error"
# return ""
try:
response = requests.get(url="https://api.ipify.org", proxies=proxy_to_use, verify=False,
timeout=15)
print(response.status_code)
if response.status_code == 200:
return response.text
else:
return ""
except Exception as Error:
print(Error)
return "error"
if __name__ == '__main__':