## IPTV XML CLEANER
A tool used to remove unnecessary channels and programs from IPTVBoss's exhaustive Electronic program guide. It uses [xmlstarlet](https://xmlstar.sourceforge.net/) to parse through and select relevant info from CANADA and USA, then gathers the data in a new filtered XML which is exposed for the Ministra service by using a combination of [Lighttpd](https://www.lighttpd.net/) and [Nginx Proxy Manager](https://nginxproxymanager.com/).

### USAGE
IPTV XML Cleaner runs automatically on a fixed schedule and exposes the resulting filtered XML file at [leanepg.targo.ca](leanepg.targo.ca/clean_CANADA_USA.xml).
iptv-xml-cleaner has a docker-compose file that starts it up in tandem with a [targo-lighttpd](https://git.targo.ca/Nicolas/targo_lighttpd) container.

### UPDATING CHANNEL LIST
In order to update the list of channel IDs that must be kept during filtering, you'll need to SSH into `10.100.0.40` and go into the `iptv_xml_cleaner-parser-1` Docker container to directly edit the `/data/xml_tv_ids.txt` file using `nano`. Simply respect the one-channel-ID-per-line format.

### MANUALLY RUN A PARSE
SSH to the host and run `docker exec -it iptv_xml_cleaner-parser-1 "bash /opt/xml_cleaner.sh"`

### PERFORMANCE 
#### Canadian EPG
173 channels and 39067 programmes, down from 739 channels and 129 538 programmes. Time < 10s

#### USA EPG
??? channels and ??? programmes, down from 11 668 channels and 975 691 programmes. Time < 50s