e
This commit is contained in:
parent
cf26d77e25
commit
00000d94e4
3 changed files with 21 additions and 1288 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -13,3 +13,4 @@ wheels/
|
||||||
.python-version
|
.python-version
|
||||||
stuff/
|
stuff/
|
||||||
cached-ca.pem
|
cached-ca.pem
|
||||||
|
ppv_api.json
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -22,25 +22,27 @@ UA = (
|
||||||
)
|
)
|
||||||
|
|
||||||
LOGOS = {
|
LOGOS = {
|
||||||
"default": "https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png",
|
"Bundesliga": "https://1000logos.net/wp-content/uploads/2020/09/Bundesliga-Logo-500x313.png",
|
||||||
"MLB": "https://i.gyazo.com/0fe7865ef2f06c9507791b24f04dbca8.png",
|
"La Liga": "https://1000logos.net/wp-content/uploads/2019/01/Spanish-La-Liga-Logo-500x281.png",
|
||||||
"NBA": "https://i.gyazo.com/773c23570f095a5d549c23b9401d83f4.png",
|
"Ligue 1": "https://1000logos.net/wp-content/uploads/2019/01/Ligue-1-Logo-500x281.png",
|
||||||
"NCAA": "https://i.gyazo.com/ca63b40c86e757436de9d34d369b24f8.png",
|
"MLB": "https://1000logos.net/wp-content/uploads/2017/04/MLB-Logo-500x281.png",
|
||||||
"NFL": "https://i.gyazo.com/fb4956d7a2fe54a1bac54cd81e1b3f11.png",
|
"MLS": "https://1000logos.net/wp-content/uploads/2017/10/MLS-logo-500x393.png",
|
||||||
"NHL": "https://i.gyazo.com/526607d4e886d5ed1fecca4bff3115e2.png",
|
"NBA": "https://1000logos.net/wp-content/uploads/2025/08/Jerry-West-the-NBA-Logo-500x281.png",
|
||||||
"WNBA": "https://i.gyazo.com/02d665a5704118d195dbcd5fa20d5462.png",
|
"NCAA": "https://1000logos.net/wp-content/uploads/2021/12/NCAA-Logo-500x281.png",
|
||||||
"La Liga": "https://i.gyazo.com/3ea07074f7faab98c00493f07f4c6661.png",
|
"NFL": "https://1000logos.net/wp-content/uploads/2017/05/NFL-logo-500x338.png",
|
||||||
"Premier League": "https://i.gyazo.com/5cf939a9669647ec49c5ca61ab34789d.png",
|
"NHL": "https://1000logos.net/wp-content/uploads/2017/05/NHL-Logo-500x333.png",
|
||||||
"Serie A": "https://i.gyazo.com/38fd8ea613b0f02780d2314fd49f7595.png",
|
"Premier League": "https://1000logos.net/wp-content/uploads/2017/05/Premier-League-logo-500x210.png",
|
||||||
"Bundesliga": "https://i.gyazo.com/d608cd1fe95c288aba9e03a9b2f2b688.png",
|
"Primeira Liga": "https://1000logos.net/wp-content/uploads/2022/01/Portuguese-Primeira-Liga-logo-500x281.png",
|
||||||
"Ligue 1": "https://i.gyazo.com/e5cd3f3960ea0fc7a10f831b6c79d31d.png",
|
"Serie A": " https://1000logos.net/wp-content/uploads/2019/01/Italian-Serie-A-Logo-500x281.png",
|
||||||
"Primeira Liga": "https://i.gyazo.com/0b9ff26408609ccb90bf45d60aa13500.png",
|
"UEFA Champions League": "https://1000logos.net/wp-content/uploads/2022/01/UEFA-Champions-League-logo-500x281.png",
|
||||||
"MLS": "https://i.gyazo.com/014b639a369d2bd8a4b97d00a239f330.png",
|
"WNBA": "https://1000logos.net/wp-content/uploads/2018/09/logo-wnba-500x287.png",
|
||||||
|
"default": "https://i.gyazo.com/978f2eb4a199ca5b56b447aded0cb9e3.png",
|
||||||
}
|
}
|
||||||
|
|
||||||
alias_map = {
|
alias_map = {
|
||||||
"NCAA": ["NCAAF", "NCAAB", "CBB", "CFB"],
|
"NCAA": ["CBB", "CFB", "NCAAB", "NCAAF"],
|
||||||
"Premier League": ["EPL"],
|
"Premier League": ["EPL"],
|
||||||
|
"UEFA Champions League": ["Champions League", "UCL"],
|
||||||
}
|
}
|
||||||
|
|
||||||
for base, aliases in alias_map.items():
|
for base, aliases in alias_map.items():
|
||||||
|
|
@ -100,7 +102,7 @@ def is_fresh(
|
||||||
nearest_hr: bool,
|
nearest_hr: bool,
|
||||||
exp: int,
|
exp: int,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
ts = entry.get("timestamp", 31496400)
|
ts: float | int = entry.get("timestamp", 31496400)
|
||||||
|
|
||||||
if nearest_hr:
|
if nearest_hr:
|
||||||
ts = near_hr(datetime.fromtimestamp(ts))
|
ts = near_hr(datetime.fromtimestamp(ts))
|
||||||
|
|
@ -122,7 +124,7 @@ def load_cache(
|
||||||
if per_entry:
|
if per_entry:
|
||||||
return {k: v for k, v in data.items() if is_fresh(v, nearest_hr, exp)}
|
return {k: v for k, v in data.items() if is_fresh(v, nearest_hr, exp)}
|
||||||
|
|
||||||
ts = data.get("timestamp", 31496400)
|
ts: float | int = data.get("timestamp", 31496400)
|
||||||
|
|
||||||
if nearest_hr:
|
if nearest_hr:
|
||||||
ts = near_hr(datetime.fromtimestamp(ts))
|
ts = near_hr(datetime.fromtimestamp(ts))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue