Gracenote --> XMLTV

Recommended Posts

Having become extremely frustrated at Gracenote's deterioration of service and ridiculous increase in price, I developed the following system to download the UK EPG from The xml service is not as slick as Gracenote's but it's free!  This has been working for over a week now.


Applescript to retrieve UK tv 24 hour listings and load it into Can be adapted for other downloads such as the 7 day download.


You must decide what directories to put the Applescript and where working directories will be. See Instruction number 2.


Be aware that periodicly changes the URL to disable old users who have not stopped their automated downloaders that are no longer required


1. Following is the Applescript to run. Copy and paste the lines into the Script Editor application and save it to the directories that you select or created per instruction 2. You can run it manually but there are instructions to have it run daily below.



# Start of Applescript

# Retrieve head of file to test for change of URL.

do shell script "curl --head --silent --output /Users/Your_Username/some_subdirectory/xmlTV/UKtv_24hr.xml"


# Set variable with the retrieved file's path.


set xmlUKtv_24_file to "/Users/Your_Username/some_subdirectory/xmlTV/UKtv_24hr.xml"


# Read first line of file and test for missing file

set firstLine to paragraphs of (read xmlUKtv_24_file before linefeed)

# Send email if file doesn't exist

if ((firstLine as string) is equal to "HTTP/1.1 404 Not Found") then

tell application "Mail"

set my_message to make new outgoing message

set subject of my_message to "xmlTV 24 Hour Download Failed"

set content of my_message to "Not sure why it happened... Check for list number change."

set sender of my_message to ""


tell my_message

make new to recipient at end of to recipients with properties {name:""}

end tell


send my_message

end tell


-- Get the complete file and load into EyeTV

log " Success!!"

# Download the xml file

do shell script "curl --silent --output /Users/Your_Username/some_subdirectory/xmlTV/UKtv_24hr.xml"

# Load it into EyeTV

do shell script "/usr/bin/open -a /Applications/ /Users/Your_Username/some_subdirectory/xmlTV/UKtv_24hr.xml"

log (current date)

end if

# End of Applescript



2. The following is the contents of local.xmlTV_UK_24hr_Dwnld.plist. Copy and paste into a text editor and save to /Users/Your_Username/Library/LaunchAgents/local.xmlTV_UK_24hr_Dwnld.plist. Be sure to save as a plain text file into the directory shown. All other files can be any directory you want. You can change the filename if you like but the file extension MUST BE “.plist



<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">

<plist version="1.0">



<!-- Comment Delimiters -->

<!-- Following contains a unique string that identifies your daemon to launchd. -->


<!-- Run when it first loads. This will also run at boot time. -->






<!-- Location of Applescript to run. -->



<!-- Set the time to run every day. -->








<!-- Working directories for logs and errors. -->











3. The following is the terminal command to launch the above file which will then run every 24 hours at 03:30 which is shortly after the database is updated. Open the Terminal application and copy and paste the following line into it and press “Return”.


launchctl load /Users/Your_Username/Library/LaunchAgents/local.xmlTV_UK_24hr_Dwnld.plist


To stop the service:


launchctl unload local.xmlTV_UK_24hr_Dwnld



Tags:, Elgato, Geniatech, Gracenote,, EPG



Share this post

Link to post
Share on other sites

Be aware!  Gracenote's Program Titles can be different from's.  If you have Smart Guides created with Gracenote, re-create them manually.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.