[mythtv-users] Running SD JSON grabber on separate system to MythTV backend

Simon Hobson linux at thehobsons.co.uk
Thu Jun 9 20:41:08 UTC 2016

Yann Lehmann <aristide at free-it.ch> wrote:

> It is possible to download program data in the vm and "import" the generated xml-file on your backend.
> BUT the 'xmltvids' of your setup must match the channel-ids of the tv_grab_sd_json grabber. Those can be edited accordingly in the channel editor, or with the according sql-skills directly in the database.
> The wiki has a specific page for that transition:
> https://www.mythtv.org/wiki/Migrating_to_Schedules_Direct_in_the_UK

Yes, I'm working from that.

I already had a script for setting my channel numbers and XML IDs, so it's been a case of duplicating that and changing to suit. Prompted by a message in here (which I can't find now so can't give credit where it's due), I'm pulling the list of xmltvids from the channel table - so I have  abase config file, use the script to add the "channel=nnnnn" lines for those channels I have which are not hidden, not set to use on-air guide, and have an XMLTV ID of the form of 5 digits. As the message pointed out, it avoids having to maintain the channel list in two places :-)

mysql --host=<host> --user=mythtv --database=mythconverg --password=<password> \
  -e "select xmltvid from channel where visible=1 and useonairguide=0 order by xmltvid ;" |
  grep '[0-9][0-9][0-9][0-9][0-9]' |
  sed -e 's/^/channel=/' >> ${conf}

I could have had the SQL query spit out "channel=nnnnn" but it was quicker to add a sed line than remember the syntax - and it's not like it's run thousands of times a day.

> (thank you to the author of the page, as the content about the tv_grab_sd_json grabber can also be used elsewhere)


More information about the mythtv-users mailing list