Tools and other software Episodes2TVGuide (E2T) - Customizing tvguide.xml (2 Viewers)

Lehmden

Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,553
    3,934
    Lehmden
    Home Country
    Germany Germany
    Hi.
    I like to introduce a little tool named Episodes2TVGuide (short E2T) written by @lightshock to enrich any xmltv compatible tvguide.xml with data from http://www.thetvdb.com/ This includes season and episodes numbers for every series that is listed on tvdb. And the user can use the tvdb descriptions instead of the ones delivered by the data grabber (like WebGrab++ or mc2xml or similar).
    There are similar tools out there but they all are manipulating the database of the TV engine after the data was imported. So for every engine, every type of database there is a need for a special program. E2T is different as it enriched the tvguide.xml before it is imported into the TV server database. For this it is independent of the used TV engine and is working with MP1, MP2/TVE3.0, MP2/TVE3.5, ArgusTV, TVHeadend,...

    E2T is searching the whole tvguide.xml for series that can be matched on TVDB. If there is a match it download the metadata for this series from tvdb and stores it locally on disk. If you are using MP2 the MP2 cache can be used too, as MP2 is caching exactly the same data used in E2T. This will limit the data- download as much as possible. After first run there is a file called "Episodes2TVGuide.ID.xml" created in the working directory. This contains all previous matches and can be edited to help matching more series. A sample entry is looking like this:
    XML:
      <CCacheSerie>
        <Id>79167</Id>
        <NameTvGuide>Bob Ross - The Joy of Painting</NameTvGuide>
        <NameTvdb>The Joy of Painting</NameTvdb>
        <Added>2016-01-20T15:42:11.7293957+01:00</Added>
      </CCacheSerie>
    ID contains the TVDB- ID, NameTvGuide is the series name used in the EPG data and NameTvdb is the name used on TVDB for this series. Added is for cleaning purposes. If a series is not scanned for a longer time this entry will be removed to limit the file size...
    If a series is not matched automatically it is listed this way:
    XML:
      <CCacheSerie>
        <Id>0</Id>
        <NameTvGuide>I, Robot</NameTvGuide>
        <NameTvdb />
        <Added>2016-02-29T10:02:08.9850486+01:00</Added>
      </CCacheSerie>
    If you add the ID and NameTvdb manually then E2T is finding the series properly on next run.

    E2T is a command- line tool that takes two options --input and --output. --input sets the path to the tvguide.xml delivered from you preferred grabber tool and --output set the path of the resulting tvguide.xml, that should be imported into the TV server database by XMLTV- Plugin...

    As example I'm calling E2T in the same batch that runs WebGrab++ with this parameters:
    Code:
    cd "C:\WebGrab"
    "C:\WebGrab\Episodes2TVGuide.exe" --input:"C:\ProgramData\ServerCare\WebGrab\guide.xml" --output:"C:\WebGrab\tvguide.xml"
    and I'm pointing the XMLTV plugin to look for new data in C:\WebGrab\.
    The complete batch that is run daily from Windows Task Planer is like this:
    Code:
    c:
    cd "C:\ProgramData\ServerCare\WebGrab"
    "C:\Program Files (x86)\ServerCare\WebGrab+PlusV1.1.1\WebGrab+Plus.exe"
    cd "C:\WebGrab"
    "C:\WebGrab\Episodes2TVGuide.exe" --input:"C:\ProgramData\ServerCare\WebGrab\guide.xml" --output:"C:\WebGrab\tvguide.xml"
    It first runs WebGrab++ and, after the data grabbing is finished E2T is working on the guide.xml and saves the final tvguide.xml in a different folder. So for this XMLTV plugin only notice the final data and did not start importing unfinished xml files... Don't forget to "cd" into the folder where the E2T exe is laying. Without this it is not working properly. And you also need to copy the xmltv.dtd file into your folder(s)...

    Aside the command line switches there is a settings file "Episodes2TVGuide.xml" Here the user can change the options of E2T... This file will be created on first run of E2T, so you once need to start E2T before you can configure it.
    The most important option is "TVDB_Language", the language to search the TVDB. As the author is German here "de" is set as default. You need to change it to "en", "fr" "es, "it" "ru" or whatever language you prefer...
    Then there is a block of tags defining separate chars that are used in your EPG data to separate Series from Episodes titles. Normally this is something like "-" or ":" or similar... What exactly you need to add here depends on your data source...
    Other blocks are for ignoring fields as they are not used inside MP EPG at all, replacing or ignoring strings in the data and the path to your MP2 server installation (if you are using MP2 you can save download time and bandwidth by re-using the MP2 data cache but of course E2T is working flawlessly without MP2). And there are two "TVDB_Overwrite" tags. One for the plot and one for series/episodes name. If one or both of them are set to "true" the series name/episodes name or description in the EPG data is replaced by the corresponding data from TVDB. This only affects filled fields in the raw EPG data. Empty fields are always filled with data from TVDB. So if your EPG data did not have any episodes description this will be added from TVDB, no matter what you have configured here. You can "force overwrite" those fields by using this options...

    By the way, E2T needs .NET4.5 (so it can not run on Windows XP or earlier) but can be used on Linux and Mac with Mono (without any re-compiling)... If you run a Linux Server you're be able to run WebGrab and E2T on it and simply download the finished tvguide.xml from your server into XMLTV plugin...

    The recent version is 0.16.73 and it is attached here.

    Most likely newer versions are first to find in the German forum before they are added here:
    https://forum.team-mediaportal.com/threads/episodes2tvguide-e2t-anpassen-der-tvguide-xml.133534/

    Maybe we can add this tool to the repository later...
     

    Attachments

    • Episodes2TVGuide_0.15.51.zip
      15.4 KB
    • Episodes2TVGuide_0.16.71.zip
      15.2 KB
    • Episodes2TVGuide_0.16.73.zip
      15.5 KB
    Last edited:

    breese

    Retired Team Member
  • Premium Supporter
  • July 11, 2011
    3,902
    770
    65
    Arlington Heights, Illinois
    Home Country
    United States of America United States of America
    I am using the zap2xml for getting channel info.
    I have it running from F:\TVGuide without any issues.

    I added Episodes2TVGuide.exe to the folder and ran it from a command prompt
    it creates a Episodes2TVGuide.ID.xml and a Episodes2TVGuide.xml
    In the second file, it set the language correctly for me, being English
    <TVDB_Language>en</TVDB_Language>

    Also when I ran the application the first time, it thru an error
    upload_2016-3-2_5-38-29.png


    Now to figure out how to use this so as to get better Series info and not kill my TVGuide info.....
     

    Attachments

    • Episodes2TVGuide.ID.xml
      144 bytes

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,553
    3,934
    Lehmden
    Home Country
    Germany Germany
    Hi.
    Thanks for testing. Sadly I can't help with this specific error as it is related to the program code. To me 21.02.2016 is a valid date (here in Germany we are writing Day.Month.Year). So @lightshock needs to have a look at this. Just in case, is it possible for you to upload your tvguide.xml? I don't know, but I can imagine there are some differences between zap2it and WebGrab tvguide.xml files that are causing this error. If this is true, I'm pretty sure Lightshock needs a sample of a zap2it tvguide.xml to fix this. I think this can be done by PN if you don't want to add your tvguide.xml in public.....

    not kill my TVGuide info
    This will not happen as E2T is creating a different TVGuide without destroying (or even touching) the original one...
     

    breese

    Retired Team Member
  • Premium Supporter
  • July 11, 2011
    3,902
    770
    65
    Arlington Heights, Illinois
    Home Country
    United States of America United States of America
    When I ran it the first time, I did not add any commands to the command line, I just ran the application.
    The zap2xml is run from the TV Plugin xmltv
    Here is my current TVGuide.xml
     

    lightshock

    Test Group
  • Team MediaPortal
  • June 3, 2008
    552
    128
    bei Karlsruhe
    Home Country
    Germany Germany
    Hi,
    I think there is a problem with the conversion of the creation date of the exe file.
    Can you please try the attached file?

    You have to run the exe with the following arguments:
    Code:
    Episodes2TVGuide.exe --input:"f:\tvguide\tvguide.xml" --output:"f:\tvguide\tvguide-new.xml"

    If you do not add the argument "--output", a backup of the inputfile will be created.
     

    lightshock

    Test Group
  • Team MediaPortal
  • June 3, 2008
    552
    128
    bei Karlsruhe
    Home Country
    Germany Germany
    That's great :)
    I'll do some translations.

    There is a problem with your sourcepath. you typed it with a semicolon instead of a colon.
    The xmltv.dtd file must be in the same folder as the inputfile
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,553
    3,934
    Lehmden
    Home Country
    Germany Germany
    I'll translate for you:
    "The file xmltv.dtd could not be found"...

    As I wrote here:
    And you also need to copy the xmltv.dtd file into your folder(s)...
    You need to have the xmltv.dtd file next to your tvguide.xml.
    If you don't have one it can be found here:
    c:\ProgramData\Team MediaPortal\MP2-Server\SlimTVCore\v3.0\xmltv\

    Edit
    Ok, now I see the issue... F;\ is no valid path...
     

    breese

    Retired Team Member
  • Premium Supporter
  • July 11, 2011
    3,902
    770
    65
    Arlington Heights, Illinois
    Home Country
    United States of America United States of America
    Well the other one finally finished and created my new file....
    I will download this new one But I would like to recommend a switch for logging...
    Time Start, Time Finished, etc...
     

    Users who are viewing this thread

    Top Bottom