Using AppleScript and 3rd-Party Software with EyeTV

xmltv file inporting

Postby fogeuk » February 6th, 2009, 4:37 pm

Hi all,
with the tvtv programme guide data sucking so much (UK guide) I wrote a program to create an XMLTV file based on Radio Times' guide data, and it works great, but I have to click and drag the generated file onto EyeTV after each update, is there any way to have EyeTV rescan the file each time EyeTV (v3.1) starts up?

Or maybe an AppleScript command to TELL eyeTV to rescan/reload the xmltv file?
I'm not that familier with Applescript, but I'll have a go.

Cheers for any suggestions.
User avatar
fogeuk
Level 1
 
Posts: 20
Joined: July 28th, 2008, 5:18 pm

Re: xmltv file inporting

Postby Alexandre Colucci » February 6th, 2009, 6:03 pm

is there any way to have EyeTV rescan the file each time EyeTV (v3.1) starts up

No.

Or maybe an AppleScript command to TELL eyeTV to rescan/reload the xmltv file?

You can make an Applescript script that tells EyeTV to load/reload the XMLTV file.
The following sample script will prompt you to choose the XMLTV file. You can of course improve the script so that it periodically tells EyeTV to reload the file. You should find some samples in the forum.

Code: Select all
set theFile to choose file
tell application "EyeTV"
   open theFile
end tell
User avatar
Alexandre Colucci
Elgato Systems
 
Posts: 141
Joined: October 23rd, 2007, 8:30 am

Re: xmltv file inporting

Postby fogeuk » February 6th, 2009, 6:46 pm

Thank you very much Alexandre, that looks just what I was after.

Scott
User avatar
fogeuk
Level 1
 
Posts: 20
Joined: July 28th, 2008, 5:18 pm

Re: xmltv file inporting

Postby subd » February 9th, 2009, 11:57 am

I use a bash script like this:

Code: Select all
#!/bin/sh
open -ga EyeTV listings.xml


Saved as update.sh and then added as a cron job to run every night.
Mac Mini Core 2 Duo 2GHz 2GB
EyeTV 250 Plus, EyeTV 3.0.4
iPhone 2G FW 2.2.1
User avatar
subd
Level 2
 
Posts: 37
Joined: January 9th, 2009, 12:29 am
Location: Dublin, Ireland

Re: xmltv file inporting

Postby PhyrePhox » February 9th, 2009, 10:10 pm

subd wrote:I use a bash script like this:

Code: Select all
#!/bin/sh
open -ga EyeTV listings.xml


Saved as update.sh and then added as a cron job to run every night.


Thank you for this. I currently have a cron (well, launchd) job running to download the updated listings every night, but I couldn't figure out how to automate the dragging-to-EyeTV part.

One question: I always quit EyeTV after adding the new xmltv listings, because someone told me to...no, really, I don't have a good reason to do it, but I had heard that it acted funny after adding listings without restarting. Do you have any problems with adding the latest xmltv and proceeding to use EyeTV without relaunching?
User avatar
PhyrePhox
Level 1
 
Posts: 28
Joined: November 27th, 2007, 7:38 pm

Re: xmltv file inporting

Postby Alexandre Colucci » February 10th, 2009, 9:40 am

Do you have any problems with adding the latest xmltv and proceeding to use EyeTV without relaunching?


As far as I know there is no problem to use EyeTV without relauching after adding the latest xmltv. If you see any issue, please report it so that we can fix it.
User avatar
Alexandre Colucci
Elgato Systems
 
Posts: 141
Joined: October 23rd, 2007, 8:30 am

Re: xmltv file inporting

Postby fogeuk » February 12th, 2009, 12:21 pm

Just a follow up...

I went for adding a re-occuring iCal entry that runs an applescript...this one:
Code: Select all
tell application "EyeTV"
   open "/Users/scott/xmltv/xmltv.xml"
end tell


When this runs, it reports an error that the script didn't finish and that some data could not be added, and sure enough, I only have 8 days worth of schedules in EyeTV. If I then grab the xmltv.xml file and drop it onto EyeTV in the dock, it does its thing, and I now have 14 days of schedules. Is that open command formatted correctly? Do I need to use POSIX path or something?
User avatar
fogeuk
Level 1
 
Posts: 20
Joined: July 28th, 2008, 5:18 pm

Re: xmltv file inporting

Postby sjk » February 12th, 2009, 7:15 pm

Have you tried running that AppleScript in Script Editor?
sjk
Charter Member
 
Posts: 3679
Joined: November 15th, 2007, 10:13 pm
Location: Hawaii

Re: xmltv file inporting

Postby fogeuk » February 12th, 2009, 7:31 pm

Yeah, that gives me a slightly more detailed error:

"Can't make some data into the expected type"

I've attached the xmltv file itself, can't see anything obviously wrong with it, and it does import the full 14 days when drag-dropped.

