This commit is contained in:
doms9 2025-08-31 08:29:01 -04:00
parent a917d4548d
commit 00000d9fce
3 changed files with 16 additions and 18 deletions

View file

@ -1,7 +1,5 @@
import logging
reset = "\033[0m"
log_format = "[%(asctime)s] %(levelname)-8s %(message)-70s %(filename)s:%(lineno)d"
colors = {
@ -10,13 +8,15 @@ colors = {
"WARNING": "\033[33m",
"ERROR": "\033[31m",
"CRITICAL": "\033[41m",
"reset": "\033[0m",
}
class ColorFormatter(logging.Formatter):
def format(self, record) -> str:
color = colors.get(record.levelname, "")
record.levelname = f"{color}{record.levelname}{reset}"
record.levelname = f"{color}{record.levelname}{colors['reset']}"
return super().format(record)

View file

@ -75,15 +75,13 @@ async def main(client: httpx.AsyncClient) -> None:
if tvg_name:
tvg_name = "(".join(tvg_name.split("(")[:-1]).strip()
logo = logos.get(
sport,
"https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png",
)
if url.endswith("/hd"):
urls[f"[{sport}] {tvg_name}"] = {
"logo": logo,
"url": f"http://origin.thetvapp.to/hls/{url.split('/')[-2]}/mono.m3u8",
"logo": logos.get(
sport,
"https://i.gyazo.com/ec27417a9644ae517196494afa72d2b9.png",
),
}
if urls: