From 6bbe865e787aab1fe2e4fd9bf68b6212fc4d2e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1lm=C3=A1n=20=E2=80=9EKAMI=E2=80=9D=20Szalai?= Date: Wed, 15 Mar 2023 06:55:55 +0100 Subject: [PATCH] Process EPG file --- make_playlist.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/make_playlist.py b/make_playlist.py index d92c0a9..7a01bce 100755 --- a/make_playlist.py +++ b/make_playlist.py @@ -33,8 +33,9 @@ def main(): if not (os.path.isdir(dir_playlists)): os.mkdir(dir_playlists) with open("playlist.m3u8", "w", encoding='utf-8') as playlist: - head_playlist = f'#EXTM3U x-tvg-url="{",".join(EPG_LIST).replace({chr(92)} + "n","")}"' - print(f'#EXTM3U x-tvg-url="{",".join(EPG_LIST)}"', file=playlist) + processed_epg_list = ",".join(EPG_LIST).replace('\n', ' ') + head_playlist = f'#EXTM3U x-tvg-url="{processed_epg_list}"' + print(f'#EXTM3U x-tvg-url="{processed_epg_list}"', file=playlist) os.chdir("lists") for filename in sorted(os.listdir(".")): if filename == "README.md" or not filename.endswith(".md"):