"epg_url": None, "countries": [spain.to_json(), international.to_json(), andorra.to_json()], "updated": get_current_timestamp() } json_file = open('./public/output/radio_channels.json', "w+") json_file.write(json.dumps(json_result, indent=4, sort_keys=False)) json_file.close() print("JSON Updated") # Save data to M3U8 file text_file = open('./public/output/radio_channels.m3u8', "w+") text_file.write("#EXTM3U" + "\n") text_file.write("# @LaQuay https://github.com/LaQuay/TDTChannels" + "\n") text_file.write(spain.to_m3u8()) text_file.write(international.to_m3u8()) text_file.write(andorra.to_m3u8()) text_file.close() print("M3U8 Updated") # Save data to M3U file text_file = open('./public/output/radio_channels.m3u', "w+") text_file.write("#EXTM3U" + "\n") text_file.write("# @LaQuay https://github.com/LaQuay/TDTChannels" + "\n") text_file.write(spain.to_m3u8()) text_file.write(international.to_m3u8()) text_file.write(andorra.to_m3u8()) text_file.close() print("M3U Updated")
canales_autonomicos_pais_vasco = stringbetween(content, "#### Pais Vasco", "#### La Rioja") spain.add_ambit( Ambito("Pais Vasco", get_channels_from_part(canales_autonomicos_pais_vasco))) canales_autonomicos_la_rioja = stringbetween(content, "#### La Rioja", "#### Valencia") spain.add_ambit( Ambito("La Rioja", get_channels_from_part(canales_autonomicos_la_rioja))) canales_autonomicos_valencia = stringbetween(content, "#### Valencia", "## Internacionales") spain.add_ambit( Ambito("Valencia", get_channels_from_part(canales_autonomicos_valencia))) # Save data to JSON file json_file = open('./public/output/channels.json', "w+") # TODO Anadir copyright json_file.write(json.dumps(spain.to_json())) json_file.close() # Save data to M3U8 file text_file = open('./public/output/channels.m3u8', "w+") text_file.write("#EXTM3U" + "\n") text_file.write("# @LaQuay https://github.com/LaQuay/TDTChannels" + "\n") text_file.write(spain.to_m3u8()) text_file.close() print("JSON + M3U8 Updated")
json_file.write(", ") json_file.write(json.dumps(spain.to_json())) json_file.write(", ") json_file.write(json.dumps(international.to_json())) json_file.write(", ") json_file.write(json.dumps(andorra.to_json())) json_file.write("]") json_file.close() print("JSON Updated") # Save data to M3U8 file text_file = open('./public/output/channels.m3u8', "w+") text_file.write("#EXTM3U @LaQuay https://github.com/LaQuay/TDTChannels" + "\n") text_file.write( "#EXTM3U url-tvg=\"https://raw.githubusercontent.com/HelmerLuzo/TDTChannels_EPG/master/TDTChannels_EPG.xml\"\n") text_file.write(spain.to_m3u8()) text_file.write(international.to_m3u8()) text_file.write(andorra.to_m3u8()) text_file.close() print("M3U8 Updated") # Save data to M3U file text_file = open('./public/output/channels.m3u', "w+") text_file.write("#EXTM3U @LaQuay https://github.com/LaQuay/TDTChannels" + "\n") text_file.write( "#EXTM3U url-tvg=\"https://raw.githubusercontent.com/HelmerLuzo/TDTChannels_EPG/master/TDTChannels_EPG.xml\"\n") text_file.write(spain.to_m3u8()) text_file.write(international.to_m3u8()) text_file.write(andorra.to_m3u8()) text_file.close() print("M3U Updated")