Beispiel #1
0
    def update():
        """ Update the channels and epg data """
        channels = []
        epg = dict()

        addons = Addon.get_iptv_addons()
        for addon in addons:
            _LOGGER.info('Updating IPTV data for %s...', addon.addon_id)

            # Fetch channels
            channels.extend(addon.get_channels())

            # Fetch EPG data
            epg.update(addon.get_epg())

        # Write files
        IptvSimple.write_playlist(channels)
        IptvSimple.write_epg(epg)

        IptvSimple.restart()