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 http://server-1.mitv-iptv.ru:80/id channel /index.m3u8 it should look like this #EXTM3U #EXTINF:-1, channel name http://server-1.mitv-iptv.ru:80/id 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("http://server-1.mitv-iptv.ru:80/" + line.split("/")[1].split(" ")[0] + "/index.m3u8")