1.0.0+kodimov.7: synopsis in the programme guide; hourly IPTV Simple reload

Movistar's guide already carries the synopsis (Resena), genre, year,
age rating and pictures; write them to epg.xml.

IPTV Simple was set to reload the channel list and guide once a day at
4:00, so a new epg.xml didn't reach Kodi until then. Use its hourly
reload, which also makes Kodi fetch the guide again. The service switches
existing TV guide setups over once and restarts IPTV Simple when nothing
is playing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
XoséandClaude Opus 5.5 committed 2026-11-10 08:31:24 +01:00
1 parent 09d6a68f74
commit 9faaa482fc
6 files changed
+66 -10

No files matched your search

+31
View File
@@ -210,6 +210,37 @@ def write_if_changed(filename, content):
return True
def use_hourly_iptv_refresh(pvr_dir, addon_id):
"""TV guide setups before kodimov.7 made IPTV Simple reload the channel list
and programme guide only once a day, at 4:00, so a new epg.xml didn't reach
Kodi for up to a day. Switch them to a reload every hour, which also makes
Kodi fetch the guide again. Returns True if IPTV Simple must be restarted."""
import glob
import re
changed = False
for filename in glob.glob(os.path.join(pvr_dir, 'instance-settings-*.xml')):
with io.open(filename, 'r', encoding='utf-8') as f:
content = f.read()
if 'plugin.video.{}/channels.m3u8'.format(addon_id) not in content: continue
new = content
for setting, value in (('m3uRefreshMode', '1'), ('m3uRefreshIntervalMins', '60')):
new = re.sub(r'<setting id="{}"[^>]*?(/>|>[^<]*</setting>)'.format(setting),
'<setting id="{}">{}</setting>'.format(setting, value), new)
if write_if_changed(filename, new):
LOG('use_hourly_iptv_refresh: updated {}'.format(filename))
changed = True
return changed
def restart_iptv_simple():
"""Restarts IPTV Simple so it loads its instance settings again."""
import xbmc
for enabled in (False, True):
xbmc.executeJSONRPC(json.dumps({'jsonrpc': '2.0', 'id': 1, 'method': 'Addons.SetAddonEnabled',
'params': {'addonid': 'pvr.iptvsimple', 'enabled': enabled}}))
xbmc.sleep(3000)
def extra_channels_xmltv(session):
"""Returns the <channel> and <programme> elements for the extra channels,
taken from a public XMLTV guide and renamed to their tvg-id."""