Leaderboard


Popular Content

Showing content with the highest reputation on 04/23/2019 in all areas

  1. 1 point
    AUTOMATING DOWNLOADING 14-DAY EPG FROM XMLTVLISTINGS.COM, Steps 1 & 2 of 3 This is for a Mac; I am running 10.14.3 (current OS) on a 2010 Mac Mini Server. I'll try to spell this out in simple commands; I'm not a programmer - if I can do this, so can you. Thanks to LOTS of help from posters above & on the other thread in this Forum, and some Internet sleuthing, here is a short program that will accomplish 2 of 3 steps needed to automate the EPG sourced from xmltvlistings.com: download a 14-day EPG and load it into EyeTV. The 3rd step for full automation, running it daily at, say, 5 am, requires a different short set of commands that I will test in the next 48 hours and post Step 3 when it's running. WHAT YOU HAVE TO DO FIRST: a. Sign up for an xmltvlistings.com account (14 day free trial), set up your custom channel lineup, and in your dashboard there take note of 2 pieces of information: the API key, and your 4-digit channel lineup number. The lineup number appears after you've set up the lineup; the API key is issued when you sign up for the account. Both numbers are in your dashboard whenever you log in. When entered in the program below, these numbers eliminate the need for you to log in to download the EPG. b. Prepare EyeTV to receive an xmltv EPG file: do a manual download (just this once) from xmltvlistings of the EPG for your channel lineup. It will give you a 7-day EPG listing. Open EyeTV and in Preferences set the EPG source to 'none'. Next, drag the downloaded EPG file onto the EyeTV icon to load the EPG. You won't see it in program listings until you go to the Channels window and do 3 things. First, mark as active (checkbox) exactly the same channels you specified for your xmltvlistings channel lineup. Second, in the EPG column, open the drop down menu and select the bottom option, xmltv. This must be done manually for each active channel, but just this once. Ignore the inactive channels. For each channel when you do this, you will be asked to assign the corresponding channel from your xmltvlistings lineup (which is why you had to load it into EyeTV first). Third, save this as a new channel lineup (see bottom of Channels page) and delete the previously active one; the new one will become your active channel lineup for the EPG. This last step is necessary because I found by trial and error that otherwise the EPG selections revert back to TVGuide or ATSC whenever you quit EyeTV / restart the computer. c. On your Mac, in your User/[username]/ directory, create a new folder named Scripts. PROGRAM TO DOWNLOAD EPG / LOAD INTO EYETV: Notes: I tested this, it works. If you try it and it doesn't work, try retyping the commands yourself. Mine initially errored because I evidently had picked up some stray characters when copying & pasting. Type the following program into TextEdit (first set it to do plain text files, not rich text, in Preferences). Save it with a descriptive file name, here I'll use getepg. No file type is needed. I dispensed with a conditional command in the example previously posted here to check for an active Internet connection; I added a 30 second pause to make sure the download has time to complete (that can be shortened if you wish). In line 3, the '14' is a variable you choose with the number of days listings you want (14 is the maximum). You can also delay it, for example 14 days listings starting tomorrow; see the xmltvlistings site under Help . . . API for how to do that. Now here's the program. Be sure to substitute the name you chose for your program each time the name I chose (getepg) appears. Brackets show information you need to insert (without the brackets!). #!/bin/bash cd /Users/[yourusername]/Scripts/ curl https://www.xmltvlistings.com/xmltv/get/[your API key]/[your lineup #]/14 > xmltv.xml #pause 30 seconds as cushion for download to complete sleep 30s #load EPG into EyeTV open -a EyeTV xmltv.xml Save this script as a text file without file type, and drag the file into the Scripts folder you previously created. As written, that's where the downloaded EPG file will automatically go. To identify this as an executable program, now open Terminal and type the following 2-lines of instructions (you only have to do this once): cd /Users/[yourusername]/Scripts/ chmod 755 getepg My next and final step is to automate this, and I'll post a working result. Meanwhile, to run the above program manually, log into Terminal and type these 2 commands; the first is not necessary if you are already in Terminal in the Scripts directory: cd /Users/[yourusername]/Scripts/ ./getepg What this will accomplish: log into your xmltvlistings account, download a 14-day EPG into your Scripts folder (where it will overwrite any previous EPG download), and load it into EyeTV, where it will almost instantly populate the Program Guide. THANK YOU, THANK YOU to everyone who has contributed on this Forum with their time and knowledge and enabled me and others to restore an EPG to EyeTV!