Update make_playlist.py (#62)

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).
pull/64/head
Pasquale Coppola 2021-07-14 15:15:32 +02:00 committed by GitHub
parent 61f4dc561e
commit e2ab81448e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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: