format with ruff
This commit is contained in:
+4
-2
@@ -7,13 +7,14 @@ LEAGUES = [
|
||||
("hockey", "nhl"),
|
||||
("football", "nfl"),
|
||||
("basketball", "nba"),
|
||||
("baseball", "mlb")
|
||||
("baseball", "mlb"),
|
||||
]
|
||||
|
||||
LOGO_SIZE = (16, 16)
|
||||
|
||||
os.makedirs("./assets/logos", exist_ok=True)
|
||||
|
||||
|
||||
def download_logos(sport, league):
|
||||
url = f"https://site.api.espn.com/apis/site/v2/sports/{sport}/{league}/teams"
|
||||
resp = requests.get(url, timeout=10)
|
||||
@@ -49,8 +50,9 @@ def download_logos(sport, league):
|
||||
except Exception as e:
|
||||
print(f"Error downloading {abbr}: {e}")
|
||||
|
||||
|
||||
for sport, league in LEAGUES:
|
||||
print(f"\nDownloading {league.upper()} logos...")
|
||||
download_logos(sport, league)
|
||||
|
||||
print("\nDone!")
|
||||
print("\nDone!")
|
||||
|
||||
Reference in New Issue
Block a user