spain.get_ambit("Valencia").add_channels( get_radio_channels_from_part(canales_locales_valencia)) canales_internacionales = stringbetween(content, "## Internacionales", "## Andorra") international.add_ambit( Ambito("Internacional", get_radio_channels_from_part(canales_internacionales))) canales_andorra = stringbetween(content, "## Andorra", "") andorra.add_ambit( Ambito("Andorra", get_radio_channels_from_part(canales_andorra))) # Save data to JSON file json_result = { "license": get_license_info(), "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")
spain.get_ambit("Navarra").add_channels(get_tv_channels_from_part(canales_locales_navarra)) canales_locales_pais_vasco = stringbetween(content_local, "### País Vasco", "### Valencia") spain.get_ambit("País Vasco").add_channels(get_tv_channels_from_part(canales_locales_pais_vasco)) canales_locales_valencia = stringbetween(content_local, "### Valencia", "") spain.get_ambit("Valencia").add_channels(get_tv_channels_from_part(canales_locales_valencia)) canales_internacionales = stringbetween(content, "## Internacionales", "## Andorra") international.add_ambit(Ambito("Internacional", get_tv_channels_from_part(canales_internacionales))) canales_andorra = stringbetween(content, "## Andorra", "") andorra.add_ambit(Ambito("Andorra", get_tv_channels_from_part(canales_andorra))) # Save data to JSON file json_result = {"license": get_license_info(), "epg_url": "https://raw.githubusercontent.com/HelmerLuzo/TDTChannels_EPG/master/TDTChannels_EPG.xml", "countries": [spain.to_json(), international.to_json(), andorra.to_json()], "updated": get_current_timestamp() } json_file = open('./public/output/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/channels.m3u8', "w+") text_file.write("#EXTM3U @LaQuay https://github.com/LaQuay/TDTChannels" + "\n") text_file.write(
canales_locales_valencia = stringbetween(content_local, "### Valencia", "") spain.get_ambit("Valencia").add_channels( get_channels_from_part(canales_locales_valencia)) canales_internacionales = stringbetween(content, "## Internacionales", "## Andorra") international.add_ambit( Ambito("Internacional", get_channels_from_part(canales_internacionales))) canales_andorra = stringbetween(content, "## Andorra", "") andorra.add_ambit(Ambito("Andorra", get_channels_from_part(canales_andorra))) # Save data to JSON file json_file = open('./public/output/channels.json', "w+") json_file.write("[") json_file.write(json.dumps(get_license_info())) 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" + "\n") text_file.write("# @LaQuay https://github.com/LaQuay/TDTChannels" + "\n") text_file.write(spain.to_m3u8())
canales_locales_pais_vasco = stringbetween(content_local, "### País Vasco", "### Valencia") spain.get_ambit("País Vasco").add_channels(get_tv_channels_from_part(canales_locales_pais_vasco)) canales_locales_valencia = stringbetween(content_local, "### Valencia", "") spain.get_ambit("Valencia").add_channels(get_tv_channels_from_part(canales_locales_valencia)) canales_internacionales = stringbetween(content, "## Internacionales", "## Andorra") international.add_ambit(Ambito("Internacional", get_tv_channels_from_part(canales_internacionales))) canales_andorra = stringbetween(content, "## Andorra", "") andorra.add_ambit(Ambito("Andorra", get_tv_channels_from_part(canales_andorra))) # Save data to JSON file json_file = open('./public/output/channels.json', "w+") json_file.write("[") json_file.write(json.dumps(get_license_info())) 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")