INPUT = "/opt/epg/sk_tvg-id1.m3u"
OUTPUT = "/opt/epg/sk3.m3u"

with open(INPUT, "r", encoding="utf-8") as f:
    lines = f.readlines()

out = []

for line in lines:
    line = line.rstrip("\n")

    if line.startswith("#KODIPROP:http-user-agent="):
        continue

    if line.startswith("#EXTVLCOPT:http-user-agent="):
        continue

    out.append(line + "\n")

with open(OUTPUT, "w", encoding="utf-8") as f:
    f.writelines(out)

print("HOTOVO")
print(f"Vytvorené: {OUTPUT}")