Comparing two category elements
Added by Kick4U 2 over 4 years ago
Hello, I see many threads about converting a category name into an ETSI EN standard name for kodi's EPG. I'm using SchedulesDirect and have standard category inputs and want to take full advantage of the fact that the last category is always 'movie', 'sports', 'series', or 'paid programming'.
I am currently using a windows app (wg++) to find one the movie category and than change the remaining categories to match the ETSI En standard names; however, now that I’ve moved from MCE to TVHeadend on Ubuntu Server, I want ridding myself of many Windows apps and want to try and reduce the number of apps in Ubuntu too (I’m having trouble using wg++ with my merge-xmltv_.ini developed for Windows and would prefer to not use the app if I can accomplish this with a tv_grab script).
Can you help me come up with a script to find something like:
<category>Drama</category>
<category>Horror</category>
<category>Science fiction</category>
<category>Feature Film</category>
<category>movie</category>
and change it to:
<category>movie/drama (general)</category>
<category>Science fiction/Fantasy/Horror</category>
<category>Science fiction/Fantasy/Horror</category>
<category>Feature Film</category>
<category>movie</category>
and than ideally remove duplicates to end up with:
<category>movie/drama (general)</category>
<category>Science fiction/Fantasy/Horror</category>
<category>Feature Film</category>
<category>movie</category>
I’m looking to untouch the Feature Film and movie categories since they are nice haves.
I have most of the categories filtered into the correct "nibble" (see pg 37 from https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.05.01_40/en_300468v010501o.pdf) and will share this with everyone to use with SD-JSON once I figure this last part.
Thanks!