From 2520d7aba88c96b6a7a8cc19895a59eaf5fb8d5f Mon Sep 17 00:00:00 2001 From: Pasquale Coppola Date: Sun, 11 Jul 2021 16:28:00 +0200 Subject: [PATCH] Update make_playlist.py I've added "encoding='utf-8'" in line 25 and line 30 because on Windows the original script return some error (UnicodeEncodeError: 'charmap' codec can't encode character). --- make_playlist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make_playlist.py b/make_playlist.py index 8da89c5..bde2bd5 100755 --- a/make_playlist.py +++ b/make_playlist.py @@ -22,12 +22,12 @@ class Channel(): if __name__ == "__main__": - with open("playlist.m3u8", "w") as playlist: + with open("playlist.m3u8", "w", encoding='utf-8') as playlist: print("#EXTM3U", file=playlist) for filename in sorted(os.listdir(".")): if filename == "README.md" or not filename.endswith(".md"): continue - with open(filename) as markup_file: + with open(filename, encoding='utf-8') as markup_file: group = filename.replace(".md", "").title() print("Generating %s" % group) for line in markup_file: