mirror of
https://github.com/doms9/iptv.git
synced 2026-04-21 19:46:59 +02:00
Compare commits
36 commits
ee91e5daaa
...
bb156f5f84
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb156f5f84 | ||
|
|
5f19ac92fd | ||
|
|
64709869d8 | ||
|
|
87995197c9 | ||
|
|
c1bf17a1af | ||
|
|
371667c264 | ||
|
|
1cc81fa711 | ||
|
|
5fd37d1d50 | ||
|
|
3497fb1f15 | ||
|
|
0312da3363 | ||
|
|
c5362f787b | ||
|
|
dfdbdee05f | ||
|
|
7043b8f059 | ||
|
|
b6e5a4a592 | ||
|
|
9b5a820012 | ||
|
|
00000d92e4 | ||
|
|
00000d991c | ||
|
|
fba6702925 | ||
|
|
963baf2546 | ||
|
|
9b20d30153 | ||
|
|
48f4eb46b5 | ||
|
|
9f0b67fc44 | ||
|
|
870f893308 | ||
|
|
e162047495 | ||
|
|
73b3e141bf | ||
|
|
42cca5c278 | ||
|
|
7b67647994 | ||
|
|
42a22188fb | ||
|
|
fe362d53f7 | ||
|
|
39b6f8764e | ||
|
|
a0bbcc855d | ||
|
|
3d1e85151c | ||
|
|
110d7dc60c | ||
|
|
440d7712c7 | ||
|
|
31dbc1f988 | ||
|
|
ca76d89fcc |
7 changed files with 114568 additions and 116526 deletions
1518
M3U8/TV.m3u8
1518
M3U8/TV.m3u8
File diff suppressed because it is too large
Load diff
227897
M3U8/TV.xml
227897
M3U8/TV.xml
File diff suppressed because one or more lines are too long
1518
M3U8/events.m3u8
1518
M3U8/events.m3u8
File diff suppressed because it is too large
Load diff
|
|
@ -67,7 +67,6 @@ 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 = [
|
||||||
|
|
@ -84,12 +83,13 @@ 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:
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ urls: dict[str, dict[str, str | float]] = {}
|
||||||
|
|
||||||
TAG = "ROXIE"
|
TAG = "ROXIE"
|
||||||
|
|
||||||
CACHE_FILE = Cache(TAG, exp=19_800)
|
CACHE_FILE = Cache(TAG, exp=28_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",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
|
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
|
||||||
|
|
@ -12,7 +14,7 @@ urls: dict[str, dict[str, str | float]] = {}
|
||||||
|
|
||||||
TAG = "WEBCAST"
|
TAG = "WEBCAST"
|
||||||
|
|
||||||
CACHE_FILE = Cache(TAG, exp=19_800)
|
CACHE_FILE = Cache(TAG, exp=12_600)
|
||||||
|
|
||||||
BASE_URLS = {
|
BASE_URLS = {
|
||||||
"MLB": "https://mlbwebcast.com",
|
"MLB": "https://mlbwebcast.com",
|
||||||
|
|
@ -25,6 +27,70 @@ 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()]
|
||||||
|
|
||||||
|
|
@ -70,7 +136,7 @@ async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
|
||||||
return events
|
return events
|
||||||
|
|
||||||
|
|
||||||
async def scrape(browser: Browser) -> None:
|
async def scrape() -> 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"]}
|
||||||
|
|
@ -88,45 +154,42 @@ async def scrape(browser: Browser) -> 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):
|
handler = partial(
|
||||||
async with network.event_page(context) as page:
|
process_event,
|
||||||
handler = partial(
|
url=(link := ev["link"]),
|
||||||
network.process_event,
|
url_num=i,
|
||||||
url=(link := ev["link"]),
|
sport=(sport := ev["sport"]),
|
||||||
url_num=i,
|
)
|
||||||
page=page,
|
|
||||||
log=log,
|
|
||||||
)
|
|
||||||
|
|
||||||
url = await network.safe_process(
|
url = await network.safe_process(
|
||||||
handler,
|
handler,
|
||||||
url_num=i,
|
url_num=i,
|
||||||
semaphore=network.PW_S,
|
semaphore=network.PW_S,
|
||||||
log=log,
|
log=log,
|
||||||
)
|
)
|
||||||
|
|
||||||
sport, event = ev["sport"], ev["event"]
|
event = ev["event"]
|
||||||
|
|
||||||
key = f"[{sport}] {event} ({TAG})"
|
key = f"[{sport}] {event} ({TAG})"
|
||||||
|
|
||||||
tvg_id, logo = leagues.get_tvg_info(sport, event)
|
tvg_id, logo = leagues.get_tvg_info(sport, event)
|
||||||
|
|
||||||
entry = {
|
entry = {
|
||||||
"url": url,
|
"url": url,
|
||||||
"logo": logo,
|
"logo": logo,
|
||||||
"base": BASE_URLS[sport],
|
"base": BASE_URLS[sport],
|
||||||
"timestamp": now.timestamp(),
|
"timestamp": now.timestamp(),
|
||||||
"id": tvg_id or "Live.Event.us",
|
"id": tvg_id or "Live.Event.us",
|
||||||
"link": link,
|
"link": link,
|
||||||
}
|
}
|
||||||
|
|
||||||
cached_urls[key] = entry
|
cached_urls[key] = entry
|
||||||
|
|
||||||
if url:
|
if url:
|
||||||
valid_count += 1
|
valid_count += 1
|
||||||
|
|
||||||
urls[key] = entry
|
urls[key] = entry
|
||||||
|
|
||||||
log.info(f"Collected and cached {valid_count - cached_count} new event(s)")
|
log.info(f"Collected and cached {valid_count - cached_count} new event(s)")
|
||||||
|
|
||||||
|
|
|
||||||
22
readme.md
22
readme.md
|
|
@ -1,17 +1,21 @@
|
||||||
## Base Log @ 2026-04-14 15:48 UTC
|
## Base Log @ 2026-04-15 15:46 UTC
|
||||||
|
|
||||||
### ✅ Working Streams: 153<br>❌ Dead Streams: 8
|
### ✅ Working Streams: 149<br>❌ Dead Streams: 12
|
||||||
|
|
||||||
| Channel | Error (Code) | Link |
|
| Channel | Error (Code) | Link |
|
||||||
| ------- | ------------ | ---- |
|
| ------- | ------------ | ---- |
|
||||||
| Altitude Sports | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/79545.m3u8` |
|
| Aspire | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/150605.ts` |
|
||||||
| Antenna TV | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/20180.m3u8` |
|
| Comedy TV | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/199482.ts` |
|
||||||
| FDSN North | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/20928.m3u8` |
|
| Cozi TV | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/8392.ts` |
|
||||||
| 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` |
|
||||||
| NBC Sports Bay Area | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/45785.ts` |
|
| Game Show Network | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/466.ts` |
|
||||||
| Space City Home Network | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/213668.m3u8` |
|
| HBO Family | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/760.ts` |
|
||||||
| Spectrum SportsNet LA Dodgers | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/31636.m3u8` |
|
| Lifetime | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/4667.ts` |
|
||||||
| Spectrum SportsNet Lakers | HTTP Error (403) | `http://mytvstream.net:8080/live/A0t5Ax/625375/21842.m3u8` |
|
| NBC Sports Boston | HTTP Error (404) | `http://iptvtree.net:8080/live/7e4b0dbd/1dd755dc3f/35132.ts` |
|
||||||
|
| 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
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue