iptv-org / iptv-org.github.io

https://iptv-org.github.io
The Unlicense
372 stars 103 forks source link

Persistent local changes in number of days and channel in-/exclusions #440

Closed HNJAMeindersma closed 1 year ago

HNJAMeindersma commented 1 year ago

Description

Since Actions were removed (https://github.com/orgs/iptv-org/discussions/12#discussioncomment-5219050) from this repository, I've been running my own grabber via a local Git clone, according to the README.md. This works like a charm together with TVheadend. I am in need of running multiple grabber sites due to some sources missing certain channels from a country/region. By using 2 or 3 sites per country/region I manage to get a pretty good EPG coverage of the channels in that country/region. But there is always an overlap between sites for a country/region.

This is where one of my two problems comes in. I run the grabbing process and the loading to xmltv.sock (TVheadend's XMLTV-EPG socket) for each site at different times via cronjobs. I prefer a specific site for a country/region above another because a certain site might have better/richer data. But the other site for that country/region is needed to cover some channels that the first site is lacking. Every time I (or a cronjob) load the /guides/en/example.com.xml to xmltv.sock data of certain overlapping EPG channels is overwritten. Lets say Site X runs and loads every hour at XX:15 and Site Y does that at XX:45. That means that for overlapping EPG channels I have half an hour of EPG info sourced from Site X and half an hour of EPG info sourced from Site Y. Of course I have the ability to comment-out certain channels in the /sites/example.com/example.com.channels.xml, but when I want my local Git copy to update to the latest version my personal changes are likely overwritten. Setting the secondary source site of a country/region to load to xmltv.sock at XX:45 and the primary source site of a country/region to load at XX:46 could be an option, but doesn't seem like the most elegant and reliable option to me.

My second question is in line with the first, but is about /sites/example.com/example.com.config.js. From some sources I want up to 7 days of EPG information. Most /sites/example.com/example.com.config.js-files have the ability to change that. But again: when I want to update my local copy of this Git, personal changes are likely to be overwritten.

So my general question is: is there any way to have some persistent configuration changes that would survive a local Git update? Specifically looking for a way of white- or blacklisting channels in /sites/example.com/example.com.channels.xml and for changes to the number of days grabbed per specific site. Not updating my local version to the latest Git once in a while doesn't seem an option, since sites can change structure or available channels. To keep my system working I would need to roll with these changes. Keeping back a /sites/..-file will only hurt the working of my system.

By the way, I just want to say that I like the fact that the grabber process only writes to /guides/.. after the grab is complete. Due to some security reasons I have to run the grab-process and the loading to xmltv.sock by different OS users and at different times. By only writing to /guides/.. after the grab is completed, I never run into the issue of loading half-done files to xmltv.sock.

HNJAMeindersma commented 1 year ago

Ideally I would be able to use something like this:

# Windows
set SITE=example.com && set DAYS=2 && set WHITELIST=Channel1.us,Channel2.nl,Channel3.de && npm run grab
set SITE=example.com && set DAYS=2 && set BLACKLIST=Channel4.fr,Channel5.us && npm run grab

# Linux/macOS
SITE=example.com DAYS=2 WHITELIST=Channel1.us,Channel2.nl,Channel3.de npm run grab
SITE=example.com DAYS=2 BLACKLIST=Channel4.fr,Channel5.us npm run grab