Skip to content

Commit

Permalink
v1.4.12.33
Browse files Browse the repository at this point in the history
  • Loading branch information
sebdelsol committed Feb 28, 2024
1 parent a2448b2 commit 8b04b77
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 71 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@

[^1]: External EPG doesn't work with **local** m3u accounts.
# Download
[<img src="https://custom-icon-badges.demolab.com/badge/Sfvip All v1.4.12.32-informational.svg?logo=download-cloud&logoSource=feather&logoColor=white" height="28"><img src="https://img.shields.io/badge/x64-informational.svg?logo=Windows10&logoColor=lightblue" height="28"><img src="https://custom-icon-badges.demolab.com/badge/clean-brightgreen.svg?logo=shield-check&logoColor=white" height="28">](https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.32/Install.Sfvip.All.1.4.12.32.x64.exe)
<sup><sup>_by MS Defender • 1.1.24010.10 • 1.405.651.0_</sup></sup>
[<img src="https://custom-icon-badges.demolab.com/badge/Sfvip All v1.4.12.33-informational.svg?logo=download-cloud&logoSource=feather&logoColor=white&style=flat-square" height="28"><img src="https://img.shields.io/badge/x64-informational.svg?logo=Windows10&logoColor=lightblue&style=flat-square" height="28"><img src="https://custom-icon-badges.demolab.com/badge/clean-brightgreen.svg?logo=shield-check&logoColor=white&style=flat-square" height="28">](https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.33/Install.Sfvip.All.1.4.12.33.x64.exe)
<sup><sup>_by MS Defender • 1.1.24010.10 • 1.405.697.0_</sup></sup>

[<img src="https://custom-icon-badges.demolab.com/badge/Sfvip All v1.4.12.33-informational.svg?logo=download-cloud&logoSource=feather&logoColor=white&style=flat-square" height="28"><img src="https://img.shields.io/badge/x86-informational.svg?logo=Windows10&logoColor=lightblue&style=flat-square" height="28"><img src="https://custom-icon-badges.demolab.com/badge/clean-brightgreen.svg?logo=shield-check&logoColor=white&style=flat-square" height="28">](https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.33/Install.Sfvip.All.1.4.12.33.x86.exe)
<sup><sup>_by MS Defender • 1.1.24010.10 • 1.405.697.0_</sup></sup>

[![download](https://img.shields.io/github/downloads/sebdelsol/sfvip-all/total?color=informational)](https://tooomm.github.io/github-release-stats/?username=sebdelsol&repository=sfvip-all)
[![issues](https://img.shields.io/github/issues/sebdelsol/sfvip-all)](https://github.com/sebdelsol/sfvip-all/issues?q=is%3Aopen)

[<img src="https://custom-icon-badges.demolab.com/badge/Sfvip All v1.4.12.32-informational.svg?logo=download-cloud&logoSource=feather&logoColor=white" height="28"><img src="https://img.shields.io/badge/x86-informational.svg?logo=Windows10&logoColor=lightblue" height="28"><img src="https://custom-icon-badges.demolab.com/badge/clean-brightgreen.svg?logo=shield-check&logoColor=white" height="28">](https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.32/Install.Sfvip.All.1.4.12.32.x86.exe)
<sup><sup>_by MS Defender • 1.1.24010.10 • 1.405.651.0_</sup></sup>

Check the [***changelog***](build/changelog.md) and ***notes***[^2].
[***Sfvip Player***](https://github.com/K4L4Uz/SFVIP-Player/tree/master) will be automatically installed if missing.
Please use [***SfvipUserProxy***](user_proxy_cmd) if you need to add or remove an user proxy for ***all users*** in ***Sfvip Player*** database.

[![download](https://img.shields.io/github/downloads/sebdelsol/sfvip-all/total?color=blue&label=Downloads&logo=github)](https://tooomm.github.io/github-release-stats/?username=sebdelsol&repository=sfvip-all) <sup><sub>for _Sfvip All v1.4.12.30_ and above</sub></sup>

[^2]:_**Sfvip All** will ask you for network connection its first run because it relies on local proxies to do its magic._
_On **old systems** you might need to install [**vc redist**](https://learn.microsoft.com/en-GB/cpp/windows/latest-supported-vc-redist) for [**x86**](https://aka.ms/vs/17/release/vc_redist.x86.exe) or [**x64**](https://aka.ms/vs/17/release/vc_redist.x64.exe)._

Expand All @@ -33,13 +35,10 @@ The logs are to be found in the app folder:
[![Python](https://img.shields.io/badge/Python-3.11.8-fbdf79?logo=python&logoColor=fbdf79)](https://www.python.org/downloads/release/python-3118/)
[![mitmproxy](https://custom-icon-badges.demolab.com/badge/Mitmproxy-10.2.2-informational.svg?logo=mitmproxy)](https://mitmproxy.org/)
[![Style](https://custom-icon-badges.demolab.com/badge/Style-Black-000000.svg?logo=file-code&logoColor=a0a0a0)](https://black.readthedocs.io/en/stable/)
[![Sloc](https://custom-icon-badges.demolab.com/badge/Sloc-7944-000000.svg?logo=file-code&logoColor=a0a0a0)](https://api.codetabs.com/v1/loc/?github=sebdelsol/sfvip-all)

[![Nuitka](https://custom-icon-badges.demolab.com/badge/Nuitka-2.0.4-informational.svg?logo=tools&logoColor=61dafb)](https://nuitka.net/)
<sup><sub>**or**</sub></sup>
[![PyInstaller](https://custom-icon-badges.demolab.com/badge/PyInstaller-6.4.0-informational.svg?logo=tools&logoColor=61dafb)](https://pyinstaller.org/en/stable/)

[![Sloc](https://custom-icon-badges.demolab.com/badge/Sloc-7963-000000.svg?logo=file-code&logoColor=a0a0a0)](https://api.codetabs.com/v1/loc/?github=sebdelsol/sfvip-all)
[![Nsis](https://img.shields.io/badge/Nsis-3.09-informational?logo=NSIS&logoColor=fbdf79)](https://nsis.sourceforge.io/Download)
[![Nuitka](https://custom-icon-badges.demolab.com/badge/Nuitka-2.0.5-informational.svg?logo=tools&logoColor=61dafb)](https://nuitka.net/)
[![PyInstaller](https://custom-icon-badges.demolab.com/badge/PyInstaller-6.4.0-informational.svg?logo=tools&logoColor=61dafb)](https://pyinstaller.org/en/stable/)

[***NSIS***](https://nsis.sourceforge.io/Download) will be automatically installed if missing.
Check the [***build config***](build_config.py).
Expand Down
8 changes: 7 additions & 1 deletion build/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## 1.4.12.33
* Info window stays longer.
* Bump _Nuitka_ to 2.0.5.
* Fix & Clean EPG cache.
* Fix tooltip.

## 1.4.12.32
* EPG programmes are cached for faster access.
* EPG is cached for faster access.

## 1.4.12.31
* Platform added in the logs.
Expand Down
6 changes: 3 additions & 3 deletions build/update_x64.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"url": "https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.32/Install.Sfvip.All.1.4.12.32.x64.exe",
"md5": "013cdbb5affef3ad2c2eddfbf4f77df6",
"version": "1.4.12.32"
"url": "https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.33/Install.Sfvip.All.1.4.12.33.x64.exe",
"md5": "56c83b643f4d8217742c608aee4d3e07",
"version": "1.4.12.33"
}
6 changes: 3 additions & 3 deletions build/update_x86.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"url": "https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.32/Install.Sfvip.All.1.4.12.32.x86.exe",
"md5": "4efd05bd493720e91626bccb6a18cfbe",
"version": "1.4.12.32"
"url": "https://github.com/sebdelsol/sfvip-all/releases/download/Sfvip.All.1.4.12.33/Install.Sfvip.All.1.4.12.33.x86.exe",
"md5": "74097b26b8867e9e0b2fe8ffb661f72e",
"version": "1.4.12.33"
}
2 changes: 1 addition & 1 deletion build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Build:
main: ClassVar = "sfvip_all.py"
company: ClassVar = "sebdelsol"
name: ClassVar = "Sfvip All"
version: ClassVar = "1.4.12.32"
version: ClassVar = "1.4.12.33"
dir: ClassVar = "build"
enable_console: ClassVar = False
logs_dir: ClassVar = "../logs"
Expand Down
12 changes: 6 additions & 6 deletions dev/tools/templater.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .publisher import Publisher
from .scanner.file import ScanFile
from .utils.color import Low, Ok, Title, Warn
from .utils.dist import repr_size
from .utils.protocols import (
CfgBuild,
CfgEnvironments,
Expand Down Expand Up @@ -54,11 +55,10 @@ def _get_exe_kwargs(name: str, python_envs: PythonEnvs, publisher: Publisher) ->
bitness = python_env.bitness
local_version = local_versions.get(bitness)
scan = ScanFile(local_version.exe) if local_version else ScanFile
print(
Ok(f". {name} {local_version.version} {bitness}")
if local_version
else Warn(f". No {name} {bitness} version")
)
if local_version:
print(Ok(f". {name} {local_version.version} {bitness}"), Low(f"- {repr_size(local_version.exe)}"))
else:
print(Warn(f". No {name} {bitness} version"))
kwargs |= {
f"version_{bitness}": local_version.version if local_version else "0",
f"exe_{bitness}_release": local_version.url if local_version else "",
Expand Down Expand Up @@ -86,7 +86,7 @@ def __init__(
mitmproxy_version = _version_of(python_envs, "mitmproxy")
pyinstaller_version = _version_of(python_envs, "PyInstaller")
if python_version and nuitka_version and mitmproxy_version and pyinstaller_version:
print(Title("Build"), Ok("template for"))
print(Title("Build"), Ok("template"))
self.template_format = dict(
**_get_exe_kwargs(build.name, python_envs, publisher),
py_major_version=str(PythonVersion(python_version).major),
Expand Down
15 changes: 7 additions & 8 deletions resources/README_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@

[^1]: External EPG doesn't work with **local** m3u accounts.
# Download
[<img src="https://custom-icon-badges.demolab.com/badge/{name} v{version_x64}-informational.svg?logo=download-cloud&logoSource=feather&logoColor=white" height="{h_download}"><img src="https://img.shields.io/badge/x64-informational.svg?logo=Windows10&logoColor=lightblue" height="{h_download}"><img src="https://custom-icon-badges.demolab.com/badge/{exe_x64_clean}.svg?logo=shield-check&logoColor=white" height="{h_download}">]({exe_x64_release})
[<img src="https://custom-icon-badges.demolab.com/badge/{name} v{version_x64}-informational.svg?logo=download-cloud&logoSource=feather&logoColor=white&style=flat-square" height="{h_download}"><img src="https://img.shields.io/badge/x64-informational.svg?logo=Windows10&logoColor=lightblue&style=flat-square" height="{h_download}"><img src="https://custom-icon-badges.demolab.com/badge/{exe_x64_clean}.svg?logo=shield-check&logoColor=white&style=flat-square" height="{h_download}">]({exe_x64_release})
<sup><sup>_by MS Defender • {exe_x64_engine} • {exe_x64_signature}_</sup></sup>

[<img src="https://custom-icon-badges.demolab.com/badge/{name} v{version_x86}-informational.svg?logo=download-cloud&logoSource=feather&logoColor=white" height="{h_download}"><img src="https://img.shields.io/badge/x86-informational.svg?logo=Windows10&logoColor=lightblue" height="{h_download}"><img src="https://custom-icon-badges.demolab.com/badge/{exe_x86_clean}.svg?logo=shield-check&logoColor=white" height="{h_download}">]({exe_x86_release})
[<img src="https://custom-icon-badges.demolab.com/badge/{name} v{version_x86}-informational.svg?logo=download-cloud&logoSource=feather&logoColor=white&style=flat-square" height="{h_download}"><img src="https://img.shields.io/badge/x86-informational.svg?logo=Windows10&logoColor=lightblue&style=flat-square" height="{h_download}"><img src="https://custom-icon-badges.demolab.com/badge/{exe_x86_clean}.svg?logo=shield-check&logoColor=white&style=flat-square" height="{h_download}">]({exe_x86_release})
<sup><sup>_by MS Defender • {exe_x86_engine} • {exe_x86_signature}_</sup></sup>

[![download](https://img.shields.io/github/downloads/{github_path}/total?color=informational)](https://tooomm.github.io/github-release-stats/?username={github_owner}&repository={github_repo})
[![issues](https://img.shields.io/github/issues/sebdelsol/sfvip-all)](https://github.com/sebdelsol/sfvip-all/issues?q=is%3Aopen)


Check the [***changelog***](build/changelog.md) and ***notes***[^2].
[***Sfvip Player***](https://github.com/K4L4Uz/SFVIP-Player/tree/master) will be automatically installed if missing.
Please use [***SfvipUserProxy***](user_proxy_cmd) if you need to add or remove an user proxy for ***all users*** in ***Sfvip Player*** database.

[![download](https://img.shields.io/github/downloads/{github_path}/total?color=blue&label=Downloads&logo=github)](https://tooomm.github.io/github-release-stats/?username={github_owner}&repository={github_repo}) <sup><sub>for _{name} v1.4.12.30_ and above</sub></sup>

[^2]:_**{name}** will ask you for network connection its first run because it relies on local proxies to do its magic._
_On **old systems** you might need to install [**vc redist**](https://learn.microsoft.com/en-GB/cpp/windows/latest-supported-vc-redist) for [**x86**](https://aka.ms/vs/17/release/vc_redist.x86.exe) or [**x64**](https://aka.ms/vs/17/release/vc_redist.x64.exe)._

Expand All @@ -34,13 +36,10 @@ The logs are to be found in the app folder:
[![mitmproxy](https://custom-icon-badges.demolab.com/badge/Mitmproxy-{mitmproxy_version}-informational.svg?logo=mitmproxy)](https://mitmproxy.org/)
[![Style](https://custom-icon-badges.demolab.com/badge/Style-Black-000000.svg?logo=file-code&logoColor=a0a0a0)](https://black.readthedocs.io/en/stable/)
[![Sloc](https://custom-icon-badges.demolab.com/badge/Sloc-{sloc}-000000.svg?logo=file-code&logoColor=a0a0a0)](https://api.codetabs.com/v1/loc/?github={github_path})

[![Nsis](https://img.shields.io/badge/Nsis-{nsis_version}-informational?logo=NSIS&logoColor=fbdf79)](https://nsis.sourceforge.io/Download)
[![Nuitka](https://custom-icon-badges.demolab.com/badge/Nuitka-{nuitka_version}-informational.svg?logo=tools&logoColor=61dafb)](https://nuitka.net/)
<sup><sub>**or**</sub></sup>
[![PyInstaller](https://custom-icon-badges.demolab.com/badge/PyInstaller-{pyinstaller_version}-informational.svg?logo=tools&logoColor=61dafb)](https://pyinstaller.org/en/stable/)

[![Nsis](https://img.shields.io/badge/Nsis-{nsis_version}-informational?logo=NSIS&logoColor=fbdf79)](https://nsis.sourceforge.io/Download)

[***NSIS***](https://nsis.sourceforge.io/Download) will be automatically installed if missing.
Check the [***build config***](build_config.py).

Expand Down
4 changes: 2 additions & 2 deletions shared/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def is_valid_exe(self, exe: Path) -> bool:
class AppLatestUpdate:
def __init__(self, build: BuildDir, github: Github) -> None:
self._build_dir = build.dir
self._github_dir = f"https://github.com/{github.owner}/{github.repo}/raw/master"
self._github_dir = f"https://raw.githubusercontent.com/{github.owner}/{github.repo}/master"

def _file(self, bitness: BitnessT) -> Path:
return Path(f"{self._build_dir}/update_{bitness}.json")
return Path(self._build_dir) / f"update_{bitness}.json"

def _url(self, bitness: BitnessT) -> str:
return f"{self._github_dir}/{self._file(bitness).as_posix()}"
Expand Down
56 changes: 36 additions & 20 deletions src/mitm/epg/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,40 +73,56 @@ def load(self, xml: Path, url: str) -> Optional[ChannelsT]:
def save(self, xml: Path, url: str, channels: ChannelsT) -> None:
with self.open(url, "wb") as f:
if f:
self.pickle_dump(f, xml, channels)
if not self.pickle_dump(f, xml, channels):
f.truncate(0) # clear

def pickle_dump(self, f: IO[bytes], xml: Path, channels: ChannelsT) -> None:
def pickle_dump(self, f: IO[bytes], xml: Path, channels: ChannelsT) -> bool:
try:
self.epg_process.update_status(EPGProgress(EPGstatus.SAVE_CACHE))
if n_chunks := math.ceil(len(channels) / ChannelsCache.chunk_size):
pickle.dump(compute_md5(xml), f)
pickle.dump(n_chunks, f)
it = iter(channels)
for i in range(n_chunks):
if self.epg_process.stopping():
return
self.epg_process.update_status(EPGProgress(EPGstatus.SAVE_CACHE, i / n_chunks))
chunk = {k: channels[k] for k in islice(it, ChannelsCache.chunk_size)}
pickle.dump(chunk, f)
n_chunks = math.ceil(len(channels) / ChannelsCache.chunk_size)
pickle.dump(compute_md5(xml), f)
pickle.dump(n_chunks, f)
it = iter(channels)

def handle_chunk() -> bool:
chunk = {k: channels[k] for k in islice(it, ChannelsCache.chunk_size)}
pickle.dump(chunk, f)
return True

if self.handle_chunks(n_chunks, handle_chunk, EPGstatus.SAVE_CACHE):
return True
except pickle.PickleError:
pass
return False
return False

def pickle_load(self, f: IO[bytes], xml: Path) -> Optional[ChannelsT]:
try:
self.epg_process.update_status(EPGProgress(EPGstatus.LOAD_CACHE))
md5 = pickle.load(f)
n_chunks = pickle.load(f)
if isinstance(md5, str) and md5 == compute_md5(xml) and n_chunks and isinstance(n_chunks, int):
if isinstance(md5, str) and md5 == compute_md5(xml) and isinstance(n_chunks, int):
channels = {}
for i in range(n_chunks):
if self.epg_process.stopping():
return None
self.epg_process.update_status(EPGProgress(EPGstatus.LOAD_CACHE, i / n_chunks))

def handle_chunk() -> bool:
chunk = pickle.load(f)
if not isinstance(chunk, dict):
return None
return False
channels.update(chunk)
return channels
return True

if self.handle_chunks(n_chunks, handle_chunk, EPGstatus.LOAD_CACHE):
return channels
except (pickle.PickleError, EOFError):
return None
return None

def handle_chunks(self, n_chunks: int, handle_chunk: Callable[[], bool], status: EPGstatus) -> bool:
if not n_chunks:
return False
for i in range(n_chunks):
if self.epg_process.stopping():
return False
self.epg_process.update_status(EPGProgress(status, i / n_chunks))
if not handle_chunk():
return False
return True
9 changes: 8 additions & 1 deletion src/mitm/epg/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,14 @@ def _get(cls, url: str, cache: ChannelsCache, epg_process: EPGProcess, timeout:
epg_process.update_status(EPGProgress(EPGstatus.SAVE_CACHE))
cache.save(xml, url, channels)
return channels
except (requests.RequestException, gzip.BadGzipFile, ET.ParseError, EOFError, BufferError) as error:
except (
requests.RequestException,
ConnectionError,
gzip.BadGzipFile,
ET.ParseError,
EOFError,
BufferError,
) as error:
logger.error("%s: %s", error.__class__.__name__, error)
return None

Expand Down
7 changes: 4 additions & 3 deletions src/sfvip/ui/infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,10 @@ def _epg_status(epg_status: EPGProgress) -> Style:
return _epg_status_styles(progress).get(epg_status.status, _InfoStyle.app("").grey)


def set_tooltip(msg: str, *widgets: tk.Widget) -> None:
def set_tooltip(msg: str, *widgets: tk.Widget, offset: tuple[int, int] = (15, 15)) -> None:
dx, dy = offset
for widget in widgets:
ToolTip(widget, msg=msg, delay=0, bg=_InfoTheme.bg_interact, fg="grey", follow=True)
ToolTip(widget, msg=msg, bg=_InfoTheme.bg_interact, fg="grey", delay=-1, x_offset=dx, y_offset=dy)


# pylint: disable=too-many-instance-attributes
Expand Down Expand Up @@ -318,7 +319,7 @@ def show(self) -> None:
self._fade.fade(fade_duration_ms=250, out=False)

def hide(self) -> None:
self._fade.fade(fade_duration_ms=250, out=True, wait_ms=250)
self._fade.fade(fade_duration_ms=500, out=True, wait_ms=500)


class InfosWindow(_ProxiesWindow):
Expand Down
Loading

0 comments on commit 8b04b77

Please sign in to comment.