mirror of
https://github.com/doms9/iptv.git
synced 2026-01-21 03:59:03 +01:00
e
This commit is contained in:
parent
8b2d8cc1fc
commit
00000d939c
20 changed files with 119 additions and 12 deletions
|
|
@ -26,7 +26,9 @@ async def get_events() -> dict[str, dict[str, str | float]]:
|
|||
for i, line in enumerate(data, start=1):
|
||||
if line.startswith("#EXTINF"):
|
||||
tvg_id_match = re.search(r'tvg-id="([^"]*)"', line)
|
||||
|
||||
tvg_name_match = re.search(r'tvg-name="([^"]*)"', line)
|
||||
|
||||
group_title_match = re.search(r'group-title="([^"]*)"', line)
|
||||
|
||||
tvg = tvg_id_match[1] if tvg_id_match else None
|
||||
|
|
@ -57,7 +59,9 @@ async def get_events() -> dict[str, dict[str, str | float]]:
|
|||
async def scrape() -> None:
|
||||
if cached := CACHE_FILE.load():
|
||||
urls.update(cached)
|
||||
|
||||
log.info(f"Loaded {len(urls)} event(s) from cache")
|
||||
|
||||
return
|
||||
|
||||
log.info(f'Scraping from "{BASE_URL}"')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue