update M3U8
This commit is contained in:
parent
6eaf99470d
commit
424ca1c807
4 changed files with 1209 additions and 441 deletions
822
M3U8/TV.m3u8
822
M3U8/TV.m3u8
File diff suppressed because it is too large
Load diff
822
M3U8/events.m3u8
822
M3U8/events.m3u8
File diff suppressed because it is too large
Load diff
|
|
@ -1,4 +1,3 @@
|
|||
import random
|
||||
from functools import partial
|
||||
from urllib.parse import urljoin
|
||||
|
||||
|
|
@ -114,8 +113,6 @@ async def scrape(client: httpx.AsyncClient) -> None:
|
|||
|
||||
log.info(f"Loaded {cached_count} event(s) from cache")
|
||||
|
||||
random.shuffle(MIRRORS)
|
||||
|
||||
if not (base_url := await network.get_base(MIRRORS)):
|
||||
log.warning("No working Streameast mirrors")
|
||||
CACHE_FILE.write(cached_urls)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import asyncio
|
||||
import logging
|
||||
import random
|
||||
import re
|
||||
from collections.abc import Awaitable, Callable
|
||||
from functools import partial
|
||||
|
|
@ -40,6 +41,8 @@ class Network:
|
|||
return False
|
||||
|
||||
async def get_base(self, mirrors: list[str]) -> str | None:
|
||||
random.shuffle(mirrors)
|
||||
|
||||
tasks = [self.check_status(link) for link in mirrors]
|
||||
results = await asyncio.gather(*tasks, return_exceptions=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue