Results 1 to 10 of 10

Thread: Mythtv 7 day OpenTV EPG

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    3
    Thanked 32 Times in 11 Posts
    Rep Power
    201
    Reputation
    170

    Default Mythtv 7 day OpenTV EPG

    I got sick of using all the different tv_grab_au scrapers and having them break and/or give bad data.

    I found a grabber which grabs the 7 Day OpenTV EPG from the sat, called tv_grab_dvb_plus.

    Source

    Now it works well but configuring is a major pita, requiring to add xmltvid's for every channel, a very time consuming task.

    So I modified the source to use the service ID for the xmltvid. Then use a script which I modified to set the xmltvid's in the database based on the service ID.

    Ive attached a Zip of the modified source and the script. The script is written in PHP so you will need PHP installed for it to work.

    Linux shell experience required and assumed.

    Steps,

    Extract the tarball

    Code:
    gentoo opentv_epg # ./setxmltvid
    gentoo opentv_epg # cd tv_grab_dvb_plus-0.1/
    gentoo tv_grab_dvb_plus-0.1 # ./configure --prefix=/usr
    gentoo tv_grab_dvb_plus-0.1 # make
    gentoo tv_grab_dvb_plus-0.1 # make install
    setxmltvid will give no output unless there are errors connecting to mysql.

    In Mythfrontend, load the HELP channel, its on the same transponder as the EPG

    Then run tv_grab_dvb_plus, replace adapter with your DVB adapter number.
    You may get some errors but it doesn't affect the resulting xmltv file.

    Code:
    gentoo # tv_grab_dvb_plus --adapter 3 --format skyau --output foxtel.xml
    Before running mythfilldatabase, you will need to find the source id.

    Code:
    gentoo ~ # mysql -u mythtv mythconverg -p
    
    mysql> select * from cardinput;
    +-------------+--------+----------+-----------+-----------------+----------+-----------+------------------+-------------+-------------+-----------+
    | cardinputid | cardid | sourceid | inputname | externalcommand | tunechan | startchan | displayname      | dishnet_eit | recpriority | quicktune |
    +-------------+--------+----------+-----------+-----------------+----------+-----------+------------------+-------------+-------------+-----------+
    |           1 |      1 |        4 | DVBInput  | NULL            | NULL     | 18008     | Foxtel Satellite |           0 |           0 |         0 |
    |           2 |      2 |        4 | DVBInput  |                 |          | 1008      | Foxtel Satellite |           0 |           0 |         0 |
    |           3 |      7 |        4 | DVBInput  |                 |          | 1008      | Foxtel Satellite |           0 |           0 |         0 |
    +-------------+--------+----------+-----------+-----------------+----------+-----------+------------------+-------------+-------------+-----------+
    As you can see above, my source id is 4 for Foxtel.
    Now we can run mythfilldatabase, change the 4 to your source id

    Code:
    gentoo ~ # mythfilldatabase --update --file 4 foxtel.xml
    You should now have a weeks worth of quality guide data.

    Once you do this once you only need to remember 2 commands to get the data and fill the database.

    Ive set up a cron job to do it @ 3am every morning. Ive also setup a manual schedule in mythfrontend to record the help channel from 2:50 to 3:10, so its on the right transponder to grab the guide data.


    Last edited by couchpotato; 20-09-10 at 12:56 AM. Reason: File attachment



