|
EPGSince version 2.9.6 you can use a regular regex block or python block inside the optional <channels_info> or <items_info> tags to get an EPG page from some site. It is stored in a local file in the addon user folder. This is optional but recommended to avoid repeated download of the epg data for each item. Then you can use the stored epg data with a regex block or python block for the items.
<items_info> <title>WILMAA TV</title> <description>Swiss IPTV</description> <thumbnail>https://lh3.googleusercontent.com/yjI46dGkmu4zFVFPUazpOgJeq3ZFg8yp6a5loJENzDtBhzVuY_VEJl1Fk0FeJYTecg=s360-rw</thumbnail> <epg>$doregex[page_epg]</epg> <epg_regex> <name>page_epg</name> <expres><![CDATA[#$pyFunction import requests, json from datetime import datetime def GetLSProData(page_data,Cookie_Jar,m,param='Param1Value'): t1 = datetime.utcnow().strftime('%Y/%m/%d') url = 'http://data.wilmaa.com/cal/%s/epg_json/all_epg_utc_day_5to5_v2.json'%t1 resp = requests.get(url, headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'}) js = resp.json() return js ]]></expres> <page></page> </epg_regex> </items_info>
<item> <title>Al Jazeera English</title> <link>link_to_stream</link> <thumbnail>http://resources.wilmaa.com/logos/360x120px/images/ai_jazeera_en.png</thumbnail> <epg>$doregex[epgregex]</epg> <epg_url></epg_url> <epg_regex> <name>epgregex</name> <expres><![CDATA[#$pyFunction from datetime import datetime import re, time def GetLSProData(page_data,Cookie_Jar,m,param='ai_jazeera_en'): data = open(page_data, 'r').read() sched = re.findall(r'%s\|(\d{10})\|(\d{10})\|(.*?)\|'%param, data) epg = '' ts = int(time.time()) for s in sched: if int(s[0]) >= ts: startt = datetime.fromtimestamp(int(s[0])) startts = startt.strftime('%H:%M') endt = datetime.fromtimestamp(int(s[1])) endts = endt.strftime('%H:%M') prog = s[2].encode('utf8') epg += "%s - %s %s\n\r"%(startts, endts, prog) return epg ]]></expres> <page></page> </epg_regex> </item>
<item> <title>Al Jazeera English</title> <link>link_to_stream</link> <thumbnail>http://resources.wilmaa.com/logos/360x120px/images/ai_jazeera_en.png</thumbnail> <epg>11:00 - 12:00 International news</epg> <epg_url></epg_url> </item> |