<div dir="auto">It's really good to have the local option to get the EIT data, thanks Stephen.<div dir="auto"><br></div><div dir="auto">As pointed out, the external sources can't be relied upon forever, and do occasionally go down - although it's been pretty reliable since I set it up a few months back.</div><div dir="auto"><br></div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 6, 2022, 11:44 Robert Fisher <<a href="mailto:robert@fisher.net.nz">robert@fisher.net.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Maybe I got lucky but all I did to get the new icons (they were not all <br>
available immediately after the recent channel changes) was, after a <br>
rescan I ran (on the backend):-<br>
<br>
Channel Editor > Icon Download<br>
<br>
Easy.<br>
<br>
On 16/04/22 00:41, Stephen Worthington wrote:<br>
> The FreeviewHD EPG downloadable from here:<br>
><br>
> <a href="https://nzxmltv.github.io/xmltv/guide.xml" rel="noreferrer noreferrer" target="_blank">https://nzxmltv.github.io/xmltv/guide.xml</a><br>
><br>
> is created by scraping the <a href="http://freeviewnz.tv" rel="noreferrer noreferrer" target="_blank">freeviewnz.tv</a> site's guide pages here:<br>
><br>
> <a href="https://freeviewnz.tv/tvguide/whats-on/" rel="noreferrer noreferrer" target="_blank">https://freeviewnz.tv/tvguide/whats-on/</a><br>
><br>
> and I noticed that it also scrapes the icon URLs for the channels.<br>
> Since my channel icons are well out of date, I wanted to update them<br>
> to the same ones used by <a href="http://freeviewnz.tv" rel="noreferrer noreferrer" target="_blank">freeviewnz.tv</a>. So I wrote some Python to<br>
> parse the guide.xml file and extract the data I wanted:<br>
><br>
> <a href="http://www.jsw.gen.nz/mythtv/get-freeview-icons.py" rel="noreferrer noreferrer" target="_blank">http://www.jsw.gen.nz/mythtv/get-freeview-icons.py</a><br>
><br>
> To use this, do this:<br>
><br>
> cd /tmp<br>
> wget <a href="http://www.jsw.gen.nz/mythtv/get-freeview-icons.py" rel="noreferrer noreferrer" target="_blank">http://www.jsw.gen.nz/mythtv/get-freeview-icons.py</a><br>
> chmod +x get-freeview-icons.py<br>
> wget <a href="https://nzxmltv.github.io/xmltv/guide.xml" rel="noreferrer noreferrer" target="_blank">https://nzxmltv.github.io/xmltv/guide.xml</a><br>
> ./get-freeview-icons.py guide.xml<br>
> chmod +x download-icons.sh<br>
><br>
> This will read the guide.xml file and create these two files from it:<br>
><br>
> download-icons.sh<br>
> freeview-icons.sql<br>
><br>
> The download-icons.sh file is a script containing wget commands to<br>
> download the icons. To use it, do this:<br>
><br>
> cd /home/mythtv/.mythtv/channels<br>
> /tmp/download-icons.sh<br>
> chown mythtv:mythtv *<br>
> chmod u=rw,g=rw,o=r *<br>
><br>
> Then you need to update your channel table to use the new icons. You<br>
> can do this manually, but it would be very tedious. So that is what<br>
> the freeview-icons.sql file is for - it contains the SQL to create a<br>
> new freeview-icons table in your database that contains the data<br>
> needed to use an update command to change all the icons automatically.<br>
><br>
> To use it, first backup your channel table in case there are any<br>
> problems:<br>
><br>
> sudo su<br>
> cd /tmp<br>
> mysqldump mythconverg channel >channel.sql<br>
> exit<br>
><br>
> Should you need to restore the old channel table, you need to first<br>
> shut down mythbackend and then do these commands:<br>
><br>
> sudo su<br>
> cd /tmp<br>
> mysql mythconverg<br>
> drop table channel;<br>
> source channel.sql<br>
> quit<br>
> exit<br>
><br>
> Now create the freeview_icons table:<br>
><br>
> sudo su<br>
> mysql mythconverg <freeview-icons.sql<br>
><br>
> Then you can look at the freeview_icons table to see if you think it<br>
> is ok:<br>
><br>
> select * from freeview_icons;<br>
><br>
> If that is good, you can then do the icon updates. First display the<br>
> current icons:<br>
><br>
> select channum,callsign,icon from channel where sourceid=1 order by<br>
> channum+0;<br>
><br>
> You will need to change the "sourceid=1" in this and subsequent SQL<br>
> commands to the correct sourceid number for your database.<br>
><br>
> Now do the update:<br>
><br>
> update channel c set icon=(select icon from freeview_icons f where<br>
> c.channum=f.channum) where sourceid=1 and (select count(*) from<br>
> freeview_icons f where c.channum=f.channum)!=0;<br>
><br>
> Check the icons by displaying them again:<br>
><br>
> select channum,callsign,icon from channel where sourceid=1 order by<br>
> channum+0;<br>
><br>
> Then tidy up and exit:<br>
><br>
> drop table freeview_icons;<br>
> quit<br>
> exit<br>
><br>
> Now check the icons that show in mythfrontend in the Guide. If you<br>
> are unhappy with the result restore your channel table as above.<br>
><br>
> _______________________________________________<br>
> mythtvnz mailing list<br>
> <a href="mailto:mythtvnz@lists.ourshack.com" target="_blank" rel="noreferrer">mythtvnz@lists.ourshack.com</a><br>
> <a href="https://lists.ourshack.com/mailman/listinfo/mythtvnz" rel="noreferrer noreferrer" target="_blank">https://lists.ourshack.com/mailman/listinfo/mythtvnz</a><br>
> Archives <a href="http://www.gossamer-threads.com/lists/mythtv/mythtvnz/" rel="noreferrer noreferrer" target="_blank">http://www.gossamer-threads.com/lists/mythtv/mythtvnz/</a><br>
<br>
_______________________________________________<br>
mythtvnz mailing list<br>
<a href="mailto:mythtvnz@lists.ourshack.com" target="_blank" rel="noreferrer">mythtvnz@lists.ourshack.com</a><br>
<a href="https://lists.ourshack.com/mailman/listinfo/mythtvnz" rel="noreferrer noreferrer" target="_blank">https://lists.ourshack.com/mailman/listinfo/mythtvnz</a><br>
Archives <a href="http://www.gossamer-threads.com/lists/mythtv/mythtvnz/" rel="noreferrer noreferrer" target="_blank">http://www.gossamer-threads.com/lists/mythtv/mythtvnz/</a><br>
</blockquote></div>