mirror of
https://github.com/doms9/iptv.git
synced 2026-04-25 20:20:04 +02:00
Compare commits
No commits in common. "456586d9cd1a32cd1cc77f054d6fb569bc0a0230" and "717deaec2c0f6189673fdaf0f43f630682e8fba6" have entirely different histories.
456586d9cd
...
717deaec2c
7 changed files with 108485 additions and 122891 deletions
1042
M3U8/TV.m3u8
1042
M3U8/TV.m3u8
File diff suppressed because it is too large
Load diff
228953
M3U8/TV.xml
228953
M3U8/TV.xml
File diff suppressed because one or more lines are too long
1042
M3U8/events.m3u8
1042
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,
|
||||||
|
|
@ -18,6 +17,7 @@ from scrapers import (
|
||||||
streamcenter,
|
streamcenter,
|
||||||
streamhub,
|
streamhub,
|
||||||
streamsgate,
|
streamsgate,
|
||||||
|
timstreams,
|
||||||
totalsportek,
|
totalsportek,
|
||||||
tvapp,
|
tvapp,
|
||||||
watchfooty,
|
watchfooty,
|
||||||
|
|
@ -65,12 +65,12 @@ async def main() -> None:
|
||||||
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)),
|
||||||
]
|
]
|
||||||
|
|
||||||
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(totalsportek.scrape()),
|
asyncio.create_task(totalsportek.scrape()),
|
||||||
|
|
@ -97,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
|
||||||
|
|
@ -105,6 +104,7 @@ async def main() -> None:
|
||||||
| streamcenter.urls
|
| streamcenter.urls
|
||||||
| streamhub.urls
|
| streamhub.urls
|
||||||
| streamsgate.urls
|
| streamsgate.urls
|
||||||
|
| timstreams.urls
|
||||||
| totalsportek.urls
|
| totalsportek.urls
|
||||||
| tvapp.urls
|
| tvapp.urls
|
||||||
| watchfooty.urls
|
| watchfooty.urls
|
||||||
|
|
|
||||||
|
|
@ -1,152 +0,0 @@
|
||||||
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 = "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,
|
|
||||||
headers={"Referer": url},
|
|
||||||
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": 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, 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)
|
|
||||||
169
M3U8/scrapers/timstreams.py
Normal file
169
M3U8/scrapers/timstreams.py
Normal file
|
|
@ -0,0 +1,169 @@
|
||||||
|
from functools import partial
|
||||||
|
from urllib.parse import urljoin
|
||||||
|
|
||||||
|
from playwright.async_api import Browser
|
||||||
|
|
||||||
|
from .utils import Cache, Time, get_logger, leagues, network
|
||||||
|
|
||||||
|
log = get_logger(__name__)
|
||||||
|
|
||||||
|
urls: dict[str, dict[str, str | float]] = {}
|
||||||
|
|
||||||
|
TAG = "TIMSTRMS"
|
||||||
|
|
||||||
|
CACHE_FILE = Cache(TAG, exp=3_600)
|
||||||
|
|
||||||
|
API_FILE = Cache(f"{TAG}-api", exp=19_800)
|
||||||
|
|
||||||
|
API_URL = "https://timstreams.fit/api/live-upcoming"
|
||||||
|
|
||||||
|
BASE_URL = "https://timstreams.fit"
|
||||||
|
|
||||||
|
SPORT_GENRES = {
|
||||||
|
1: "Soccer",
|
||||||
|
2: "Motorsport",
|
||||||
|
3: "MMA",
|
||||||
|
4: "Fight",
|
||||||
|
5: "Boxing",
|
||||||
|
6: "Wrestling",
|
||||||
|
7: "Basketball",
|
||||||
|
# 8: "American Football",
|
||||||
|
9: "Baseball",
|
||||||
|
10: "Tennis",
|
||||||
|
11: "Hockey",
|
||||||
|
# 12: "Darts",
|
||||||
|
# 13: "Cricket",
|
||||||
|
# 14: "Cycling",
|
||||||
|
# 15: "Rugby",
|
||||||
|
# 16: "Live Shows",
|
||||||
|
# 17: "Other",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async def get_events(cached_keys: list[str]) -> list[dict[str, str]]:
|
||||||
|
now = Time.clean(Time.now())
|
||||||
|
|
||||||
|
if not (api_data := API_FILE.load(per_entry=False)):
|
||||||
|
log.info("Refreshing API cache")
|
||||||
|
|
||||||
|
api_data = {"timestamp": now.timestamp()}
|
||||||
|
|
||||||
|
if r := await network.request(API_URL, log=log):
|
||||||
|
api_data: dict = r.json()
|
||||||
|
|
||||||
|
api_data["timestamp"] = now.timestamp()
|
||||||
|
|
||||||
|
API_FILE.write(api_data)
|
||||||
|
|
||||||
|
events = []
|
||||||
|
|
||||||
|
start_dt = now.delta(hours=-3)
|
||||||
|
end_dt = now.delta(minutes=5)
|
||||||
|
|
||||||
|
for info in api_data.get("events", []):
|
||||||
|
if (genre := info.get("genre", 999)) not in SPORT_GENRES:
|
||||||
|
continue
|
||||||
|
|
||||||
|
event_time = " ".join(info["time"].split("T"))
|
||||||
|
|
||||||
|
event_dt = Time.from_str(event_time, timezone="EST")
|
||||||
|
|
||||||
|
if not start_dt <= event_dt <= end_dt:
|
||||||
|
continue
|
||||||
|
|
||||||
|
name: str = info["name"]
|
||||||
|
|
||||||
|
url_id: str = info["url"]
|
||||||
|
|
||||||
|
logo: str | None = info.get("logo")
|
||||||
|
|
||||||
|
sport = SPORT_GENRES[genre]
|
||||||
|
|
||||||
|
if f"[{sport}] {name} ({TAG})" in cached_keys:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if not (streams := info.get("streams")) or not (url := streams[0].get("url")):
|
||||||
|
continue
|
||||||
|
|
||||||
|
events.append(
|
||||||
|
{
|
||||||
|
"sport": sport,
|
||||||
|
"event": name,
|
||||||
|
"link": urljoin(BASE_URL, f"watch/{url_id}"),
|
||||||
|
"ref": url,
|
||||||
|
"logo": logo,
|
||||||
|
"timestamp": event_dt.timestamp(),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
return events
|
||||||
|
|
||||||
|
|
||||||
|
async def scrape(browser: Browser) -> 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)")
|
||||||
|
|
||||||
|
async with network.event_context(browser, stealth=False) as context:
|
||||||
|
for i, ev in enumerate(events, start=1):
|
||||||
|
async with network.event_page(context) as page:
|
||||||
|
handler = partial(
|
||||||
|
network.process_event,
|
||||||
|
url=(link := ev["link"]),
|
||||||
|
url_num=i,
|
||||||
|
page=page,
|
||||||
|
log=log,
|
||||||
|
)
|
||||||
|
|
||||||
|
url = await network.safe_process(
|
||||||
|
handler,
|
||||||
|
url_num=i,
|
||||||
|
semaphore=network.PW_S,
|
||||||
|
log=log,
|
||||||
|
)
|
||||||
|
|
||||||
|
sport, event, logo, ref, ts = (
|
||||||
|
ev["sport"],
|
||||||
|
ev["event"],
|
||||||
|
ev["logo"],
|
||||||
|
ev["ref"],
|
||||||
|
ev["timestamp"],
|
||||||
|
)
|
||||||
|
|
||||||
|
key = f"[{sport}] {event} ({TAG})"
|
||||||
|
|
||||||
|
tvg_id, pic = leagues.get_tvg_info(sport, event)
|
||||||
|
|
||||||
|
entry = {
|
||||||
|
"url": url,
|
||||||
|
"logo": logo or pic,
|
||||||
|
"base": ref,
|
||||||
|
"timestamp": ts,
|
||||||
|
"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)
|
||||||
12
readme.md
12
readme.md
|
|
@ -1,13 +1,15 @@
|
||||||
## Base Log @ 2026-03-30 09:53 UTC
|
## Base Log @ 2026-03-29 09:03 UTC
|
||||||
|
|
||||||
### ✅ Working Streams: 158<br>❌ Dead Streams: 4
|
### ✅ Working Streams: 156<br>❌ Dead Streams: 6
|
||||||
|
|
||||||
| Channel | Error (Code) | Link |
|
| Channel | Error (Code) | Link |
|
||||||
| ------- | ------------ | ---- |
|
| ------- | ------------ | ---- |
|
||||||
| FDSN Southeast | HTTP Error (403) | `http://mytvstream.net:8080/live/30550113/30550113/2213.m3u8` |
|
| Altitude Sports | HTTP Error (403) | `http://mytvstream.net:8080/live/30550113/30550113/79545.m3u8` |
|
||||||
| FDSN Southwest | HTTP Error (403) | `http://mytvstream.net:8080/live/30550113/30550113/21843.m3u8` |
|
| Hallmark Family | HTTP Error (000) | `http://mytvstream.net:8080/live/30550113/30550113/9307.m3u8` |
|
||||||
| Hallmark Family | HTTP Error (403) | `http://mytvstream.net:8080/live/30550113/30550113/9307.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` |
|
||||||
|
| 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