You are here

Postprocessing with SED

4 posts / 0 new
Last post
halikus
Offline
Donator
Joined: 8 years
Last seen: 2 days
Postprocessing with SED

Hi all.  Fisrt of all Webgrab is a great program, thank you.  I use it in conjunction with a few things to produce xmls and everything works great and as it should.  My problem lies within my front end that i use, Kodi.  Long story short is it displays the title and description but not the sub-title.  It's not the end of the world but the sub-title tag often has important information (especially in the case of sports) so i was looking into what workarounds and hacks i could incorporate to make the sub-title visible.  The method i'm most comfortable with is SED using the example on your home page.  I'm using a Windows 10 OS as base and run everything via a bat file and am at the point i need one single line of code to complete my goal.  I have 2 questions :

1:  In sed.txt when i try and add sports team names to the title it works, but only the last line in the sed.txt is applied.  Is this normal, or should i run the program 3 times with 3 different sed.txt variations if i had 3 lines i wanted to use?

I currently have :

:a;N;$!ba;s/\(<programme[^<]*\)\(<t[^>]*>\)\(NBA Basketball*[^<]*\)\(<[^<]*\)\(<sub-title[^>]*>\)\([^<]*\)[^<\/programme]*/\1\2\3: \6\4\5\6/g
:a;N;$!ba;s/\(<programme[^<]*\)\(<t[^>]*>\)\(MLB Baseball*[^<]*\)\(<[^<]*\)\(<sub-title[^>]*>\)\([^<]*\)[^<\/programme]*/\1\2\3: \6\4\5\6/g
:a;N;$!ba;s/\(<programme[^<]*\)\(<t[^>]*>\)\(NHL Hockey*[^<]*\)\(<[^<]*\)\(<sub-title[^>]*>\)\([^<]*\)[^<\/programme]*/\1\2\3: \6\4\5\6/g

 

2: This is the part i really, really need.  Can someone provied a SED example (outright spoonfeed me please) of how to merge the <sub-title> into the beginning of the description instead of the end of the title.  I feel it should be easy but anytime i try to modify one of the above examples nothing happens and i realise i'm out of my league.  The best i could logically come up with is...

:a;N;$!ba;s/\(<programme[^<]*\)\(<s[^>]*>\)\(*[^<]*\)\(<[^<]*\)\(<desc[^>]*>\)\([^<]*\)[^<\/programme]*/\1\2\3: \6\4\5\6/g

halikus
Offline
Donator
Joined: 8 years
Last seen: 2 days

Thanks, i wasn't really aware of the mdb options.  I do use 3 or 4 different apps to grab listings from about 10 different sources and them merge them depending on wich member of the family is using the end result.  This will remedy the webgrab sources content but i will still have to use SED to overcome the shortcomings of the other apps.  I found a solution for post processing with an lua module but it strips the icon from programme.  If i simply rename text i run into the hurdle that not all programmes have a sub-title thus breaking the xml.

francis
Offline
francis's picture
Has donated long time agoWG++ Team member
Joined: 12 years
Last seen: 1 week
Is the support helpful?
support us

With WG++, you can also import existing xmltv files. Like files coming from other grabbers. And then you can use the mdb/rex functionality for WG++. And WG++ supports the icon from the programme, so you should be fine.

So you could run 2 setups:

1 config file containing WG++ channels (and configure run + any post processor)

1 config file (in another folder) containing the channels from the other sources (and configure only post processor(s))

To run multiple config files see (http://www.webgrabplus.com/faq#faq_816)

Then you could use the both separately generated xmltv results. (or you could even merge them together)

 

And are there specific reasons that you are using other grabbers/sources. Maybe this is a missing functionality in WG++ and could be added. If you must run a ton of programs to get your xmltv, this makes things only complicated.

halikus
Offline
Donator
Joined: 8 years
Last seen: 2 days

Thanks, after alot of tinkering i managed to accomplish my goal with this in REG

<desc>{'subtitle'\n}'description'\n\n{Episode: 'episode'      }{Date: 'productiondate'.\n}{Category: 'category(, )'.\n}{Director: 'director(, )'  }{Actors: 'actor(, )'\n}{Ratings: 'rating(, )'.}</desc>

The reason i use so many grabbers is because i primarily need Canada and USA listings and find zap2it has what i need.  For the UK i use many sources because of limitations such as programme icons, EPG duration (i need a minimum 10 days), and channel availability.

As you can see from the picture i use non standard channel order with a mix of countries too.

http://tinypic.com/r/xn9jly/9

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