generate functionWed, 15 Feb 2023

write me a script in python to generate a playlist in the folder there is a file flussonic.conf take the name of the channel from the title line, then take the channel id from this line and generate a link channel /index.m3u8 it should look like this #EXTM3U #EXTINF:-1, channel name channel /index.m3u8 and save it to a playlist.m3u file

with open("flussonic.conf") as f: lines = f.readlines() for line in lines: if "title" in line: print("#EXTM3U") title = line.split(" ")[1].strip() print("#EXTINF:-1," + title) print("" + line.split("/")[1].split(" ")[0] + "/index.m3u8")

Questions about programming?Chat with your personal AI assistant