From 05cf047127c565903761119d06954a58aa25e34c Mon Sep 17 00:00:00 2001 From: DYefremov Date: Sun, 18 Aug 2024 20:44:44 +0300 Subject: [PATCH] export to *.m3u correction --- app/eparser/iptv.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/eparser/iptv.py b/app/eparser/iptv.py index 2cda1b3f..542ea290 100644 --- a/app/eparser/iptv.py +++ b/app/eparser/iptv.py @@ -142,7 +142,11 @@ def export_to_m3u(path, bouquet, s_type, url=None): lines.append(f"#EXTINF:-1,{s.name}\n") lines.append(current_grp) if current_grp else None u = res.group(1) - lines.append(f"{unquote(u[:u.rfind(':')]) if s_type is SettingsType.ENIGMA_2 else u}\n") + if s_type is SettingsType.ENIGMA_2: + index = u.rfind(":") + lines.append(f"{unquote(u[:index] if index > 0 else u)}\n") + else: + lines.append(f"{u}\n") elif srv_type is BqServiceType.MARKER: current_grp = f"#EXTGRP:{s.name}\n" elif srv_type is BqServiceType.DEFAULT and url: