Compare commits

..

No commits in common. "a045de118f5a0507b8795c4059ccd875bfb4eb8e" and "2e622d0cdc171ffcf86fbe203b15da52dfed284a" have entirely different histories.

9 changed files with 102793 additions and 108108 deletions

File diff suppressed because it is too large Load diff

207943
M3U8/TV.xml

File diff suppressed because one or more lines are too long

View file

@ -3,8 +3,8 @@
#EXTINF:-1 tvg-chno="1" tvg-id="A.and.E.HD.East.us2" tvg-name="A&E TV" tvg-logo="http://schedulesdirect-api20141201-logos.s3.dualstack.us-east-1.amazonaws.com/stationLogos/s51529_dark_360w_270h.png" group-title="TV",A&E TV
http://41.205.93.154/AandE/index.m3u8
#EXTINF:-1 tvg-chno="2" tvg-id="KMBC-DT.us_locals1" tvg-name="ABC" tvg-logo="http://schedulesdirect-api20141201-logos.s3.dualstack.us-east-1.amazonaws.com/stationLogos/s10003_dark_360w_270h.png" group-title="TV",ABC
http://stream.cammonitorplus.net/1790/index.m3u8?token=MnE3ZWg1YkgxdFdWZlo2c2hLMkltWnJhcFo1OHhxcXVyb2pKazZXaWxZRERxNEduaVp1UnBxU2VlWmF0ZnRlRGxaMm1zNStDbnJOOXFZMlhtcStybmc9PQ==
#EXTINF:-1 tvg-chno="2" tvg-id="WFAA-DT.us_locals1" tvg-name="ABC" tvg-logo="http://schedulesdirect-api20141201-logos.s3.dualstack.us-east-1.amazonaws.com/stationLogos/s10003_dark_360w_270h.png" group-title="TV",ABC
http://stream.cammonitorplus.net/1762/index.m3u8?token=MnE3ZWg1YkgxdFdWZlo2c2hLMkltWnJhcFo1OHhxcXVyb2pKazZXaWxZRERxNEduaVp1UnBxU2VlWmF0ZnRlRGxaMm1zNStDbnJOOXFZMlhtcStybmc9PQ==
#EXTINF:-1 tvg-chno="3" tvg-id="ACC.Network.us2" tvg-name="ACC Network" tvg-logo="https://schedulesdirect-api20141201-logos.s3.dualstack.us-east-1.amazonaws.com/stationLogos/s111871_dark_360w_270h.png" group-title="TV",ACC Network
http://23.239.31.26:8989/accnetwork/index.m3u8

File diff suppressed because it is too large Load diff

View file

@ -23,7 +23,6 @@ from scrapers import (
streamsgate,
totalsportek,
tvapp,
volokit,
watchfooty,
webcast,
xstreameast,
@ -84,7 +83,6 @@ async def main() -> None:
# asyncio.create_task(streambtw.scrape()),
asyncio.create_task(totalsportek.scrape()),
asyncio.create_task(tvapp.scrape()),
asyncio.create_task(volokit.scrape()),
asyncio.create_task(xstreameast.scrape()),
]
@ -120,7 +118,6 @@ async def main() -> None:
| streamsgate.urls
| totalsportek.urls
| tvapp.urls
| volokit.urls
| watchfooty.urls
| webcast.urls
| xstreameast.urls

View file

@ -91,7 +91,6 @@ class Time(datetime):
"%m/%d/%Y %I:%M %p",
"%m/%d/%Y %H:%M:%S",
"%a, %d %b %Y %H:%M:%S %z",
"%A, %b %d, %Y %H:%M",
]
for frmt in formats:

View file

@ -1,230 +0,0 @@
import asyncio
import re
from functools import partial
from urllib.parse import urljoin
from selectolax.parser import HTMLParser
from .utils import Cache, Time, get_logger, leagues, network
log = get_logger(__name__)
urls: dict[str, dict[str, str | float]] = {}
TAG = "VOLOKIT"
CACHE_FILE = Cache(TAG, exp=10_800)
HTML_CACHE = Cache(f"{TAG}-html", exp=28_800)
BASE_URL = "http://volokit.xyz"
SPORT_ENDPOINTS = {
"mlb": "MLB",
# "nfl": "NFL",
# "nhl": "NHL",
}
def fix_event(s: str) -> str:
return " ".join(x.capitalize() for x in s.split())
async def process_event(url: str, url_num: int) -> str | None:
if not (event_data := await network.request(url, log=log)):
log.info(f"URL {url_num}) Failed to load url.")
return
soup = HTMLParser(event_data.content)
if not (iframe := soup.css_first('iframe[height="100%"]')):
log.warning(f"URL {url_num}) No iframe element found.")
return
if not (iframe_src := iframe.attributes.get("src")):
log.warning(f"URL {url_num}) No iframe source found.")
return
if not (
iframe_src_data := await network.request(
iframe_src,
headers={"Referer": url},
log=log,
)
):
log.info(f"URL {url_num}) Failed to load iframe source.")
return
pattern = re.compile(r'source:\s+"([^"]*)"', re.I)
if not (match := pattern.search(iframe_src_data.text)):
log.warning(f"URL {url_num}) No Clappr source found.")
return
log.info(f"URL {url_num}) Captured M3U8")
return match[1]
async def refresh_html_cache(
url: str,
sport: str,
now: Time,
) -> dict[str, dict[str, str | float]]:
events = {}
if not (html_data := await network.request(url, log=log)):
return events
soup = HTMLParser(html_data.content)
date = now.date()
if date_node := soup.css_first("tr.date"):
date = date_node.text(strip=True)
for card in soup.css("#events .table .vevent.theevent"):
if not (href := card.css_first("a").attributes.get("href")):
continue
name_node = card.css_first(".teamtd.event")
time_node = card.css_first(".time")
if not (name_node and time_node):
continue
name, time = name_node.text(strip=True), time_node.text(strip=True)
event_sport = SPORT_ENDPOINTS[sport]
event_name = fix_event(name)
event_dt = Time.from_str(f"{date} {time}", timezone="UTC")
key = f"[{event_sport}] {event_name} ({TAG})"
events[key] = {
"sport": event_sport,
"event": event_name,
"link": href,
"event_ts": event_dt.timestamp(),
"timestamp": now.timestamp(),
}
return events
async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
now = Time.clean(Time.now())
if not (events := HTML_CACHE.load()):
log.info("Refreshing HTML cache")
sport_urls = {
sport: urljoin(BASE_URL, f"sport/{sport}") for sport in SPORT_ENDPOINTS
}
tasks = [
refresh_html_cache(
url,
sport,
now,
)
for sport, url in sport_urls.items()
]
results = await asyncio.gather(*tasks)
events = {k: v for data in results for k, v in data.items()}
HTML_CACHE.write(events)
live = []
start_ts = now.delta(minutes=-30).timestamp()
end_ts = now.delta(minutes=30).timestamp()
for k, v in events.items():
if k in cached_keys:
continue
if not start_ts <= v["event_ts"] <= end_ts:
continue
live.append(v)
return live
async def scrape() -> None:
cached_urls = CACHE_FILE.load()
valid_urls = {k: v for k, v in cached_urls.items() if v["url"]}
valid_count = cached_count = len(valid_urls)
urls.update(valid_urls)
log.info(f"Loaded {cached_count} event(s) from cache")
log.info(f'Scraping from "{BASE_URL}"')
events = await get_events(cached_urls.keys())
if events:
log.info(f"Processing {len(events)} new URL(s)")
for i, ev in enumerate(events, start=1):
handler = partial(
process_event,
url=(link := ev["link"]),
url_num=i,
)
url = await network.safe_process(
handler,
url_num=i,
semaphore=network.HTTP_S,
log=log,
)
sport, event, ts = (
ev["sport"],
ev["event"],
ev["event_ts"],
)
key = f"[{sport}] {event} ({TAG})"
tvg_id, logo = leagues.get_tvg_info(sport, event)
entry = {
"url": url,
"logo": logo,
"base": link,
"timestamp": ts,
"id": tvg_id or "Live.Event.us",
"link": link,
}
cached_urls[key] = entry
if url:
valid_count += 1
urls[key] = entry
if new_count := valid_count - cached_count:
log.info(f"Collected and cached {new_count} new event(s)")
else:
log.info("No new events found")
CACHE_FILE.write(cached_urls)

View file

@ -1,12 +1,12 @@
## Base Log @ 2026-02-25 04:34 UTC
## Base Log @ 2026-02-24 04:29 UTC
### ✅ Working Streams: 152<br>❌ Dead Streams: 4
| Channel | Error (Code) | Link |
| ------- | ------------ | ---- |
| Golf Channel | HTTP Error (000) | `http://hardcoremedia.xyz/live/rabdsbmz/3731346838/129706.ts` |
| HBO Comedy | HTTP Error (000) | `http://hardcoremedia.xyz/live/rabdsbmz/3731346838/257141.ts` |
| INSP | HTTP Error (404) | `http://fl12.moveonjoy.com/INSP/index.m3u8` |
| SportsNet New York | HTTP Error (404) | `http://212.102.60.231/SNY/index.m3u8` |
| TLC | HTTP Error (000) | `http://hardcoremedia.xyz/live/rabdsbmz/3731346838/129765.ts` |
---
#### Base Channels URL