e
This commit is contained in:
parent
c2aa25a654
commit
00000d934a
12 changed files with 231 additions and 68 deletions
|
|
@ -3,7 +3,7 @@ import asyncio
|
|||
from pathlib import Path
|
||||
|
||||
import httpx
|
||||
from scrapers import livetvsx, ppv, streameast, tvpass
|
||||
from scrapers import fstv, livetvsx, ppv, streambtw, streameast, tvpass
|
||||
from scrapers.utils import UA, get_logger
|
||||
|
||||
log = get_logger(__name__)
|
||||
|
|
@ -36,8 +36,10 @@ async def vanilla_fetch() -> tuple[list[str], int]:
|
|||
|
||||
async def main() -> None:
|
||||
tasks = [
|
||||
asyncio.create_task(fstv.main(CLIENT)),
|
||||
asyncio.create_task(livetvsx.main(CLIENT)),
|
||||
asyncio.create_task(ppv.main(CLIENT)),
|
||||
asyncio.create_task(streambtw.main(CLIENT)),
|
||||
asyncio.create_task(streameast.main(CLIENT)),
|
||||
asyncio.create_task(tvpass.main(CLIENT)),
|
||||
vanilla_fetch(),
|
||||
|
|
@ -47,25 +49,40 @@ async def main() -> None:
|
|||
|
||||
base_m3u8, tvg_chno = results[-1]
|
||||
|
||||
additions = livetvsx.urls | ppv.urls | streameast.urls | tvpass.urls
|
||||
|
||||
lines = [
|
||||
f'#EXTINF:-1 tvg-chno="{chnl_num}" tvg-id="(N/A)" tvg-name="{event}" tvg-logo="{info["logo"]}" group-title="Live Events",{event}\n{info["url"]}'
|
||||
for chnl_num, (event, info) in enumerate(
|
||||
sorted(additions.items()),
|
||||
start=tvg_chno + 1,
|
||||
)
|
||||
]
|
||||
|
||||
M3U8_FILE.write_text(
|
||||
'#EXTM3U url-tvg="https://raw.githubusercontent.com/doms9/iptv/refs/heads/default/EPG/TV.xml"\n'
|
||||
+ "\n".join(base_m3u8)
|
||||
+ "\n"
|
||||
+ "\n".join(lines)
|
||||
+ "\n",
|
||||
encoding="utf-8",
|
||||
additions = (
|
||||
fstv.urls
|
||||
| livetvsx.urls
|
||||
| ppv.urls
|
||||
| streambtw.urls
|
||||
| streameast.urls
|
||||
| tvpass.urls
|
||||
)
|
||||
|
||||
live_events = []
|
||||
|
||||
for chnl_num, (event, info) in enumerate(
|
||||
sorted(additions.items()),
|
||||
start=tvg_chno + 1,
|
||||
):
|
||||
live_events.extend(
|
||||
(
|
||||
f'#EXTINF:-1 tvg-chno="{chnl_num}" tvg-id="(N/A)" tvg-name="{event}" tvg-logo="{info["logo"]}" group-title="Live Events",{event}',
|
||||
f'#EXTVLCOPT:http-referrer={info["base"]}',
|
||||
f'#EXTVLCOPT:http-origin={info["base"]}',
|
||||
info["url"],
|
||||
)
|
||||
)
|
||||
|
||||
m3u8_content = "\n".join(
|
||||
[
|
||||
'#EXTM3U url-tvg="https://raw.githubusercontent.com/doms9/iptv/refs/heads/default/EPG/TV.xml"'
|
||||
]
|
||||
+ base_m3u8
|
||||
+ live_events
|
||||
)
|
||||
|
||||
M3U8_FILE.write_text(m3u8_content, encoding="utf-8")
|
||||
|
||||
log.info(f"M3U8 saved to {M3U8_FILE.name}")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue