home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
Electronic Program Guide
xmlTV
XMLtv Channel tag Replacer Python script.
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="gibman" data-source="post: 133716" data-attributes="member: 25430"><p>What a sucky subject tagline I know hehe.</p><p></p><p>I have attached a python script that helps me replace user-defined tags within the tvguide.xml file with my own.</p><p></p><p>ex. I want to change all the occurences of channel="TV2.dr.dk" to</p><p>channel="TV2".</p><p></p><p>...</p><p><programme channel="TV2" start="20070303181000 +0100"></p><p>...</p><p></p><p>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.</p><p></p><p>Often you can configure the .config files of the perl/python XMLtv grabber scripts to change the channelnames to your needs.</p><p>But in my case this is not possible.</p><p>I use multiple tv grabbers.</p><p>This is a way for me to have the channel name mapping configuration defined in one file.</p><p></p><p>The python script can in theory do search/replace on all kinds of files.</p><p>It is not limited to XML files in any way.</p><p></p><p>U need to DL python for windoze.</p><p><a href="http://www.python.org/" target="_blank">http://www.python.org/</a></p><p></p><p>run the replace.py file.</p><p>config is replacevalues.py (edit it)</p><p></p><p>ex.</p><p> 'channel="hallmark.dr1.dk"' : 'channel="Hallmark"', </p><p></p><p>The parser will look for all occurences of channel="hallmark.dr1.dk" and replace them all with channel="Hallmark"</p><p></p><p>It is possible to do a "python to exe" thing, for those who are lazy.</p><p>Although the replacevalues.py should be changed to a replacevalues.config file, otherwise it will be compiled into the final EXE.</p><p></p><p></p><p>/Gibman</p></blockquote><p></p>
[QUOTE="gibman, post: 133716, member: 25430"] 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. [url]http://www.python.org/[/url] 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 [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Electronic Program Guide
xmlTV
XMLtv Channel tag Replacer Python script.
Contact us
RSS
Top
Bottom