Cheers,
Attachments
xmltv.xml.zip
The XMLTV file
(1011.14 KiB) Downloaded 143 times
User avatar
fogeuk
Level 1
 
Posts: 20
Joined: July 28th, 2008, 5:18 pm

Re: xmltv file inporting

Postby sjk » February 12th, 2009, 8:27 pm

Thanks for the additional info. Hopefully it's useful to someone who's more capable of helping you than I am.
sjk
Charter Member
 
Posts: 3679
Joined: November 15th, 2007, 10:13 pm
Location: Hawaii

Re: xmltv file inporting

Postby SteinBra » March 25th, 2009, 2:34 pm

Hi...
Im new to this forum... and I dont know if this is the right place for my question.

But...

Im from Norway, we have no program guide distributor for the wonderful app. eyetv in this country, and I have a hardtime getting built a xmltv file for Norway..

Anyone have a 'good' guideline for how to make one, and get i work on eyetv....

In forehand thanks for all help to 'us up north'... :)
User avatar
SteinBra
Level 1
 
Posts: 1
Joined: November 28th, 2007, 12:28 pm

Re: xmltv file inporting

Postby fogeuk » April 2nd, 2009, 11:24 am

Just another follow up, I've given up trying to get Applescript to TELL eyeTV to import the file, just doesn't want it, so I tried subd's BASH script shown above...but called from iCal rather than cron and that works fine.

SteinBra : Not sure I can help really, you need to find a XML provider of TV shows, if its in XMLTV format, you can drop it straight in using the methods mentioned in this thread, however, I use Radio Times XML feed, and its in their own format, so wrote a java program to convert it to XMLTV format.

So, my only suggestion is do a google search for things like... XMLTV norway and you may be able to find a provider.
User avatar
fogeuk
Level 1
 
Posts: 20
Joined: July 28th, 2008, 5:18 pm

Re: xmltv file inporting

Postby rogerabc » April 24th, 2009, 5:25 pm

Hi Fogeuk,

Would you be kind enough to share your jave prog to produce the Radio Times xmltv file.

I found a script which may be of use to you:

http://benblaughs.blogspot.com/2009/02/ ... g-epg.html

Cheers,

Roger
User avatar
rogerabc
Level 1
 
Posts: 2
Joined: March 24th, 2009, 8:08 pm

Re: xmltv file inporting

Postby fogeuk » April 24th, 2009, 6:22 pm

Hi Roger, I hope its ok for me to share this app, and not breaking any of Radio Times' terms and conditions, anyway I'm not making the source code available, as one day I might build it up into a more comprehensive app, but you can install the compiled program, no problem.

http://www.satscape.co.uk/java/eyetv/launch.jnlp

This link will download, install and run it, and also create a shortcut. It will also update automatically. No Garrentees it will work for you, just not tested it enough. It will also run on Windows and Linux should you want that. and it only generates the file, I have a seperate shell script (see above BASH script) to import into EyeTV. Both the app and the script are set to run using iCal.

Can I also ask you don't run it too often, so as to not hammer the Radio Times web site, otherwise they may charge for the service or shut it down :( I run mine every 6 days, which is ample, the guide contains about 14 days of programmes.

fogeuk AKA Scott
User avatar
fogeuk
Level 1
 
Posts: 20
Joined: July 28th, 2008, 5:18 pm

Re: xmltv file inporting

Postby mac.gebruiker » April 24th, 2009, 7:17 pm

[quote="PhyrePhox"][quote="subd"]I use a bash script like this:

Code: Select all
#!/bin/sh
open -ga EyeTV listings.xml


I have 2 jobs that create an XML file. O

As I understand one is written in Ruby (extension .rb) the other I don't know (extension .sh). I can start each of them in a terminalwindow.

Do I understand correct that the above coding drops the generated XML file on EyeTV?

If so, how can I incoporate those line in my .rb &.sh files so that starting either automatically drops the generated file onto EyeTV?

Thanks for the solution.
User avatar
mac.gebruiker
Charter Member
 
Posts: 583
Joined: November 22nd, 2007, 12:21 pm
Location: Netherlands (EU)

Re: xmltv file inporting

Postby fogeuk » April 24th, 2009, 7:28 pm

The .sh file you have is a BASH shell file, so open that one up in textEdit and at the end drop in:

open -ga EyeTV listings.xml

That line does do the import into EyeTV, but make sure the path is correct, eg. mine is

open -ga EyeTV /Users/Scott/xmltv/rt.xml

I think thats all you'd need.
User avatar
fogeuk
Level 1
 
Posts: 20
Joined: July 28th, 2008, 5:18 pm

Re: xmltv file inporting

Postby jelockwood » January 22nd, 2010, 2:23 pm

Finding this thread and the Java utility from Satscape has been a life saver.

I have previously used a different utility as discussed in this thread viewtopic.php?f=120&t=1690&p=34433#p8230

