Compare commits
2 Commits
00a01eb8a9
...
39ba101948
| Author | SHA1 | Date | |
|---|---|---|---|
| 39ba101948 | |||
| 886339b183 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,4 +1,7 @@
|
|||||||
.venv/*
|
.venv/*
|
||||||
/JSON/*
|
/JSON/*
|
||||||
/logs/*
|
/logs/*
|
||||||
/static/*
|
/static/*
|
||||||
|
get_data_new copy 2.py
|
||||||
|
get_data_new copy.py
|
||||||
|
temp.json
|
||||||
36
get_data.py
36
get_data.py
@@ -71,7 +71,7 @@ LOG_CONFIG = {
|
|||||||
},
|
},
|
||||||
"console": {
|
"console": {
|
||||||
"class": "logging.StreamHandler",
|
"class": "logging.StreamHandler",
|
||||||
"level": "INFO",
|
"level": "DEBUG",
|
||||||
"formatter": "simple",
|
"formatter": "simple",
|
||||||
"stream": "ext://sys.stdout",
|
"stream": "ext://sys.stdout",
|
||||||
},
|
},
|
||||||
@@ -217,7 +217,7 @@ else: # значит указан --region
|
|||||||
# === Глобальные настройки ===
|
# === Глобальные настройки ===
|
||||||
TIMEOUT_ONLINE = 1
|
TIMEOUT_ONLINE = 1
|
||||||
FETCH_INTERVAL = 2
|
FETCH_INTERVAL = 2
|
||||||
TIMEOUT_DATA_OFF = 60
|
TIMEOUT_DATA_OFF = 1
|
||||||
|
|
||||||
|
|
||||||
game_online_data = None
|
game_online_data = None
|
||||||
@@ -412,7 +412,7 @@ def Game_Online(game_id: int) -> dict | None:
|
|||||||
return f"{URL}api/abc/games/{endpoint}?Id={game_id}&Lang={LANG}"
|
return f"{URL}api/abc/games/{endpoint}?Id={game_id}&Lang={LANG}"
|
||||||
|
|
||||||
box_score = get_json(build_url("box-score"))
|
box_score = get_json(build_url("box-score"))
|
||||||
print(box_score)
|
# print(box_score)
|
||||||
if not box_score or box_score.get("status") != "Ok":
|
if not box_score or box_score.get("status") != "Ok":
|
||||||
# Проверим — матч сейчас online?
|
# Проверим — матч сейчас online?
|
||||||
live = get_json(f"{URL}api/abc/games/live-status?id={game_id}")
|
live = get_json(f"{URL}api/abc/games/live-status?id={game_id}")
|
||||||
@@ -848,11 +848,11 @@ def Json_Team_Generation(who, data, stop_event):
|
|||||||
player_season_stat = []
|
player_season_stat = []
|
||||||
player_career_stat = []
|
player_career_stat = []
|
||||||
coach_stat = []
|
coach_stat = []
|
||||||
with ThreadPoolExecutor(max_workers=1) as pool:
|
# with ThreadPoolExecutor(max_workers=1) as pool:
|
||||||
player_season_stat_temp = [
|
# player_season_stat_temp = [
|
||||||
pool.submit(Player_Stat_Season, player_id, data["season"])
|
# pool.submit(Player_Stat_Season, player_id, data["season"])
|
||||||
for player_id in player_ids
|
# for player_id in player_ids
|
||||||
]
|
# ]
|
||||||
# player_career_stat_temp = [
|
# player_career_stat_temp = [
|
||||||
# pool.submit(Player_Stat_Career, player_id)
|
# pool.submit(Player_Stat_Career, player_id)
|
||||||
# for player_id in player_ids
|
# for player_id in player_ids
|
||||||
@@ -1569,11 +1569,11 @@ def Json_Team_Generation(who, data, stop_event):
|
|||||||
),
|
),
|
||||||
"HeadCoachStatsCareer": HeadCoachStatsCareer,
|
"HeadCoachStatsCareer": HeadCoachStatsCareer,
|
||||||
"HeadCoachStatsTeam": HeadCoachStatsTeam,
|
"HeadCoachStatsTeam": HeadCoachStatsTeam,
|
||||||
"PTS_Career_High": get_carrer_high(item["personId"], "points"),
|
# "PTS_Career_High": get_carrer_high(item["personId"], "points"),
|
||||||
"AST_Career_High": get_carrer_high(item["personId"], "assist"),
|
# "AST_Career_High": get_carrer_high(item["personId"], "assist"),
|
||||||
"REB_Career_High": get_carrer_high(item["personId"], "rebound"),
|
# "REB_Career_High": get_carrer_high(item["personId"], "rebound"),
|
||||||
"STL_Career_High": get_carrer_high(item["personId"], "steal"),
|
# "STL_Career_High": get_carrer_high(item["personId"], "steal"),
|
||||||
"BLK_Career_High": get_carrer_high(item["personId"], "blockShot"),
|
# "BLK_Career_High": get_carrer_high(item["personId"], "blockShot"),
|
||||||
}
|
}
|
||||||
team.append(player)
|
team.append(player)
|
||||||
count_player = sum(1 for x in team if x["startRole"] == "Player")
|
count_player = sum(1 for x in team if x["startRole"] == "Player")
|
||||||
@@ -3105,7 +3105,7 @@ def main():
|
|||||||
threading.Thread(
|
threading.Thread(
|
||||||
target=Team_Both_Stat, args=(stop_event,), name="BothTeamsStat"
|
target=Team_Both_Stat, args=(stop_event,), name="BothTeamsStat"
|
||||||
),
|
),
|
||||||
threading.Thread(target=Referee, args=(stop_event,), name="Referee"),
|
# threading.Thread(target=Referee, args=(stop_event,), name="Referee"),
|
||||||
threading.Thread(
|
threading.Thread(
|
||||||
target=Scores_Quarter, args=(stop_event,), name="QuarterScore"
|
target=Scores_Quarter, args=(stop_event,), name="QuarterScore"
|
||||||
),
|
),
|
||||||
@@ -3115,9 +3115,9 @@ def main():
|
|||||||
threading.Thread(
|
threading.Thread(
|
||||||
target=Play_By_Play, args=(data, stop_event), name="PlayByPlay"
|
target=Play_By_Play, args=(data, stop_event), name="PlayByPlay"
|
||||||
),
|
),
|
||||||
threading.Thread(
|
# threading.Thread(
|
||||||
target=Standing_func, args=(data, stop_event), name="Standings"
|
# target=Standing_func, args=(data, stop_event), name="Standings"
|
||||||
),
|
# ),
|
||||||
]
|
]
|
||||||
|
|
||||||
# Запуск всех потоков
|
# Запуск всех потоков
|
||||||
@@ -3125,7 +3125,7 @@ def main():
|
|||||||
t.start()
|
t.start()
|
||||||
logger.debug(f"Поток {t.name} запущен.")
|
logger.debug(f"Поток {t.name} запущен.")
|
||||||
|
|
||||||
How_To_Play_Quarter(data)
|
# How_To_Play_Quarter(data)
|
||||||
pregame_data(data)
|
pregame_data(data)
|
||||||
|
|
||||||
# try:
|
# try:
|
||||||
|
|||||||
1515
get_data_new.py
Normal file
1515
get_data_new.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user