22.10.2025 test REF
This commit is contained in:
62
get_data.py
62
get_data.py
@@ -848,38 +848,38 @@ 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() 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
|
||||||
]
|
# ]
|
||||||
coach_stat_temp = [
|
# coach_stat_temp = [
|
||||||
pool.submit(
|
# pool.submit(
|
||||||
Coach_Stat, coach_id, data["season"], data[f"{who}_id"]
|
# Coach_Stat, coach_id, data["season"], data[f"{who}_id"]
|
||||||
)
|
# )
|
||||||
for coach_id in coach_ids
|
# for coach_id in coach_ids
|
||||||
]
|
# ]
|
||||||
player_futures = [
|
# player_futures = [
|
||||||
pool.submit(Player_all_game, pid) for pid in player_ids
|
# pool.submit(Player_all_game, pid) for pid in player_ids
|
||||||
]
|
# ]
|
||||||
all_players_games = []
|
# all_players_games = []
|
||||||
for fut in as_completed(player_futures):
|
# for fut in as_completed(player_futures):
|
||||||
try:
|
# try:
|
||||||
all_players_games.append(fut.result())
|
# all_players_games.append(fut.result())
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
logger.exception(f"Ошибка при обработке игрока: {e}")
|
# logger.exception(f"Ошибка при обработке игрока: {e}")
|
||||||
|
|
||||||
player_season_stat += [
|
# player_season_stat += [
|
||||||
res.result() for res in player_season_stat_temp
|
# res.result() for res in player_season_stat_temp
|
||||||
]
|
# ]
|
||||||
player_career_stat += [
|
# player_career_stat += [
|
||||||
res.result() for res in player_career_stat_temp
|
# res.result() for res in player_career_stat_temp
|
||||||
]
|
# ]
|
||||||
coach_stat += [res.result() for res in coach_stat_temp]
|
# coach_stat += [res.result() for res in coach_stat_temp]
|
||||||
|
|
||||||
initialized = True
|
initialized = True
|
||||||
# print(coach_stat)
|
# print(coach_stat)
|
||||||
@@ -1637,8 +1637,8 @@ def Json_Team_Generation(who, data, stop_event):
|
|||||||
x.get("startRole", 99), 99
|
x.get("startRole", 99), 99
|
||||||
), # 99 — по умолчанию
|
), # 99 — по умолчанию
|
||||||
)
|
)
|
||||||
rewrite_file(who, sorted_team) # type: ignore
|
rewrite_file(who, sorted_team)
|
||||||
rewrite_file(f"{who}_copy", sorted_team) # type: ignore
|
rewrite_file(f"{who}_copy", sorted_team)
|
||||||
# print(sorted_team)
|
# print(sorted_team)
|
||||||
top_sorted_team = sorted(
|
top_sorted_team = sorted(
|
||||||
filter(lambda x: x["startRole"] in ["Player", ""], sorted_team),
|
filter(lambda x: x["startRole"] in ["Player", ""], sorted_team),
|
||||||
@@ -2709,7 +2709,7 @@ def get_season_and_schedule() -> dict | None:
|
|||||||
if season_data and "vtb" in URL
|
if season_data and "vtb" in URL
|
||||||
else (
|
else (
|
||||||
season_data.get("items", [{}])[0].get("season")
|
season_data.get("items", [{}])[0].get("season")
|
||||||
if season_data and "pro.russiabasket" in URL
|
if season_data and "russiabasket" in URL
|
||||||
else None
|
else None
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -3045,7 +3045,7 @@ def main():
|
|||||||
URL = (
|
URL = (
|
||||||
"https://basket.sportoteka.org/"
|
"https://basket.sportoteka.org/"
|
||||||
if "uba" in LEAGUE.lower()
|
if "uba" in LEAGUE.lower()
|
||||||
else "https://pro.russiabasket.org/"
|
else "https://ref.russiabasket.org/" #pro - основа, ref - резерв
|
||||||
# else "https://vtb-league.org/"
|
# else "https://vtb-league.org/"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user