Metabroadcast Atlas Listings Grabber

From MythTV Official Wiki
Revision as of 09:55, 13 September 2015 by Stevegoodey (talk | contribs) (Typos.)

Jump to: navigation, search

Atlas (tv_grab_uk_atlas) is a new service from Metabroadcast, taking over UK listings data from Radio Times (tv_grab_uk_rt). UK users wanting 14 days of detailed listings data will have to move to this service in 2015, or move to EPG data instead.

The process is pretty straightforward if you already have Radio times setup and working. You can also follow these steps if you are moving from EPG data to using XMLTV for the first time.

-Get an API key

Each user of Atlas needs their own API key, this is free and can be done instantly via the Metabroadcast website. Visit http://atlas.metabroadcast.com/

Follow the links and sign in using Google/Twitter/Github

Enter Name/Email/Website (http://www.mythtv.org will do, doesn't matter)

Create a new application, give it a name and URL again.

Add "PA" and "UK Channel Lineups" to your enabled list (I have "PA" at the top) and enable content matching.

Make a note of the API key you are given on this page.

-XMLTV install

We must now ensure our XMLTV version is new enough to include the Atlas grabber. Version 0.5.65 or later (http://www.gossamer-threads.com/lists/mythtv/users/577396#577396) is required.

For Ubuntu users, using the mythbuntu PPA is the easiest way to get up-to-date: https://launchpad.net/~mythbuntu/+archive/ubuntu/xmltv

sudo add-apt-repository ppa:mythbuntu/xmltv sudo apt-get update sudo apt-get upgrade

Or manually downloading as required: http://wiki.xmltv.org/index.php/XMLTVProjectDownload

-Backend Setup Now we can make the required changes in Mythtv backend.

Enter the backend setup, go to "Video Sources" and flick through the list until you find the UK Atlas grabber. As per Radio Times, run through the config and select your region etc, a config file will be created with your channels. Here is where you will also have to add your API key.

To test, you can remove all program data and then run mythfilldatabase, the following mysql will empty program data table:

truncate program;

Now run mythfilldatabase and see if you get program data.

One thing you will have to change if coming from Radio Times listings, is to wherever your mythfilldatabase command runs from, it may well be run as:

mythfilldatabase --allatonce

or similar

Atlas does not support this and should be ran with "--refresh 0-99" instead. Edit this in your backend setup/crontab/etc as required.

-Troubleshooting

You can test things are working by running the following:

tv_grab_uk_atlas --config-file /home/**username**/.xmltv/tv_grab_uk_atlas.conf --hours 1 > grab.log

You can then scan through the output and you should see lots of nice channel data!

For example, during setup, I was getting data on a fairly hit and miss basis, turns out in the end, Atlas were having server issues on the weekend I was doing my setup. But the process went as follows:

Data was missing for random channels, at random times no random days. Ran the above command, looked through the output. This shows all of the API calls being made to the Atlas service, like:

http://atlas.metabroadcast.com/3.0/schedule.json?channel_id=cbbs&from=1419169495&to=1419173095&annotations=extended_description,broadcasts,series_summary,brand_summary,people,channel&publisher=pressassociation.com&apiKey=****APIKEYHERE****

In return, I sporadically got:

{"error":{"message":"An internal server error occurred","error_code":"INTERNAL_ERROR","error_id":"b033a50d-049e-492b-917e-425d51f506bb"}}

Refreshing the API call gave me data back on about one in five refreshes, which turned out to be the server issues. You may however get other good feedback from doing these steps if your having issues

-Mythweb

You will also need to make sure your XMLTV IDs are correctly matched to channels, as per Radio Times grabber. I find this is done best through the Mythweb channel editor.

Use /home/**username**/.xmltv/supplement/tv_grab_uk_atlas/tv_grab_uk_atlas.map.channels.conf

Which has a nice list of channels, regional variants and their IDs.

Add any missing ones, check/un-check "useonairguide" for channels with no ID, re-run mythfilldatabase and check your listing for missing data.

Be aware, that this file lists IDs for multiple platforms, such as Freeview and Virgin. Make sure you get the right one, Channel 5 for example has "fv.plus-24.channel5.com" for "FreeView" and "plus-24.channel5.com" for others.

If you still have channels that now have IDs, but no data downloaded, then check your grabber config file, created when running the Atlas setup in Myth Backend:

/home/**username**/.mythtv/**video source name**.xmltv

Here you will see all of the channels, represented by a four character code:

channel=cbm4 channel=cbcQ channel=cbcR

If one of your channels is not listed here, then add it manually, using the matching codes you will have seen in the supplement file we looked in before. I had to add three missing ones, that the grabber setup process had not, for whatever reason. This could have been fixed since in a newer version.

Next step, if you are still having issues, is to make sure the provided XMLTV ID is actually providing data. We can check this with a manual API call, as follows:

http://atlas.metabroadcast.com/3.0/schedule.json?channel_id=cbYm&from=1419329316&to=1419332916&annotations=extended_description,broadcasts,series_summary,brand_summary,people,channel&publisher=pressassociation.com&apiKey=**API KEY HERE**

Replace the "channel_id" code with the one you wish to test and you should get some data back, quite a lot if it is working and only a few if not, hopefully obvious.

The API call URLs can be found from the output of the command we ran earlier in troubleshooting:

tv_grab_uk_atlas --config-file /home/user/.xmltv/tv_grab_uk_atlas.conf --hours 1 --debug > grab.log

Every channel ID the grabber is getting data for will be shown in this file, so you can do a search on channel or XMLTV ID etc.

Lastly, I also had a few channels with no data from on air/EPG. This seemed to be because they were borderline tunable, so just hid these channels in Mythweb channel editor.

-Support

I found the Atlas support to be very helpful, when I was having issues getting guide data. Do give them a shout if you need help - https://groups.google.com/forum/#!forum/atlasapi