mc2xml and Episode Numbers

Discussion in 'Electronic Program Guide' started by david_31262, September 19, 2017.

  1. david_31262

    david_31262 Portal Member

    Joined:
    September 21, 2015
    Messages:
    11
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United States of America United States of America
    (Media Portal 1.17)
    I've been using mc2xml to get guide data from the "new" Microsoft servers. It generally works, but will go down occasionally. Considering that Media Center has been removed from Windows 10 I've been working on a switch to SchedulesDirect.



    I'm still using mc2xml to pull data from SchedulesDirect. I haven't tried the schedules direct plug-in, but from reading I prefer mc2xml because it's using the newer schedulesdirect JSON database and also has the ability to flag new programs with an " *" in the title to allow for recording new episodes only. Plus, I didn't have to recreate my scheduled events.

    I've been experimenting to figure out why episode numbers are not showing up, and poking around tvguide.xml it seems like xmltv doesn't like that mc2xml is putting two "episode-num" lines in the database (example below). If I remove the line with "<episode-num system="dd_progid">EP02695634.0003</episode-num>" then the episodes numbers display in the Media Portal GUI.

    Is this an error on mc2xml, or should xmltv be smart enough to ignore the "episode-num" line it doesn't care about ?

    Note: I also tried reversing the order of the two "episode-num" lines, but it didn't help.

    =================================================
    Program example from tvguide.xml:

    <programme start="20170921200100 -0600" stop="20170921210000 -0600" channel="I21.1.34801.schedulesdirect.org">
    <title lang="en">The Orville *</title>
    <sub-title lang="en">About a Girl</sub-title>
    <desc lang="en">The Orville travels to Bortus' planet; the crew debates controversial surgeries for newborns.</desc>
    <credits>
    <actor>Seth MacFarlane</actor>
    <actor>Adrianne Palicki</actor>
    <actor>Penny Johnson Jerald</actor>
    <actor>Scott Grimes</actor>
    <actor>Peter Macon</actor>
    <actor>Halston Sage</actor>
    <actor>J. Lee</actor>
    <actor>Mark Jackson</actor>
    <actor>Chad L. Coleman</actor>
    <producer>Seth MacFarlane</producer>
    <producer>Brannon Braga</producer>
    <producer>David A. Goodman</producer>
    <producer>Jason Clark</producer>
    <producer>Liz Heldens</producer>
    <guest>Norm Macdonald</guest>
    <guest>Lamont Thompson</guest>
    <guest>DeObia Oparei</guest>
    <guest>Antonio Charity</guest>
    <guest>Rena Owen</guest>
    <guest>Jonathan Adams</guest>
    <guest>D. Elliot Woods</guest>
    </credits>
    <date>20170921</date>
    <category lang="en">Comedy drama</category>
    <category lang="en">Science fiction</category>
    <episode-num system="dd_progid">EP02695634.0003</episode-num>
    <episode-num system="xmltv_ns">0.2.</episode-num>
    <video>
    <aspect>16:9</aspect>
    <quality>HDTV</quality>
    </video>
    <audio>
    <stereo>dolby digital</stereo>
    </audio>
    <new />
    <subtitles type="teletext" />
    <rating system="Canadian Parental Rating">
    <value>14+</value>
    </rating>
    <rating system="USA Parental Rating">
    <value>TV14</value>
    </rating>
    </programme>
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Hello

    Please read the posts here:
    UK: Atlas shutting down Radio Times feed from June 16 & also stopping free access to MetaBroadcast
    XMLTV Idiot's guide please....hoping there is one!!

    Technically no.

    Unfortunately TV Server's XMLTV plugin is not that smart.

    Facts are:
    • TV Server's XMLTV plugin only takes the first episode-num element.
    • TV Server's XMLTV plugin doesn't support the dd_progid episode number system for reasons explained in the second link above.
    Therefore the season/episode numbers for the program that you gave as an example will not be imported, as you've noticed.

    Potential solutions:
    • remove all dd_progid lines; TV Server can't use them so there's no harm in getting rid of 'em
    • switch the order of the dd_progid and xmltv_ns lines
    ...which brings me to:

    That should have worked! (y)

    Therefore I suspect you may have missed something else.

    Make sure you:
    • switched the order of a program that:
      • shows in the future (the XMLTV plugin doesn't import past program details)
      • is associated with a mapped channel (ie. a guide channel which is associated with a TV Server tunable/visible-in-guide channel)
    • after making the change:
      • saved and re-imported the XMLTV file
      • waited for the import to complete (can take several minutes; the more channels you have, the longer it takes)

    Also, very important: how are you determining whether season/episode numbers are imported successfully?
     
  4. david_31262

    david_31262 Portal Member

    Joined:
    September 21, 2015
    Messages:
    11
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United States of America United States of America
    Thanks for the comments.

    I have the media portal GUI configured to display the Episode Title and Number in the guide. So, I:
    1) stopped the TV server
    2) edited tvguide.xml (removing the dd_progid lines)
    3) restarted the TV server
    4) went into the TV server configuration xmltv and force loaded the guide
    5) went into media portal and looked at the TV guide (with the mod I'm seeing the episode numbers in the guide)

    I had initially tried the same experiment with the reverse order of the "episode-nun" entries experiment. I didn't notice any change. Perhaps that was some error on my part. I'll have to try this again.

    I did E-Mail the author of mc2xml (I contributed to him a couple of times). He did respond. He doesn't seem inclined to change something that he doesn't think is his bug.

    I'll play around with it some more. I just mass edited the tvguide.xml (with a quick/dirty emacs macro) and removed all the offending lines. I now have lots of episode numbers showing in the media portal guide. I have a timer setup for tonight and will hopefully now get the episode number as part of the recorded file name.

    I may have to batch up a script to do the edit automatically 5 minutes after the guide update is scheduled to run.
     
  5. dazedcrazy

    dazedcrazy New Member

    Joined:
    January 31, 2016
    Messages:
    2
    Likes Received:
    0
    Ratings:
    +1 / 0
    Home Country:
    Afghanistan Afghanistan
    I just use a powershell script to fix it

    1.ps1
    PHP:
    1. C:\path\to\mc2xml.exe -J USERNAME:PASSWORD -U -u -d 52 -D C:\path\to\first.dat -C C:\path\to\first.chl -R C:\path\to\first.ren -o C:\path\to\firstoutput.xml
    2.ps1
    PHP:
    1. C:\path\to\mc2xml.exe -J USERNAME:PASSWORD -U -u -d 52 -D C:\path\to\second.dat -C C:\path\to\second.chl -R C:\path\to\second.ren -I C:\path\to\firstoutput.xml -o C:\path\to\mergedoutput.xml
    3.ps1
    PHP:
    1. Get-Content C:\path\to\tvguide.xml | Where-Object {$_ -notmatch '>Movie<'} | Where-Object {$_ -notmatch 'dd_progid'} | % { $_ -replace '>football<', '>American Football<' } | % { $_ -replace '>soccer<', '>Football<' } | Set-Content C:\path\to\fixed-tvguide.xml
    4.p1
    PHP:
    1. C:\path\to\WG2MP.exe C:\path\to\fixed-tvguide.xml "C:\ProgramData\Team MediaPortal\MediaPortal TV Server\xmltv\tvguide.xml"
    Have a master.p1 that i run from task scheduler
    PHP:
    1. &"$PSScriptroot\1.ps1"
    2. &"$PSScriptroot\2.ps1"
    3. &"$PSScriptroot\3.ps1"
    4. &"$PSScriptroot\4.ps1"
    So 1.ps1 grabs epg, 2.ps1 grabs epg from somewhere else and merges with 1 to output a single xml, 3.ps1 then removes and replaces stuff, 4.p1 then runs WG2MP.exe to do a final fix on it way to tvserver xmltv folder. Probably over complicated for a simple task but it works. I have moved to xmltv.exe over mc2xml.exe and requires 1 less ps1
     
    • Informative Informative x 1
  6. david_31262

    david_31262 Portal Member

    Joined:
    September 21, 2015
    Messages:
    11
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United States of America United States of America
    Thanks for posting this. I looked at using powershell to rework the mc2xml file, but got turned off by having to modify my powershell user permissions on the PC. I ended up just using a single .bat script which I'll attach below. I've changed my tv guide update daily scheduler to call this bat file under my (admin) users permissions pointing it all to the folder where I do my mc2xml tv stuff.

    When I have a few minutes I'll look over your powershell version for my own edification. I realize it's a much more powerful tool. You're also pulling guide info from multiple sources which is cool (but not something I need at this time).

    I'm also still considering reporting a bug on xmltv. It seems like is should be smart enough to ignore the extra episode-num lines.

    My .bat file:
    Code (Text):
    1.  
    2. mc2xml.exe -J USERNAME:PASSWORD -o tvguide_raw.xml -d 360 -a
    3. findstr /V "dd_progid" tvguide_raw.xml > tvguide_epfixed.xml
    4. del tvguide.xml
    5. ren tvguide_epfixed.xml tvguide.xml
    6.  
     
  7. dazedcrazy

    dazedcrazy New Member

    Joined:
    January 31, 2016
    Messages:
    2
    Likes Received:
    0
    Ratings:
    +1 / 0
    Home Country:
    Afghanistan Afghanistan
    If you use xmltv.exe instead of mc2xml.exe it puts the <episode-num system="xmltv_ns"> first so it's read first and you'll see season/episode in mediaportal
    Similar to above i use powershell for this too
    1.ps1
    PHP:
    1. C:\xmltv\xmltv.exe tv_grab_zz_sdjson --days 3 --output C:\xmltv\guide.xml
    2.ps1, removing <episode-num system="dd_progid"> isn't needed but i do it anyway
    PHP:
    1. Get-Content C:\xmltv\guide.xml | Where-Object {$_ -notmatch 'dd_progid'} | % { $_ -replace '>football<', '>American Football<' } | % { $_ -replace '>soccer<', '>Football<' } | Set-Content C:\xmltv\fixed-guide.xml
    3.ps1
    PHP:
    1. C:\xmltv\WG2MP.exe C:\xmltv\fixed-guide.xml "C:\ProgramData\Team MediaPortal\MediaPortal TV Server\xmltv\tvguide.xml"
     
  8. Philip Churchill

    Philip Churchill Portal Member

    Joined:
    August 2, 2012
    Messages:
    17
    Likes Received:
    0
    Gender:
    Male
    Ratings:
    +0 / 0
    Home Country:
    United Kingdom United Kingdom
    could you explain how do set this up please also where and what is your tv guide update daily scheduler and do you use task scheduler for the bat file?
     
  9. wjw

    wjw Portal Pro

    Joined:
    July 13, 2008
    Messages:
    322
    Likes Received:
    20
    Ratings:
    +34 / 0
    Home Country:
    United Kingdom United Kingdom
    This has been covered elsewhere and MM1352000 gave you some pointers to follow. It's not a bug in xmltv. However, if you're still struggling - as I did - here is my .bat file to get the daily grab and modify it to remove the problem line:

    cd C:\Users\john\Desktop\XMLTVstuff
    C:\Users\john\Desktop\XMLTVstuff\mc2xml
    C:\Users\john\Desktop\XMLTVstuff\XMLTV\xmltv-0.5.68-win32\SED "/"dd_progid"/d" C:\Users\john\Desktop\XMLTVstuff\xmltv.xml > C:\Users\john\Desktop\XMLTVstuff\tvguide.xml

    Use Task Scheduler to run this daily at whatever time you want.

    Obviously you will need to change all the locations to your own and you will need to download the SED software into your chosen location.

    Hope this helps.
     
  10. Anthony Gagnon
    • Premium Supporter

    Anthony Gagnon MP Donator

    Joined:
    March 11, 2016
    Messages:
    22
    Likes Received:
    2
    Ratings:
    +9 / 0
    Home Country:
    United States of America United States of America
    Should this forum post be marked as Solved?
    Is there any downside with removing lines with "dd_progid" from the tvguide.xml file in MP1?
    It seems the discussion implies they are ignored.
     
    Last edited: June 25, 2018
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!