Unfortunately it currently is not working in that EyeTV 3.3 says it cannot parse the resulting XML file. Equally unfortunately the original developer seems to have disappeared off the face of the earth a long time ago. I had not changed the utility (there is no newer version) so either this is a result of Radio Times making a change or Elgato have made a change in EyeTV 3.3.

This other utility had some advantages over the Java/Satscape one in that it -

    1. Automatically told EyeTV to import the results after it had finished downloading and building the XML file.
    2. Colour coded the different types of TV programmes, just like EyeTV itself does for EPG data obtained via DVB.
    3. It also lets you define the hours a channel broadcasts so that EyeTV correctly shows a channel as off-air when appropriate.

Would anyone be willing to look at this utility and see where it is going wrong? And secondly it might be worth considering enhancing the formatting of the results produced by the SatScape utility in-line with this.

As a tip, the final XML file is created and stored within the application package as a file called radiotimes.xml you also need to edit channels.dat in the same place to define the list of channels to download (and hours they are on-air if not 24hours). The scripts are also accessible in the application package.
User avatar
jelockwood
Level 2
 
Posts: 67
Joined: November 28th, 2007, 12:44 am
Location: London,UK

Re: xmltv file inporting

Postby moose45 » March 15th, 2010, 10:28 pm

fogeuk wrote:Yeah, that gives me a slightly more detailed error:

"Can't make some data into the expected type"

I've attached the xmltv file itself, can't see anything obviously wrong with it, and it does import the full 14 days when drag-dropped.

Cheers,

In response to fogeuk, having a quick look at your file it include lines such as the following:
<episode-num>Bumble's Afraid of the Dark</episode-num>

This doesn't follow the explanation of episode-num as found on http://www.xml.com/pub/a/2004/02/18/xmltv.html
which lists The "system" attribute in <episode-num> has two allowed values: "xmltv_ns", , and "onscreen".

The eyetv xmltv loader is quite fussy such as not allowing linefeeds within the description tag, which passes online xml validators but causes the load into eyetv to fail.
User avatar
moose45
Level 2
 
Posts: 30
Joined: November 28th, 2007, 6:51 pm

Re: xmltv file inporting

Postby moose45 » March 15th, 2010, 10:37 pm

Unfortunately it currently is not working in that EyeTV 3.3 says it cannot parse the resulting XML file. Equally unfortunately the original developer seems to have disappeared off the face of the earth a long time ago. I had not changed the utility (there is no newer version) so either this is a result of Radio Times making a change or Elgato have made a change in EyeTV 3.3.


Would anyone be willing to look at this utility and see where it is going wrong? And secondly it might be worth considering enhancing the formatting of the results produced by the SatScape utility in-line with this.




That would be the "newline" characters which appear when the radiotimes "update" the information for a programme. It causes the <description> tag to run over more than one line, which in turn eyetv complains about.
User avatar
moose45
Level 2
 
Posts: 30
Joined: November 28th, 2007, 6:51 pm

Re: xmltv file inporting

Postby Cookie » April 7th, 2010, 8:33 pm

Hi all,

I just made a tiny script to update the XMLTV guide of EyeTV. It can automatically be by launchd.

Here it is:
Code: Select all
#!/bin/sh

EYETV=$HOME/Applications/EyeTV.app
TARGET_DIR=$HOME/Library/Xmltv
CURL=`which curl`
MAIN_URL='http://xmltv.tvsajten.com/xmltv/'
CHANNELS=$HOME/Library/Xmltv/channels.txt

#cleanup
rm -f $TARGET_DIR/*.xml

#update all channels
while read line; do
  for i in {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14}; do
    DATE=`date -v+"$i"d "+%Y-%m-%d"`
    TARGET=${line}_$DATE.xml
    CMD="$CURL --silent --compressed -R --user-agent tv.swedb.se.widget $MAIN_URL/$TARGET.gz -o $TARGET_DIR/$TARGET"
    $CMD
    open -ga $EYETV $TARGET_DIR/$TARGET
  done
done < $CHANNELS


I know, it's not that comfortable as it should, but it works. It expects a directory named
Xmltv in your Library folder. There, you should create a file named channels.txt containing the xmltv-IDs of the channels you like to download (e.g. hd.svt.se). Consult the channels.xml file for them. Next, you should adjust the path to the EyeTV application. That's it (at least for us here in Sweden, the others have of course some work to adjust the URL as well).

Hope this helps,

Cookie
---------------------------------
Intel C2D MacMini (Snow Leopard Server)
EyeTV 610
Turbo.264, Turbo.264 HD
iPod touch
User avatar
Cookie
Level 2
 
Posts: 65
Joined: November 27th, 2007, 7:01 pm
Location: Sweden


 
Welcome, Guest
Elgato FAQ Find Elgato on Facebook and become a fan Follow us on Twitter Available on the App Store Update to EyeTV 3