Look Here ->
  • #2
    Junior Member
    Join Date
    Oct 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Reputation
    10

    Default

    Hi,

    I am trying to make use of your modifications for the sky epg in the UK. The same opentv/media highway epg is in use however there appear to be some slight changes.

    The tared files from sourceforge that you based your modifications on unfortunately dont produce a propper xmltv file in the UK - for the UK I need to checkout the trunk code - which works great except for the problem you ran into and have fixed here.

    Would it be possible to detail the changes you have made so I can try to port them to the trunk?

  • #3
    Junior Member
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    3
    Thanked 32 Times in 11 Posts
    Rep Power
    201
    Reputation
    170

    Default

    I changed the very last function in chanid.cpp, You should just beable to replace the whole function with whats below. Its a bit of a hack but it works.

    You will probaly also need to modify the mysql script and change foxtel to skyUK and last, in file sky_epg.cpp line 2422, change both subtitle to sub-title otherwise the subtitle will be missing.

    /*
    * Lookup channel id (xmltvid) based on a string lookup
    * For Sky, the string is "sid,skynumber" which is unique
    * If the key is not found then return a manufactured channel id
    */
    const char *skyxmltvid(const char *chanid, const char *provider)
    {
    const char *pch;
    const char str[] = ".";
    char *returnstring;
    FILE *fp;
    /*
    if (use_chanidents && channelid_table) {
    const char *c = slookup(channelid_table, chanid);
    if (c)
    return c;
    }*/
    //asprintf(&returnstring, "%s.%s.dvb.guide", chanid, provider);

    pch = strstr (chanid, str);
    pch++;

    asprintf(&returnstring, "%s.%s.dvb.guide", pch, provider);

    return returnstring;
    }

  • #4
    Junior Member
    Join Date
    Oct 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Reputation
    10

    Default

    Hi,

    Thanks for getting back to me.

    I made the changes as suggested however my make is failing as below:


  • #5
    Junior Member
    Join Date
    Oct 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Reputation
    10

    Default

    I worked it out.

    Using trunk code I made the following change in addition to the one mentioned by the original poster.

    Chanid.cpp changed line 85 to read asprintf(&chanid, "%d", sid);

    The original posters code snippet doesnt work with trunk, however the above change has the same effect.

    Used a slightly modified version of his php script to update my xmltvids (changed foxtel to BSKyB) and we're cooking on gas!

  • #6
    Junior Member
    Join Date
    Jan 2010
    Posts
    65
    Thanks
    9
    Thanked 5 Times in 4 Posts
    Rep Power
    176
    Reputation
    35

    Default

    Hi mate - can you be of any help?? Is it the compilers I'm using or?

    I'm having issues with the code anyway - and c isn't something I deal with unfortunately...

    Code:
    root@x-server:/home/x/opentv_epg/tv_grab_dvb_plus-0.1# make clean
    Making clean in src
    make[1]: Entering directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1/src'
    test -z "tv_grab_dvb_plus" || rm -f tv_grab_dvb_plus
    rm -f *.o
    make[1]: Leaving directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1/src'
    Making clean in libsi
    make[1]: Entering directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1/libsi'
    test -z "libsi.a" || rm -f libsi.a
    rm -f *.o
    make[1]: Leaving directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1/libsi'
    Making clean in .
    make[1]: Entering directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1'
    make[1]: Nothing to be done for `clean-am'.
    make[1]: Leaving directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1'
    root@x-server:/home/x/opentv_epg/tv_grab_dvb_plus-0.1# make
    make  all-recursive
    make[1]: Entering directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1'
    Making all in libsi
    make[2]: Entering directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1/libsi'
    g++ -DHAVE_CONFIG_H -I. -I..  -I../include/libsi   -g -O2 -MT descriptor.o -MD -MP -MF .deps/descriptor.Tpo -c -o descriptor.o descriptor.cpp
    mv -f .deps/descriptor.Tpo .deps/descriptor.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -I../include/libsi   -g -O2 -MT section.o -MD -MP -MF .deps/section.Tpo -c -o section.o section.cpp
    mv -f .deps/section.Tpo .deps/section.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -I../include/libsi   -g -O2 -MT si.o -MD -MP -MF .deps/si.Tpo -c -o si.o si.cpp
    mv -f .deps/si.Tpo .deps/si.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -I../include/libsi   -g -O2 -MT util.o -MD -MP -MF .deps/util.Tpo -c -o util.o util.cpp
    mv -f .deps/util.Tpo .deps/util.Po
    rm -f libsi.a
    ar cru libsi.a descriptor.o section.o si.o util.o 
    ranlib libsi.a
    make[2]: Leaving directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1/libsi'
    Making all in src
    make[2]: Entering directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1/src'
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT chanid.o -MD -MP -MF .deps/chanid.Tpo -c -o chanid.o chanid.cpp
    chanid.cpp: In function ‘const char* dvbxmltvid(int)’:
    chanid.cpp:56: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    chanid.cpp:62: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    chanid.cpp: In function ‘const char* skyxmltvid(const char*, const char*)’:
    chanid.cpp:76: warning: unused variable ‘fp’
    chanid.cpp:88: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    mv -f .deps/chanid.Tpo .deps/chanid.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT dvb_epg.o -MD -MP -MF .deps/dvb_epg.Tpo -c -o dvb_epg.o dvb_epg.cpp
    dvb_epg.cpp: In function ‘void parseEIT(u_char*, size_t)’:
    dvb_epg.cpp:483: warning: deprecated conversion from string constant to ‘char*’
    mv -f .deps/dvb_epg.Tpo .deps/dvb_epg.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT dvb_info.o -MD -MP -MF .deps/dvb_info.Tpo -c -o dvb_info.o dvb_info.cpp
    mv -f .deps/dvb_info.Tpo .deps/dvb_info.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT dvb_text.o -MD -MP -MF .deps/dvb_text.Tpo -c -o dvb_text.o dvb_text.cpp
    mv -f .deps/dvb_text.Tpo .deps/dvb_text.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT filter.o -MD -MP -MF .deps/filter.Tpo -c -o filter.o filter.cpp
    mv -f .deps/filter.Tpo .deps/filter.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT freesat_huffman.o -MD -MP -MF .deps/freesat_huffman.Tpo -c -o freesat_huffman.o freesat_huffman.cpp
    mv -f .deps/freesat_huffman.Tpo .deps/freesat_huffman.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT freesat_tables.o -MD -MP -MF .deps/freesat_tables.Tpo -c -o freesat_tables.o freesat_tables.cpp
    mv -f .deps/freesat_tables.Tpo .deps/freesat_tables.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT freesat_test.o -MD -MP -MF .deps/freesat_test.Tpo -c -o freesat_test.o freesat_test.cpp
    mv -f .deps/freesat_test.Tpo .deps/freesat_test.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT sky_epg.o -MD -MP -MF .deps/sky_epg.Tpo -c -o sky_epg.o sky_epg.cpp
    sky_epg.cpp: In function ‘char* GetStringMJD(int)’:
    sky_epg.cpp:132: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp: In member function ‘bool cTaskLoadepg::ReadFileDictionary()’:
    sky_epg.cpp:678: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp:681: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp:684: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp:726: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp:743: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp: In member function ‘bool cTaskLoadepg::ReadFileThemes()’:
    sky_epg.cpp:830: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp:833: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp:836: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp: In function ‘char* get_channelident(sChannel*)’:
    sky_epg.cpp:928: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp:930: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp:932: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp:933: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp: In member function ‘void cTaskLoadepg::CreateXmlChannels()’:
    sky_epg.cpp:955: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp: In member function ‘void cTaskLoadepg::PollingFilters(int)’:
    sky_epg.cpp:1031: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp: In member function ‘void cTaskLoadepg::SupplementChannelsSKYBOX(int, unsigned char*, int)’:
    sky_epg.cpp:1390: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp:1391: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp: In member function ‘void cTaskLoadepg::CreateEpgXml()’:
    sky_epg.cpp:2342: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp: In constructor ‘EPGGrabber::EPGGrabber()’:
    sky_epg.cpp:2371: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp: In constructor ‘EPGGrabber::EPGGrabber()’:
    sky_epg.cpp:2371: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    sky_epg.cpp: In constructor ‘EPGGrabber::EPGGrabber()’:
    sky_epg.cpp:2371: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    mv -f .deps/sky_epg.Tpo .deps/sky_epg.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT log.o -MD -MP -MF .deps/log.Tpo -c -o log.o log.cpp
    mv -f .deps/log.Tpo .deps/log.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT lookup.o -MD -MP -MF .deps/lookup.Tpo -c -o lookup.o lookup.cpp
    mv -f .deps/lookup.Tpo .deps/lookup.Po
    g++ -DHAVE_CONFIG_H -I. -I..  -Wall -I../include -g   -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
    main.cpp: In function ‘int do_options(int, char**)’:
    main.cpp:261: warning: deprecated conversion from string constant to ‘char*’
    main.cpp: In function ‘int openInput(int)’:
    main.cpp:367: error: ‘fstat’ was not declared in this scope
    main.cpp:371: error: ‘S_ISCHR’ was not declared in this scope
    main.cpp: In function ‘int main(int, char**)’:
    main.cpp:488: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    main.cpp:491: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    main.cpp:494: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    main.cpp:497: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    main.cpp:500: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    main.cpp:504: warning: ignoring return value of ‘int asprintf(char**, const char*, ...)’, declared with attribute warn_unused_result
    make[2]: *** [main.o] Error 1
    make[2]: Leaving directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/x/opentv_epg/tv_grab_dvb_plus-0.1'
    make: *** [all] Error 2
    root@x-server:/home/x/opentv_epg/tv_grab_dvb_plus-0.1#
    There is my output, can you shed any light? I'm running ubuntu 10.10

    Shannon

  • #7
    Junior Member
    Join Date
    Jan 2010
    Posts
    65
    Thanks
    9
    Thanked 5 Times in 4 Posts
    Rep Power
    176
    Reputation
    35

    Default

    Just thought I'd add that I have had the same result on a different machine with x64 hardware - thought it may have been the machine. Still on Ubuntu 10.10

  • #8
    Junior Member
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    3
    Thanked 32 Times in 11 Posts
    Rep Power
    201
    Reputation
    170

    Default

    Not too sure, I use Gentoo with a 4.4.3 gcc

    What gcc version have you got ( gcc -v )

    Did ./configure complain about any missing headers ?

    I will attach a pre-compiled version ( Cant, stupid megaupload is saying an error occurred)

    PM me your email and I will send it to you.

  • The Following User Says Thank You to couchpotato For This Useful Post:

    TehEkHo (07-12-10)

  • #9
    Junior Member
    Join Date
    Nov 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Reputation
    10

    Default

    Is this still the best tool to get Sky Opentv EPG into mythtv ?

    I am trying to get it to work

    Without making any changes to tv_grab_dvb_plus 0.2.1 I can compile it and run it and get a file with all the Sky uk epg.

    When I try to import using mythfilldatabase I get an error saying it can't parse the file.

    Do you know what I need to do ?

  • #10
    Junior Member
    Join Date
    Dec 2013
    Posts
    2
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Reputation
    20

    Default

    For anyone else encountering the same problem as this:

    Quote Originally Posted by sorrowuk View Post
    When I try to import using mythfilldatabase I get an error saying it can't parse the file.
    I encountered the same problem and tracked it down to the channel section of the output file. I've listed below an example of what was being generated when I ran tv_grab_dvb_plus with format 'skyuk':

    Code:
    <channel id="6302.dvb.guide" <!-- number="102" type="0x1" flags="0xf" bouquet="4099" region="f0017bff" sid="6302" -->>
             <display-name>BBC 2 England</display-name>
    </channel>
    The comment within the channel tag was the issue. Unfortunately my c++ skills are nowhere near good enough to find the cause of the problem, but the following sed script resolved it for me:

    Code:
    sed -i 's/ <!-- number.*-->//g' epg.xml
    Really pleased with the grabber - the only issue I have is working out how to get the themes/categories to work, so am slowly trying to navigate through the source code...

    Cheers,
    Chris

  • The Following User Says Thank You to can2002 For This Useful Post:

    Onefella (03-12-13)

  • Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •