Некорректно отображаются данные из API
Проблема заключается в том данных из API https://www.sofascore.com/api/v1/event/12116983 выгружаются отличные от реальных данных. Причем при просмотре этого API через инспектор данные отображаются верно. Реальные данные: homeScore_period1 - 1 awayScore_period1 - 0 homeScore_period2 - 0 awayScore_period2 - 0
import requests
cookies = {
'_ga_HNQ9P9MGZR': 'GS1.1.1724770200.3.1.1724772594.22.0.0',
'_ga': 'GA1.1.1242550640.1724734950',
}
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101
Firefox/129.0',
'Accept': '*/*',
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
'Accept-Encoding': 'gzip, deflate, br, zstd',
'Referer': 'https://www.sofascore.com/ru/football/match/criciuma-juventude/FOsJO',
'X-Requested-With': '25be13',
'Connection': 'keep-alive',
# 'Cookie': '_ga_HNQ9P9MGZR=GS1.1.1724770200.3.1.1724772594.22.0.0;
_ga=GA1.1.1242550640.1724734950',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
'If-None-Match': 'W/"10d00305c6"',
'Priority': 'u=4',
'Cache-Control': 'max-age=0',
# Requests doesn't support trailers
# 'TE': 'trailers',
}
url = "https://www.sofascore.com/api/v1/event/12116983"
res = requests.get(url=url, headers=headers, cookies=cookies)
r = res.json()
events_tour = r["event"]
status_match = events_tour["status"]["type"]
if status_match == "finished":
home_team = events_tour["homeTeam"]["name"]
away_team = events_tour["awayTeam"]["name"]
score_home_1nd = events_tour["homeScore"]["period1"]
score_away_1nd = events_tour["awayScore"]["period1"]
score_home_2nd = events_tour["homeScore"]["period2"]
score_away_2nd = events_tour["awayScore"]["period2"]
id_match = events_tour["id"]
print(id_match)
round = events_tour["roundInfo"]["round"]
print(f'homeScore_period1 - {score_home_1nd}')
print(f'awayScore_period1 - {score_away_1nd}')
print(f'homeScore_period2 - {score_home_2nd}')
print(f'awayScore_period2 - {score_away_2nd}')