Теперь у меня проблема
Код: Выделить всё
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)')))
Сертификат SSL, используемый моим виртуальным компьютером, — это бесплатный сертификат SSL, применяемый Tencent Cloud
Это мой код сценария< /p>
Код: Выделить всё
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
pip install urllib3==1.25.11
и мой vps не использует прокси, VPN и т. д.
Подробнее здесь: https://stackoverflow.com/questions/788 ... -ssl-c1129