Skip to content

Commit

Permalink
Final retouches to have standalone distributable releases, ATM for
Browse files Browse the repository at this point in the history
Windows. Catchup, live channels and cloud recordings are tested and
work beautifully on Windows 11 x86_64, which, I must say, is the
coolest Windows ever :)

Signed-off-by: Javier Marcet <[email protected]>
  • Loading branch information
jmarcet committed Jan 12, 2022
1 parent 754dbc0 commit bfd0489
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 11 deletions.
1 change: 0 additions & 1 deletion install.ps1

This file was deleted.

17 changes: 17 additions & 0 deletions movistar-u7d.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# $env:HOME = "C:\\Users\\usuario" # ruta donde queremos que se generen las listas m3u, la guía y el directorio oculto .xmltv
# $env:LAN_IP = "192.168.1.15" # dirección IP, de las disponibles en el sistema, en la que queremos que el proxy funcione
# $env:EPG_THREADS = "4" # número de hilos para descargar la epg
# $env:MP4_OUTPUT = "1" # hacer grabaciones a fichero .mp4 y .sub por separado
# $env:RECORDING_THREADS = "4" # número de grabaciones simultáneas
# $env:RECORDINGS = "C:\\Users\\usuario\\Videos" # directorio para grabaciones, si se establece se activará la comprobación periódica de timers.conf
# $env:SANIC_PORT = "8888" # puerto en el que el proxy será accesible
# $env:VERBOSE_LOGS = "0" # no mostrar la url a la que se accede en los log

$env:HOME = $env:HOMEPATH

Start-Process .\movistar_epg.exe -NoNewWindow -RedirectStandardError $env:TMP\movistar_epg_err.log -RedirectStandardOutput $env:TMP\movistar_epg_out.log
sleep 5
Start-Process .\movistar_u7d.exe -NoNewWindow -RedirectStandardError $env:TMP\movistar_u7d_err.log -RedirectStandardOutput $env:TMP\movistar_u7d_out.log

tail -f $env:TMP\movistar_epg_err.log $env:TMP\movistar_epg_out.log $env:TMP\movistar_u7d_err.log $env:TMP\movistar_u7d_out.log $env:HOME\.xmltv\tv_grab_es_movistartv.log

3 changes: 0 additions & 3 deletions movistar_epg.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,6 @@ def merge():

if updated or not os.path.exists(CHANNELS_CLOUD) or not os.path.exists(GUIDE_CLOUD):
tv_cloud1 = await asyncio.create_subprocess_exec(
"python3",
f"{PREFIX}tv_grab_es_movistartv",
"--cloud_m3u",
CHANNELS_CLOUD,
Expand All @@ -718,7 +717,6 @@ def merge():
)
async with tvgrab_lock:
tv_cloud2 = await asyncio.create_subprocess_exec(
"python3",
f"{PREFIX}tv_grab_es_movistartv",
"--cloud_recordings",
GUIDE_CLOUD,
Expand All @@ -740,7 +738,6 @@ async def update_epg():
for i in range(5):
async with tvgrab_lock:
tvgrab = await asyncio.create_subprocess_exec(
"python3",
f"{PREFIX}tv_grab_es_movistartv",
"--tvheadend",
CHANNELS,
Expand Down
6 changes: 0 additions & 6 deletions movistar_u7d.ps1

This file was deleted.

3 changes: 2 additions & 1 deletion movistar_u7d.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
SANIC_URL = f"http://{SANIC_HOST}:{SANIC_PORT}"
SANIC_THREADS = int(os.getenv("SANIC_THREADS", "4"))
VERBOSE_LOGS = bool(int(os.getenv("VERBOSE_LOGS", 1)))
VOD_EXEC = "vod.exe" if os.path.exists("vod.exe") else "vod.py"

YEAR_SECONDS = 365 * 24 * 60 * 60

Expand Down Expand Up @@ -349,7 +350,7 @@ async def handle_flussonic(request, channel_id, url, cloud=False):
)
elif record:
cmd = (
f"{PREFIX}vod.py {channel_id} {program_id} -s {offset}"
f"{PREFIX}{VOD_EXEC} {channel_id} {program_id} -s {offset}"
f" -p {client_port} -i {request.ip} -a {_IPTV}"
)
record = int(record)
Expand Down
1 change: 1 addition & 0 deletions requirements-win.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ sanic
git+https://github.com/jmarcet/sanic-prometheus
tomli
ujson
cx_Freeze
23 changes: 23 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from cx_Freeze import Executable, setup

build_exe_options = {
"include_files": ["movistar-u7d.ps1"],
"includes": ["anyio._backends._asyncio"],
"excludes": ["test", "tkinter", "unittest"],
"optimize": 2,
}

executables = [
Executable("movistar_epg.py"),
Executable("movistar_u7d.py"),
Executable("tv_grab_es_movistartv"),
Executable("vod.py"),
]

setup(
name="movistar-u7d",
version="4.0b1",
description="Movistar IPTV U7D to flussonic catchup proxy",
options={"build_exe": build_exe_options},
executables=executables,
)

0 comments on commit bfd0489

Please sign in to comment.