Skip to content

mikhoul/XMLTV-EPG-Tools

 
 

Repository files navigation

📺 XMLTV EPG Merger & Time Shifter

Python License XMLTV

All-in-one toolkit to merge multiple XMLTV Electronic Program Guide (EPG) sources and optionally time-shift selected channels – delivered in a single, self-contained README for easy download.


🎯 Key Features

🔀 XML Merger (main focus)

  1. Multi-source aggregation – Combine any number of XMLTV or GZIP-compressed EPG feeds
  2. Smart caching – Locally stores downloads and only refreshes when stale
  3. Duplicate handling – Removes duplicate channels and colliding programmes automatically
  4. YAML driven – Just list your feeds in xmlmerge.yaml, run, and relax
  5. Collision-safe merging – Prevents overlapping programme duplicates using start-time comparison
  6. Compressed output – Writes merged.xml.gz by default to save space

⏰ Time Shifter (utility)

Simply shift programme start/stop times east (−) or west (+) and optionally rename / re-ID channels – ideal for cross-timezone EPGs.


🚀 Quick Start

pip install lxml requests pyyaml             # ① Install deps
python xmlmerge.py                           # ② Merge feeds ➜ output/merged.xml.gz
python timeshift.py                          # ③ (Optional) Time-shift select channels ➜ cache/shift.xml

🛠️ Configuration

xmlmerge.yaml

files:
  - https://i.mjh.nz/PlutoTV/fr.xml.gz
  - https://i.mjh.nz/Plex/fr.xml.gz
  - https://i.mjh.nz/SamsungTVPlus/fr.xml.gz
  - https://epgshare01.online/epgshare01/epg_ripper_RAKUTEN_FR1.xml.gz
  - https://epgshare01.online/epgshare01/epg_ripper_CA1.xml.gz

timeshift.yaml

channels:
  "input_file.xml":
    - ["🇫🇷 TF1 décalé", "tf1.fr",  "tf1.fr.shifted",  1]   # +1 h west ➜ CET → GMT
    - ["🇨🇦 CBC décalé", "cbc.ca",  "cbc.ca.shifted", -3]   # −3 h east ➜ PT → ET

🧩 Directory Layout

.
├─ xmlmerge.py        # ⇣ main merger logic
├─ timeshift.py       # ⇣ optional time-shift helper
├─ xmlmerge.yaml      # ⇢ list of source feeds
├─ timeshift.yaml     # ⇢ channel / shift map
├─ cache/             # ⇣ downloaded & shifted XMLs
└─ output/            # ⇣ final merged EPG

🏁 License

Released under the MIT License – free for personal & commercial use.


Made with ❤️ • Enjoy your unified EPG!

About

XMLTV EPG Merger & Time Shifter

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%