You are here

Best approach to create XMLTVs with different past days

4 posts / 0 new
Last post
Sperafico
Offline
Donator
Joined: 4 years
Last seen: 1 month
Best approach to create XMLTVs with different past days

Hello,

I would like to get advice from assiduous users on how to do the following task.

Currently I have an XMLTV with 15 days past. I would like to recreate 2 other XMLTVs starting from this one with 7 days past and no days past.
The goal is to reduce the size of the XMLTV when it is not needed depending on the provider.

What do you think would be the best approach to do that?

Should I recreate 2 configuration files based on the XMLTV of 15 days past and define the number of days past in each configuration file?
This solution doesn't seem really flexible because each time the configuration file of the original XMLTV is modified it will also have to be modified for the 2 others.

Isn't there an existing tool or script (I use WebGrab+ on Centos 7.9) to easily remove days past from an XMLTV?

Thank you in advance for your ideas, advices and suggestions.

++

mat8861
Offline
WG++ Team memberDonator
Joined: 9 years
Last seen: 10 hours

i think you can merge the 15days_past+new and set in config 7days past. You could also use sed...

Sperafico
Offline
Donator
Joined: 4 years
Last seen: 1 month

Yes, I finally opted for an ugly but working alternative with SED.

If some people are interested, here is an example of commands to recreate a guide with past days at 3 instead of 15.

for d in {4..15};do days+=("$(date -d"-$d days" +%Y%m%d)");done
sed -e '/<\programme.*>/{:a;N;/<\/programme.*>/!ba;/'$(echo ${days[@]} | sed "s/ /\\\|/g")'/d}' guide-15dayspast.xml > guide-3dayspast.xml

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 7 hours

you can do this using webgrab.

as you suggested copy your configuration files for your 15 day epg and rename the folders.example...

webgrab_0days
webgrab_7days

inside each of these folders you will need..
a copy of your webgrab++.config.xml and 15 day guide.xml
webgrab.exe and all associated .dll files
copy of all ini's that your webgrab++.config.xml uses.

edit each webgrab++.config.xml,for keep past 7 days..
<update></update>
<timespan keeppastdays="7" oneshowonly="">0</timespan>

then for all your channel lines change update="i" to update=""

for keep no past days the setting are the same except keeppastdays=""

you will manually have to run webgrab as the folders are not in the default location.
so either using a crond or write a script it can be done with..

/path/to/webgrab.exe /path/to/webgrab++.config.xml

if either of these paths have spaces encase them in qoutes.

NOTE: dont forget to copy you 15 day guide.xml to each of these folders before you run the above command.

at the end each folder will have its own guide.xml,one with no past days and one with 7 days.

your sed solution also look to be a nice solution.

just throwing this out there as a alternative.

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl