My script is a BOT script that calls PUBG’s open api for data query
Now I have a problem
HTTPSConnectionPool(host='api.pubg.com', port=443):
Max retries exceeded with url: /shards/steam/players?filter%5BplayerNames%5D=Dai
lyMidv_x (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protoc
ol (_ssl.c:1129)')))
This problem occurs occasionally and does not occur frequently
The SSL certificate used by my vps is the free SSL certificate applied by Tencent Cloud
This is my script code
def get_player_data(player_id):
url = f"https://api.pubg.com/shards/steam/players?filter[playerNames]={player_id}"
try:
response = requests.get(url, headers=headers)
except requests.exceptions.RequestException as e:
print(f"error:{e}")
sys.exit(3)
if response.status_code in 429:
sys.exit(2)
elif response.status_code in [400, 404]:
sys.exit(1)
else:
data = response.json()
ban_type = data['data'][0]['attributes']['banType'] if 'data' in data and data['data'] else None
account_id = data['data'][0]['id'] if 'data' in data and data['data'] else None
return data, ban_type, account_id
I tried downgrading but the problem persists
pip install urllib3==1.25.11
and my vps is not using a proxy, VPN, etc.
New contributor
user20156787 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.