Script to grab xmltv from Matt Huisman's site.

This is to get 8 day EPG for all channels for which provide this only over MHEG-5.

Applies minor adjustments to channel names in the epg.xml to match the channel names MythTV populates after scanning for channels.

Also removes channels unavailable on the terrestrial service (can be region dependant).

This is configured for Waikato, but keeping other regions in mind.

You should be able to easily adjust to suit your needs.

Daniel Sheffield 021e8b968c convert here-files to actual patch files to make recreating easier 2 years ago
.gitignore ceb208e457 initial commit 2 years ago
Readme.md 021e8b968c convert here-files to actual patch files to make recreating easier 2 years ago
epg-grab-mjh.sh 021e8b968c convert here-files to actual patch files to make recreating easier 2 years ago
remove.patch 021e8b968c convert here-files to actual patch files to make recreating easier 2 years ago
rename.patch 021e8b968c convert here-files to actual patch files to make recreating easier 2 years ago

Readme.md

Background

Designed for use with New Zealand FreeView.

Assumes you have mythtv set up as per the setup guide

After setting your Channel Frequency Table to New Zealand, you may need to edit the transports to match the data for your region.

See tv headend git repo for the frequencies for your region.

NOTE: I'm not actually sure if this is necessary, but the channel scan I did with mythtv defaults resulted in some channels missing. After deleting all channels, manually adding the transports in Waikato, and running another scan, then all channels were found. However, I noticed that the resulting 5 transports were different to what I configured manually (mythtv will find and delete duplicates). It could just be that the first scan missed some channels for some reason.

Usage

First, check the patches rename.patch and remove.patch are appropriate for your use case.

Then run:

./epg-grab-mjh.sh

Add to your daily crontab.

Thanks Matt Huisman.

See here https://www.matthuisman.nz/2017/07/new-updated-nz-iptv-files.html

Help

To generate the patches, just download the epg.xml from Matt Huisman's site, and

  1. Copy the original xml to epg-modified.xml

  2. Make sure the channel names in epg-modified.xml match the output from mythtv db:

    sudo mysql -u root -p mythconverg -e "SELECT channum,chanid,icon,name,xmltvid,sourceid FROM channel WHERE visible ORDER BY channum+0;"
    
  3. Generate the diff between the original and modified xml, and save as rename.patch:

    diff -u epg.xml epg-modified.xml > rename.patch
    
  4. Apply the rename.patch to the original xml

  5. Remove any channels in epg-modified.xml that mythtv hasn't found, so long as you are sure you can't get from your location

  6. Generate the diff between the the (patched) original xml and the modified xml, and save as remove.patch:

    diff -u epg.xml epg-modified.xml > remove.patch
    

The modifications are split up in the case that some users neeed renames but not removals.