mirror of
https://github.com/doms9/iptv.git
synced 2026-04-21 19:46:59 +02:00
Compare commits
34 commits
7ea946f1af
...
717deaec2c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
717deaec2c | ||
|
|
dabd6d8e5a | ||
|
|
6bd22d0963 | ||
|
|
3c0311a804 | ||
|
|
17a274afa2 | ||
|
|
832d6c7248 | ||
|
|
939c957a55 | ||
|
|
c3e894d42c | ||
|
|
6eebe4c375 | ||
|
|
4599f8a037 | ||
|
|
f2f0cff82f | ||
|
|
e3ac7b1079 | ||
|
|
8d46e342ed | ||
|
|
3a80247099 | ||
|
|
872c9d9b2f | ||
|
|
77875e0a77 | ||
|
|
42b46cc0b4 | ||
|
|
e25954144f | ||
|
|
7bc16648d4 | ||
|
|
f06884c726 | ||
|
|
e837a3a9fa | ||
|
|
b48e15c7fd | ||
|
|
ab5f4ffa04 | ||
|
|
abc5606d98 | ||
|
|
43f70bb0be | ||
|
|
30f3e660f9 | ||
|
|
df8c6127bb | ||
|
|
c8af8b73f9 | ||
|
|
551792b7a0 | ||
|
|
8479455cc8 | ||
|
|
6a49aa3bff | ||
|
|
e8f6f70ad3 | ||
|
|
0b29b778d9 | ||
|
|
97b643254d |
10 changed files with 119137 additions and 129715 deletions
1066
M3U8/TV.m3u8
1066
M3U8/TV.m3u8
File diff suppressed because it is too large
Load diff
246369
M3U8/TV.xml
246369
M3U8/TV.xml
File diff suppressed because one or more lines are too long
1066
M3U8/events.m3u8
1066
M3U8/events.m3u8
File diff suppressed because it is too large
Load diff
|
|
@ -10,7 +10,6 @@ from scrapers import (
|
||||||
fawa,
|
fawa,
|
||||||
istreameast,
|
istreameast,
|
||||||
livetvsx,
|
livetvsx,
|
||||||
ovogoal,
|
|
||||||
pawa,
|
pawa,
|
||||||
ppv,
|
ppv,
|
||||||
roxie,
|
roxie,
|
||||||
|
|
@ -19,8 +18,7 @@ from scrapers import (
|
||||||
streamhub,
|
streamhub,
|
||||||
streamsgate,
|
streamsgate,
|
||||||
timstreams,
|
timstreams,
|
||||||
totalsportek1,
|
totalsportek,
|
||||||
totalsportek3,
|
|
||||||
tvapp,
|
tvapp,
|
||||||
watchfooty,
|
watchfooty,
|
||||||
webcast,
|
webcast,
|
||||||
|
|
@ -66,18 +64,16 @@ async def main() -> None:
|
||||||
asyncio.create_task(roxie.scrape(hdl_brwsr)),
|
asyncio.create_task(roxie.scrape(hdl_brwsr)),
|
||||||
asyncio.create_task(streamcenter.scrape(hdl_brwsr)),
|
asyncio.create_task(streamcenter.scrape(hdl_brwsr)),
|
||||||
# asyncio.create_task(streamhub.scrape(xtrnl_brwsr)),
|
# asyncio.create_task(streamhub.scrape(xtrnl_brwsr)),
|
||||||
# asyncio.create_task(streamsgate.scrape(xtrnl_brwsr)),
|
asyncio.create_task(streamsgate.scrape(xtrnl_brwsr)),
|
||||||
asyncio.create_task(timstreams.scrape(xtrnl_brwsr)),
|
asyncio.create_task(timstreams.scrape(xtrnl_brwsr)),
|
||||||
]
|
]
|
||||||
|
|
||||||
httpx_tasks = [
|
httpx_tasks = [
|
||||||
asyncio.create_task(fawa.scrape()),
|
asyncio.create_task(fawa.scrape()),
|
||||||
asyncio.create_task(istreameast.scrape()),
|
asyncio.create_task(istreameast.scrape()),
|
||||||
# asyncio.create_task(ovogoal.scrape()),
|
|
||||||
asyncio.create_task(pawa.scrape()),
|
asyncio.create_task(pawa.scrape()),
|
||||||
asyncio.create_task(shark.scrape()),
|
asyncio.create_task(shark.scrape()),
|
||||||
# asyncio.create_task(totalsportek1.scrape()),
|
asyncio.create_task(totalsportek.scrape()),
|
||||||
asyncio.create_task(totalsportek3.scrape()),
|
|
||||||
asyncio.create_task(tvapp.scrape()),
|
asyncio.create_task(tvapp.scrape()),
|
||||||
asyncio.create_task(webcast.scrape()),
|
asyncio.create_task(webcast.scrape()),
|
||||||
]
|
]
|
||||||
|
|
@ -101,7 +97,6 @@ async def main() -> None:
|
||||||
| fawa.urls
|
| fawa.urls
|
||||||
| istreameast.urls
|
| istreameast.urls
|
||||||
| livetvsx.urls
|
| livetvsx.urls
|
||||||
| ovogoal.urls
|
|
||||||
| pawa.urls
|
| pawa.urls
|
||||||
| ppv.urls
|
| ppv.urls
|
||||||
| roxie.urls
|
| roxie.urls
|
||||||
|
|
@ -110,8 +105,7 @@ async def main() -> None:
|
||||||
| streamhub.urls
|
| streamhub.urls
|
||||||
| streamsgate.urls
|
| streamsgate.urls
|
||||||
| timstreams.urls
|
| timstreams.urls
|
||||||
| totalsportek1.urls
|
| totalsportek.urls
|
||||||
| totalsportek3.urls
|
|
||||||
| tvapp.urls
|
| tvapp.urls
|
||||||
| watchfooty.urls
|
| watchfooty.urls
|
||||||
| webcast.urls
|
| webcast.urls
|
||||||
|
|
|
||||||
|
|
@ -1,145 +0,0 @@
|
||||||
import re
|
|
||||||
from functools import partial
|
|
||||||
|
|
||||||
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 = "OVOGOAL"
|
|
||||||
|
|
||||||
CACHE_FILE = Cache(TAG, exp=28_800)
|
|
||||||
|
|
||||||
BASE_URL = "https://ovogoal.plus"
|
|
||||||
|
|
||||||
|
|
||||||
async def process_event(url: str, url_num: int) -> tuple[str | None, str | None]:
|
|
||||||
nones = None, None
|
|
||||||
|
|
||||||
if not (html_data := await network.request(url, log=log)):
|
|
||||||
log.warning(f"URL {url_num}) Failed to load url.")
|
|
||||||
return nones
|
|
||||||
|
|
||||||
soup = HTMLParser(html_data.content)
|
|
||||||
|
|
||||||
iframe = soup.css_first("iframe")
|
|
||||||
|
|
||||||
if not iframe or not (iframe_src := iframe.attributes.get("src")):
|
|
||||||
log.warning(f"URL {url_num}) No iframe element found.")
|
|
||||||
return nones
|
|
||||||
|
|
||||||
if not (iframe_src_data := await network.request(iframe_src, log=log)):
|
|
||||||
log.warning(f"URL {url_num}) Failed to load iframe source.")
|
|
||||||
return nones
|
|
||||||
|
|
||||||
valid_m3u8 = re.compile(r'(var|const)\s+(\w+)\s*=\s*"([^"]*)"', re.I)
|
|
||||||
|
|
||||||
if not (match := valid_m3u8.search(iframe_src_data.text)):
|
|
||||||
log.warning(f"URL {url_num}) No Clappr source found.")
|
|
||||||
return nones
|
|
||||||
|
|
||||||
log.info(f"URL {url_num}) Captured M3U8")
|
|
||||||
|
|
||||||
return match[3], iframe_src
|
|
||||||
|
|
||||||
|
|
||||||
async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
|
|
||||||
events = []
|
|
||||||
|
|
||||||
if not (html_data := await network.request(BASE_URL, log=log)):
|
|
||||||
return events
|
|
||||||
|
|
||||||
soup = HTMLParser(html_data.content)
|
|
||||||
|
|
||||||
sport = "Live Event"
|
|
||||||
|
|
||||||
for card in soup.css(".main-content .stream-row"):
|
|
||||||
if (not (watch_btn_elem := card.css_first(".watch-btn"))) or (
|
|
||||||
not (onclick := watch_btn_elem.attributes.get("onclick"))
|
|
||||||
):
|
|
||||||
continue
|
|
||||||
|
|
||||||
if not (event_name_elem := card.css_first(".stream-info")):
|
|
||||||
continue
|
|
||||||
|
|
||||||
href = onclick.split(".href=")[-1].replace("'", "")
|
|
||||||
|
|
||||||
event_name = event_name_elem.text(strip=True)
|
|
||||||
|
|
||||||
if f"[{sport}] {event_name} ({TAG})" in cached_keys:
|
|
||||||
continue
|
|
||||||
|
|
||||||
events.append(
|
|
||||||
{
|
|
||||||
"sport": sport,
|
|
||||||
"event": event_name,
|
|
||||||
"link": href,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
return events
|
|
||||||
|
|
||||||
|
|
||||||
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}"')
|
|
||||||
|
|
||||||
if events := await get_events(cached_urls.keys()):
|
|
||||||
log.info(f"Processing {len(events)} new URL(s)")
|
|
||||||
|
|
||||||
now = Time.clean(Time.now())
|
|
||||||
|
|
||||||
for i, ev in enumerate(events, start=1):
|
|
||||||
handler = partial(
|
|
||||||
process_event,
|
|
||||||
url=(link := ev["link"]),
|
|
||||||
url_num=i,
|
|
||||||
)
|
|
||||||
|
|
||||||
url, iframe = await network.safe_process(
|
|
||||||
handler,
|
|
||||||
url_num=i,
|
|
||||||
semaphore=network.HTTP_S,
|
|
||||||
log=log,
|
|
||||||
)
|
|
||||||
|
|
||||||
sport, event = ev["sport"], ev["event"]
|
|
||||||
|
|
||||||
key = f"[{sport}] {event} ({TAG})"
|
|
||||||
|
|
||||||
tvg_id, logo = leagues.get_tvg_info(sport, event)
|
|
||||||
|
|
||||||
entry = {
|
|
||||||
"url": url,
|
|
||||||
"logo": logo,
|
|
||||||
"base": iframe,
|
|
||||||
"timestamp": now.timestamp(),
|
|
||||||
"id": tvg_id or "Live.Event.us",
|
|
||||||
"link": link,
|
|
||||||
}
|
|
||||||
|
|
||||||
cached_urls[key] = entry
|
|
||||||
|
|
||||||
if url:
|
|
||||||
valid_count += 1
|
|
||||||
|
|
||||||
urls[key] = entry
|
|
||||||
|
|
||||||
log.info(f"Collected and cached {valid_count - cached_count} new event(s)")
|
|
||||||
|
|
||||||
else:
|
|
||||||
log.info("No new events found")
|
|
||||||
|
|
||||||
CACHE_FILE.write(cached_urls)
|
|
||||||
|
|
@ -77,7 +77,7 @@ async def get_events(url: str, cached_keys: list[str]) -> list[dict[str, str]]:
|
||||||
{
|
{
|
||||||
"sport": sport,
|
"sport": sport,
|
||||||
"event": name,
|
"event": name,
|
||||||
"link": iframe,
|
"link": f"{iframe}#player=clappr#autoplay=true",
|
||||||
"logo": logo,
|
"logo": logo,
|
||||||
"timestamp": event_dt.timestamp(),
|
"timestamp": event_dt.timestamp(),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ log = get_logger(__name__)
|
||||||
|
|
||||||
urls: dict[str, dict[str, str | float]] = {}
|
urls: dict[str, dict[str, str | float]] = {}
|
||||||
|
|
||||||
TAG = "TOTALSPRTK3"
|
TAG = "TOTALSPRTK"
|
||||||
|
|
||||||
CACHE_FILE = Cache(TAG, exp=28_800)
|
CACHE_FILE = Cache(TAG, exp=28_800)
|
||||||
|
|
||||||
|
|
@ -1,170 +0,0 @@
|
||||||
import re
|
|
||||||
from functools import partial
|
|
||||||
from urllib.parse import urljoin, urlparse
|
|
||||||
|
|
||||||
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 = "TOTALSPRTK1"
|
|
||||||
|
|
||||||
CACHE_FILE = Cache(TAG, exp=28_800)
|
|
||||||
|
|
||||||
BASE_URL = "https://live.totalsportek.foo"
|
|
||||||
|
|
||||||
|
|
||||||
def fix_txt(s: str) -> str:
|
|
||||||
s = " ".join(s.split())
|
|
||||||
|
|
||||||
return s.upper() if s.islower() else s
|
|
||||||
|
|
||||||
|
|
||||||
async def process_event(url: str, url_num: int) -> str | None:
|
|
||||||
if not (event_data := await network.request(url, log=log)):
|
|
||||||
log.warning(f"URL {url_num}) Failed to load url.")
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
soup_1 = HTMLParser(event_data.content)
|
|
||||||
|
|
||||||
if not (iframe := soup_1.css_first("iframe")):
|
|
||||||
log.warning(f"URL {url_num}) No iframe element found.")
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
if not (iframe_url := iframe.attributes.get("src")):
|
|
||||||
log.warning(f"URL {url_num}) No iframe source found.")
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
if not (iframe_src := await network.request(iframe_url, log=log)):
|
|
||||||
log.warning(f"URL {url_num}) Failed to load iframe source.")
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
valid_m3u8 = re.compile(r'const\s+hexEncoded\s+=\s+"([^"]*)"', re.I)
|
|
||||||
|
|
||||||
if not (match := valid_m3u8.search(iframe_src.text)):
|
|
||||||
log.warning(f"URL {url_num}) No Clappr source found.")
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
log.info(f"URL {url_num}) Captured M3U8")
|
|
||||||
|
|
||||||
return bytes.fromhex(match[1]).decode("utf-8")
|
|
||||||
|
|
||||||
|
|
||||||
async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
|
|
||||||
events = []
|
|
||||||
|
|
||||||
if not (html_data := await network.request(BASE_URL, log=log)):
|
|
||||||
return events
|
|
||||||
|
|
||||||
soup = HTMLParser(html_data.content)
|
|
||||||
|
|
||||||
sport = "Live Event"
|
|
||||||
|
|
||||||
for node in soup.css("a"):
|
|
||||||
if not node.attributes.get("class"):
|
|
||||||
continue
|
|
||||||
|
|
||||||
if (parent := node.parent) and "my-1" in parent.attributes.get("class", ""):
|
|
||||||
if span := node.css_first("span"):
|
|
||||||
sport = span.text(strip=True)
|
|
||||||
|
|
||||||
sport = fix_txt(sport)
|
|
||||||
|
|
||||||
if not (teams := [t.text(strip=True) for t in node.css(".col-7 .col-12")]):
|
|
||||||
continue
|
|
||||||
|
|
||||||
if not (href := node.attributes.get("href")):
|
|
||||||
continue
|
|
||||||
|
|
||||||
href = urlparse(href).path if href.startswith("http") else href
|
|
||||||
|
|
||||||
if not (time_node := node.css_first(".col-3 span")):
|
|
||||||
continue
|
|
||||||
|
|
||||||
if time_node.text(strip=True).lower() != "matchstarted":
|
|
||||||
continue
|
|
||||||
|
|
||||||
event_name = fix_txt(" vs ".join(teams))
|
|
||||||
|
|
||||||
if f"[{sport}] {event_name} ({TAG})" in cached_keys:
|
|
||||||
continue
|
|
||||||
|
|
||||||
events.append(
|
|
||||||
{
|
|
||||||
"sport": sport,
|
|
||||||
"event": event_name,
|
|
||||||
"link": urljoin(BASE_URL, href),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
return events
|
|
||||||
|
|
||||||
|
|
||||||
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}"')
|
|
||||||
|
|
||||||
if events := await get_events(cached_urls.keys()):
|
|
||||||
log.info(f"Processing {len(events)} new URL(s)")
|
|
||||||
|
|
||||||
now = Time.clean(Time.now())
|
|
||||||
|
|
||||||
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 = ev["sport"], ev["event"]
|
|
||||||
|
|
||||||
key = f"[{sport}] {event} ({TAG})"
|
|
||||||
|
|
||||||
tvg_id, logo = leagues.get_tvg_info(sport, event)
|
|
||||||
|
|
||||||
entry = {
|
|
||||||
"url": url,
|
|
||||||
"logo": logo,
|
|
||||||
"base": link,
|
|
||||||
"timestamp": now.timestamp(),
|
|
||||||
"id": tvg_id or "Live.Event.us",
|
|
||||||
"link": link,
|
|
||||||
}
|
|
||||||
|
|
||||||
cached_urls[key] = entry
|
|
||||||
|
|
||||||
if url:
|
|
||||||
valid_count += 1
|
|
||||||
|
|
||||||
urls[key] = entry
|
|
||||||
|
|
||||||
log.info(f"Collected and cached {valid_count - cached_count} new event(s)")
|
|
||||||
|
|
||||||
else:
|
|
||||||
log.info("No new events found")
|
|
||||||
|
|
||||||
CACHE_FILE.write(cached_urls)
|
|
||||||
|
|
@ -104,7 +104,7 @@ async def pre_process(url: str, url_num: int) -> str | None:
|
||||||
link_data["wld"]["sn"],
|
link_data["wld"]["sn"],
|
||||||
)
|
)
|
||||||
|
|
||||||
return f"https://sportsembed.su/embed/{'/'.join(embed_path)}"
|
return f"https://sportsembed.su/embed/{'/'.join(embed_path)}?player=clappr&autoplay=true"
|
||||||
|
|
||||||
|
|
||||||
async def process_event(
|
async def process_event(
|
||||||
|
|
|
||||||
16
readme.md
16
readme.md
|
|
@ -1,19 +1,15 @@
|
||||||
## Base Log @ 2026-03-28 09:03 UTC
|
## Base Log @ 2026-03-29 09:03 UTC
|
||||||
|
|
||||||
### ✅ Working Streams: 152<br>❌ Dead Streams: 10
|
### ✅ Working Streams: 156<br>❌ Dead Streams: 6
|
||||||
|
|
||||||
| Channel | Error (Code) | Link |
|
| Channel | Error (Code) | Link |
|
||||||
| ------- | ------------ | ---- |
|
| ------- | ------------ | ---- |
|
||||||
| AMC | HTTP Error (404) | `http://41.205.93.154/AMC/index.m3u8` |
|
|
||||||
| Altitude Sports | HTTP Error (403) | `http://mytvstream.net:8080/live/30550113/30550113/79545.m3u8` |
|
| Altitude Sports | HTTP Error (403) | `http://mytvstream.net:8080/live/30550113/30550113/79545.m3u8` |
|
||||||
| Bravo TV | HTTP Error (404) | `http://41.205.93.154/BRAVO/index.m3u8` |
|
| Hallmark Family | HTTP Error (000) | `http://mytvstream.net:8080/live/30550113/30550113/9307.m3u8` |
|
||||||
| ESPN | HTTP Error (404) | `http://41.205.93.154/ESPN/index.m3u8` |
|
|
||||||
| HBO Family | HTTP Error (000) | `http://mytvstream.net:8080/live/30550113/30550113/17772.m3u8` |
|
|
||||||
| Hallmark Family | HTTP Error (403) | `http://mytvstream.net:8080/live/30550113/30550113/9307.m3u8` |
|
|
||||||
| Lifetime | HTTP Error (404) | `http://41.205.93.154/LIFETIME/index.m3u8` |
|
|
||||||
| NBC Sports California | HTTP Error (403) | `http://mytvstream.net:8080/live/30550113/30550113/20940.m3u8` |
|
|
||||||
| NHL Network | HTTP Error (000) | `http://mytvstream.net:8080/live/30550113/30550113/20179.m3u8` |
|
| NHL Network | HTTP Error (000) | `http://mytvstream.net:8080/live/30550113/30550113/20179.m3u8` |
|
||||||
| Spectrum SportsNet LA Dodgers | HTTP Error (403) | `http://mytvstream.net:8080/live/30550113/30550113/31636.m3u8` |
|
| Pop TV | HTTP Error (403) | `http://mytvstream.net:8080/live/30550113/30550113/20976.m3u8` |
|
||||||
|
| Showtime Extreme | HTTP Error (403) | `http://mytvstream.net:8080/live/30550113/30550113/13220.m3u8` |
|
||||||
|
| SportsNet New York | HTTP Error (404) | `http://212.102.60.231/SNY/index.m3u8` |
|
||||||
---
|
---
|
||||||
#### Base Channels URL
|
#### Base Channels URL
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue