MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Main Features (talk, share your ideas, get support) » Electronic Program Guide » xmlTV


xmlTV everything related to xmlTV in here

Reply
 
Thread Tools Display Modes
Old 2007-03-09, 12:19   #1 (permalink)
Portal Developer
 
gibman's Avatar
 
Join Date: Oct 2006
Location: Aarhus
Posts: 680
Thanks: 4
Thanked 58 Times in 45 Posts

Country:

My System

Default XMLtv Channel tag Replacer Python script.

What a sucky subject tagline I know hehe.

I have attached a python script that helps me replace user-defined tags within the tvguide.xml file with my own.

ex. I want to change all the occurences of channel="TV2.dr.dk" to
channel="TV2".

...
<programme channel="TV2" start="20070303181000 +0100">
...

Why do I want this ? In order to have MP map the XMLTV epg data to the right channel, the "channel" XML tag needs to have the same name/value as the associated channelname within MP. So they need to match each other.

Often you can configure the .config files of the perl/python XMLtv grabber scripts to change the channelnames to your needs.
But in my case this is not possible.
I use multiple tv grabbers.
This is a way for me to have the channel name mapping configuration defined in one file.

The python script can in theory do search/replace on all kinds of files.
It is not limited to XML files in any way.

U need to DL python for windoze.
http://www.python.org/

run the replace.py file.
config is replacevalues.py (edit it)

ex.
'channel="hallmark.dr1.dk"' : 'channel="Hallmark"',

The parser will look for all occurences of channel="hallmark.dr1.dk" and replace them all with channel="Hallmark"

It is possible to do a "python to exe" thing, for those who are lazy.
Although the replacevalues.py should be changed to a replacevalues.config file, otherwise it will be compiled into the final EXE.


/Gibman
gibman is offline   Reply With Quote
This User Say Thank You:
Old 2007-09-04, 18:55   #2 (permalink)
Portal Member
 
mayankel's Avatar
 
Join Date: Jan 2006
Posts: 13
Thanks: 3
Thanked 0 Times in 0 Posts

Country:

My System

Default

Great job, gibman...

I've tried today and it works perfect for me, but i have one question:

I want to replace every <sub-title>year</sub-title> to <date>year</date>, where "year" is a number, usually betwen 1950-2007, so i can make 57 translation, (i.e. <sub-title>1951</sub-title> to <date>1951</date>...) and i'm sure it works, but could i use any "*" or somethig to make: <sub-title>1***</sub-title> to <date>1***</date>.

Thanks and best regards
mayankel is offline   Reply With Quote
Reply

Bookmarks

Tags
channel, python, replacer, script, tag, xmltv

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Channel name and XMLTV information are not updated in MyTV cedric pre 1.0 RC1 0 2006-12-16 19:01
NEW PLUGIN - for XMLTV channel names opusnut Plugins 5 2006-05-17 15:37
NEW PLUGIN for XMLTV channel names opusnut Plugins 4 2006-05-14 20:21
XMLTV Channel Logos Khris WebEPG 6 2006-02-18 17:25
Script for Palmbutler HTPC-Fan Tips and Tricks 8 2005-04-15 23:58


All times are GMT +1. The time now is 07:01.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress