This commit is contained in:
doms9 2025-10-30 20:37:47 -04:00
parent b3d3df3d5b
commit 00000d9ee7
2 changed files with 7 additions and 5 deletions

View file

@ -142,7 +142,7 @@ async def scrape(client: httpx.AsyncClient) -> None:
tvg_id, pic = leagues.get_tvg_info(sport, event)
entry = {
"url": url,
"url": url.replace("540p", "720p"),
"logo": logo or pic,
"base": "",
"timestamp": ts,

View file

@ -1,15 +1,17 @@
import asyncio
import logging
import re
from collections.abc import Callable
from collections.abc import Awaitable, Callable
from functools import partial
from typing import Any
from typing import TypeVar
import httpx
from playwright.async_api import Browser, BrowserContext, Playwright, Request
from .logger import get_logger
T = TypeVar("T")
class Network:
UA = (
@ -49,11 +51,11 @@ class Network:
@staticmethod
async def safe_process(
fn: Callable,
fn: Callable[[], Awaitable[T]],
url_num: int,
timeout: int | float = 15,
log: logging.Logger | None = None,
) -> Any | None:
) -> T | None:
if not log:
log = logging.getLogger(__name__)