update M3U8

This commit is contained in:
GitHub Actions Bot 2026-03-21 14:31:42 -04:00
parent 355ecb5eba
commit c93bb01356
3 changed files with 1201 additions and 1537 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -18,15 +18,15 @@ API_CACHE = Cache(f"{TAG}-api", exp=28_800)
API_URL = "https://s2watch.me/api/v1/schedule/list" API_URL = "https://s2watch.me/api/v1/schedule/list"
EVENT_BASE = "https://gopst.link" BASE_URL = "https://gopst.link"
async def process_event(event_id: int, url_num: int) -> tuple[str | None, str | None]: async def process_event(event_id: int, url_num: int) -> tuple[str | None, str | None]:
nones = None, None nones = None, None
if not ( if not (
event_api_src := await network.request( base_api_src := await network.request(
urljoin(EVENT_BASE, "api/player.php"), urljoin(BASE_URL, "api/player.php"),
params={"id": event_id}, params={"id": event_id},
log=log, log=log,
) )
@ -34,7 +34,7 @@ async def process_event(event_id: int, url_num: int) -> tuple[str | None, str |
log.warning(f"URL {url_num}) Failed to get iframe url.") log.warning(f"URL {url_num}) Failed to get iframe url.")
return nones return nones
if not (embed_url := event_api_src.json().get("url")): if not (embed_url := base_api_src.json().get("url")):
log.warning(f"URL {url_num}) No iframe url available.") log.warning(f"URL {url_num}) No iframe url available.")
return nones return nones
@ -44,11 +44,11 @@ async def process_event(event_id: int, url_num: int) -> tuple[str | None, str |
log=log, log=log,
headers={ headers={
"User-Agent": "curl/8.19.0", "User-Agent": "curl/8.19.0",
"Referer": f"{event_api_src.url}", "Referer": f"{base_api_src.url}",
}, },
) )
): ):
log.warning(f"URL {url_num}) Failed to get load iframe url.") log.warning(f"URL {url_num}) Failed to load iframe url.")
return nones return nones
pattern = re.compile(r'var\s+src\s+=\s+"([^"]*)"', re.I) pattern = re.compile(r'var\s+src\s+=\s+"([^"]*)"', re.I)
@ -162,7 +162,7 @@ async def scrape() -> None:
"base": iframe, "base": iframe,
"timestamp": ts, "timestamp": ts,
"id": tvg_id or "Live.Event.us", "id": tvg_id or "Live.Event.us",
"link": urljoin(EVENT_BASE, f"ch?id={event_id}"), "link": urljoin(BASE_URL, f"ch?id={event_id}"),
"UA": "curl/8.19.0", "UA": "curl/8.19.0",
} }