You are here

Trying to remove a substring from program title

9 posts / 0 new
Last post
chjohans
Offline
Donator
Joined: 12 years
Last seen: 10 months
Trying to remove a substring from program title

For whatever reason, my "EPG provider" now thinks it's a good idea to add the string "(Live)" randomly (sometimes only) to a lot of the shows I have scheduled to record. Here is an example:

  <programme start="20250727210000 +0800" stop="20250727213000 +0800" channel="Channel 5">
    <title lang="en">(Live) News Tonight</title>
    <desc lang="en">The daily evening-news programme featuring highlights and coverage of both local and international news with a local perspective.</desc>
    <icon src="https://prod98.togglestatic.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&amp;Quality=85&amp;ImageId='9094562'&amp;EntityType='LinearSchedule'&amp;EntityId='ab3dc459-259c-48b1-a726-d2e6d4738a27'&amp;Width=1280&amp;Height=720" />
    <rating system="IMDA">
      <value>G</value>
    </rating>
  </programme>

So basically, I want to remove the æstring "(Live)", including any leading or trailing whitespace, from the title of any channel. Since the siteini is encrypted (big shigh!!!), I cannot do it there. So I tried this rex.config.xml:

<?xml version="1.0" encoding="utf-8"?>
<settings>
    <filename>C:\Users\chjo\AppData\Local\WebGrab+Plus\rex\guide.xml</filename>

    <regex-replace
        element="title"
        search="\s*\(Live\)\s*"
        replace-with=""
        case-sensitive="no"
    />

</settings>

That did not work at all. The output log shows that Rex is processing my guide, but no other output than that, and no error messages either. I'm on version 5.3.0.0 under Windows.

How can I achieve what I describe above?

 

The reason I need this is that my backend is doing exact matching of the program title to record, and this breaks when "(Live)" is randomly added to the title.

Blackbear199
Offline
Has donated long time ago
Joined: 10 years
Last seen: 4 months

rex cannot edit element values.

using linux? u could try sed

sed -i 's/(Live) //g' /path/to/guide.xml

 

mat8861
Offline
WG++ Team memberDonator
Joined: 10 years
Last seen: 1 hour

Which site ini is that?

Blackbear199
Offline
Has donated long time ago
Joined: 10 years
Last seen: 4 months

its mewatch.sg

the (Live) wasnt added,its in the title.

 

 

Attachments: 
mat8861
Offline
WG++ Team memberDonator
Joined: 10 years
Last seen: 1 hour

Ok, i was meaning he could do a remove and in case activate the premiere tag

Blackbear199
Offline
Has donated long time ago
Joined: 10 years
Last seen: 4 months

 live and  premiere are not the same thing although many users seem to think so.

the news is on every night and its live,its not a premiere.

first  airing of a movie is a premiere but it insnt live.

a soccer match is a live show but its not a premiere.

 

mat8861
Offline
WG++ Team memberDonator
Joined: 10 years
Last seen: 1 hour

Very truewink

Blackbear199
Offline
Has donated long time ago
Joined: 10 years
Last seen: 4 months

updated ini to remove (Live) from the title,added it to description.

 

chjohans
Offline
Donator
Joined: 12 years
Last seen: 10 months
Blackbear199 wrote:

updated ini to remove (Live) from the title,added it to description.

Thanks, that took care of the issue. It's a bit of a PITA those encrypted INIs, but I do get why it's necessary. Thanks for always helping out in the forum!

The machine that grabs the guide is Windows based, but I can still use sed through Cygwin. I was about to add another small script to be run post-grab by WG+, when I saw your response. Thanks! :)

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