Compare commits

..

No commits in common. "bb156f5f84947b20da88291ee6beef18f2022b19" and "ee91e5daaac692125aff55e12ddd1059ca5466e9" have entirely different histories.

7 changed files with 116591 additions and 114633 deletions

File diff suppressed because it is too large Load diff

228103
M3U8/TV.xml

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -67,6 +67,7 @@ async def main() -> None:
# asyncio.create_task(fsports.scrape(xtrnl_brwsr)), # asyncio.create_task(fsports.scrape(xtrnl_brwsr)),
asyncio.create_task(ppv.scrape(xtrnl_brwsr)), asyncio.create_task(ppv.scrape(xtrnl_brwsr)),
asyncio.create_task(roxie.scrape(hdl_brwsr)), asyncio.create_task(roxie.scrape(hdl_brwsr)),
asyncio.create_task(webcast.scrape(hdl_brwsr)),
] ]
httpx_tasks = [ httpx_tasks = [
@ -83,13 +84,12 @@ async def main() -> None:
asyncio.create_task(streamtpnew.scrape()), asyncio.create_task(streamtpnew.scrape()),
asyncio.create_task(totalsportek.scrape()), asyncio.create_task(totalsportek.scrape()),
asyncio.create_task(tvapp.scrape()), asyncio.create_task(tvapp.scrape()),
asyncio.create_task(webcast.scrape()),
] ]
await asyncio.gather(*(pw_tasks + httpx_tasks)) await asyncio.gather(*(pw_tasks + httpx_tasks))
# others # others
await livetvsx.scrape(xtrnl_brwsr) # await livetvsx.scrape(xtrnl_brwsr)
await watchfooty.scrape(xtrnl_brwsr) await watchfooty.scrape(xtrnl_brwsr)
finally: finally:

View file

@ -13,7 +13,7 @@ urls: dict[str, dict[str, str | float]] = {}
TAG = "ROXIE" TAG = "ROXIE"
CACHE_FILE = Cache(TAG, exp=28_800) CACHE_FILE = Cache(TAG, exp=19_800)
BASE_URL = "https://roxiestreams.su" BASE_URL = "https://roxiestreams.su"
@ -26,7 +26,7 @@ SPORT_URLS = {
for sport in [ for sport in [
"Fighting", "Fighting",
"MLB", "MLB",
"NBA", # "NBA",
"NHL", "NHL",
"Soccer", "Soccer",
] ]

View file

@ -1,9 +1,7 @@
import ast
import asyncio import asyncio
import re
from functools import partial from functools import partial
from urllib.parse import urljoin
from playwright.async_api import Browser
from selectolax.parser import HTMLParser from selectolax.parser import HTMLParser
from .utils import Cache, Time, get_logger, leagues, network from .utils import Cache, Time, get_logger, leagues, network
@ -14,7 +12,7 @@ urls: dict[str, dict[str, str | float]] = {}
TAG = "WEBCAST" TAG = "WEBCAST"
CACHE_FILE = Cache(TAG, exp=12_600) CACHE_FILE = Cache(TAG, exp=19_800)
BASE_URLS = { BASE_URLS = {
"MLB": "https://mlbwebcast.com", "MLB": "https://mlbwebcast.com",
@ -27,70 +25,6 @@ def fix_event(s: str) -> str:
return " vs ".join(s.split("@")) return " vs ".join(s.split("@"))
async def process_event(
url: str,
url_num: int,
sport: str,
) -> str | None:
if not (event_data := await network.request(url, log=log)):
log.warning(f"URL {url_num}) Failed to load url.")
return
soup = HTMLParser(event_data.content)
if not (iframe := soup.css_first('iframe[name="srcFrame"]')):
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.warning(f"URL {url_num}) Failed to load iframe source.")
return
pattern = re.compile(r'var\s+\w*=\[([^"]*)\];', re.I)
if not (match := pattern.search(iframe_src_data.text)):
log.warning(f"URL {url_num}) No Clappr source found.")
return
try:
ev_id, ev_ts, ev_pt = ast.literal_eval(match[1])
except ValueError:
log.warning(f"URL {url_num}) Failed to parse event info.")
return
params: dict[str, int | str] = dict(zip(["id", "ts", "pt"], [ev_id, ev_ts, ev_pt]))
if not (
api_data := await network.request(
urljoin(BASE_URLS[sport], "stream/check_stream.php"),
headers={"Referer": iframe_src},
params=params,
log=log,
)
):
log.warning(f"URL {url_num}) Failed to make php request.")
return
elif (data := api_data.json()).get("error"):
log.warning(f"URL {url_num}) Failed to make php request.")
return
log.info(f"URL {url_num}) Captured M3U8")
return data.get("url")
async def get_events(cached_keys: list[str]) -> list[dict[str, str]]: async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
tasks = [network.request(url, log=log) for url in BASE_URLS.values()] tasks = [network.request(url, log=log) for url in BASE_URLS.values()]
@ -136,7 +70,7 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
return events return events
async def scrape() -> None: async def scrape(browser: Browser) -> None:
cached_urls = CACHE_FILE.load() cached_urls = CACHE_FILE.load()
valid_urls = {k: v for k, v in cached_urls.items() if v["url"]} valid_urls = {k: v for k, v in cached_urls.items() if v["url"]}
@ -154,12 +88,15 @@ async def scrape() -> None:
now = Time.clean(Time.now()) now = Time.clean(Time.now())
async with network.event_context(browser) as context:
for i, ev in enumerate(events, start=1): for i, ev in enumerate(events, start=1):
async with network.event_page(context) as page:
handler = partial( handler = partial(
process_event, network.process_event,
url=(link := ev["link"]), url=(link := ev["link"]),
url_num=i, url_num=i,
sport=(sport := ev["sport"]), page=page,
log=log,
) )
url = await network.safe_process( url = await network.safe_process(
@ -169,7 +106,7 @@ async def scrape() -> None:
log=log, log=log,
) )
event = ev["event"] sport, event = ev["sport"], ev["event"]
key = f"[{sport}] {event} ({TAG})" key = f"[{sport}] {event} ({TAG})"

View file

@ -1,21 +1,17 @@
## Base Log @ 2026-04-15 15:46 UTC ## Base Log @ 2026-04-14 15:48 UTC
### ✅ Working Streams: 149<br>❌ Dead Streams: 12 ### ✅ Working Streams: 153<br>❌ Dead Streams: 8
| Channel | Error (Code) | Link | | Channel | Error (Code) | Link |
| ------- | ------------ | ---- | | ------- | ------------ | ---- |
| Aspire | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/150605.ts` | | Altitude Sports | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/79545.m3u8` |
| Comedy TV | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/199482.ts` | | Antenna TV | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/20180.m3u8` |
| Cozi TV | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/8392.ts` | | FDSN North | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/20928.m3u8` |
| FX Movie Channel | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/39873.ts` | | FX Movie Channel | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/39873.ts` |
| Game Show Network | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/466.ts` | | NBC Sports Bay Area | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/45785.ts` |
| HBO Family | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/760.ts` | | Space City Home Network | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/213668.m3u8` |
| Lifetime | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/4667.ts` | | Spectrum SportsNet LA Dodgers | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/31636.m3u8` |
| NBC Sports Boston | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/35132.ts` | | Spectrum SportsNet Lakers | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/21842.m3u8` |
| Nick Jr | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/14835.ts` |
| TV One | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/13010.ts` |
| The Weather Channel | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/2361.ts` |
| YES Network | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/5519.ts` |
--- ---
#### Base Channels URL #### Base Channels URL
``` ```